通过调试单步发现,在Main的第一行,SPI模块已经被初始化过了,并且TX FIFO已经满了,SPI模块已经处于BUSY状态。 如何解决?
Hi Min Wu,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
谢谢!jeremy。
1.目前SPI无法正常工作,只要往发送BUFFER送数,SR寄存器就变成12,SPI模块永远处于BUSY状态,重新启动后还是处于BUSY状态。并且SPI没有输出任何波形。
2. SPI的寄存器在重新下载程序是无法清除。目前发现只有把FLASH 清除掉,MCU中没有代码,重新上电,这时候再DEBUG,SPI寄存器才恢复初始值,所有寄存器都是0.
3.在MCU 的用户手册中发现提示Pins: The SPI pins must be configured in the IOCON register bock. In addition, use
the IOCON_LOC register to select a Location for the SCLK function。但是找遍文档和程序代码,都没有发现IOCON_LOC register。是否是SCLK时钟脚设置有问题导致的?
Hi Min Wu,
确实文档有写得不清楚的地方,你能上传一个能复现问题的可编译的例程吗?我这边板子到了话,可以复现一下问题,
你看怎么样?!
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Dear Jeremy
谢谢!问题已经解决,我自己已经找到原因了。RM寄存器描述错误,SSE 位为0是disable,不是enable
Best regards,
Min Wu(吴民)
Weikeng International Co.,Ltd
<tel:(0755)82943322-529> Tel:(0755)82943322-529
Mobile:13825245251
发件人: jeremyzhou
发送时间: 2018年6月5日 10:50
收件人: Min Wu <min.wu@weikeng.com.cn>
主题: You have been mentioned by jeremyzhou in Re: 问什么LPC8N04 的SPI无法工作? in NXP Community
<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community
You have been mentioned
by jeremyzhou <https://community.nxp.com/people/jeremyzhou?et=notification.mention> in Re: 问什么LPC8N04 的SPI无法工作? in NXP Community - View jeremyzhou's reference to you <https://community.nxp.com/message/1021105?commentID=1021105&et=notification.mention#comment-1021105>