完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
项目配置:MPLAB X 3.40,XC32 V1.42,和声V1.09,PIC32 MZ2048 EFH144I有一个SPI端口被正确配置为写入外部芯片,外部芯片在MISO线路上放置数据,而我写哑字节,以便读取从我发送的地址的数据。SPI端口确实支持在字节写入期间读取数据字节到读取缓冲器中,但是无论如何我无法找到访问写入期间读取的数据。接收缓冲器不能直接访问,只能通过SPI5BUF(我使用SPI5)。我已经确认我正在使用我的逻辑分析器接收MISO PIN上的数据,但是我在读取一个字节写入后的任何时候都读取SPI5BUF。例如:写3个地址字节,写一个‘0’虚拟字节,再写入另一个‘0’虚拟字节,数据在第二次‘0’写入期间出现在MISO线上。IED是写入和读取的协调功能,但它们似乎是从我的发送缓冲区写入字节,然后等待外部芯片驱动CLK和MISO线路,但是我的设备在虚拟写入期间发送数据。然后,我试着手工写一个字节到SPI5BUF,等待SPICOLL位清除,然后从SPI5BUF读取数据,仍然得到零。和声写和读和写Errad函数没有足够的说明来知道我是否可以在写期间进行同步读取……有人做了吗?这种类型的数据传输工作,或者用和声函数调用或没有?我将非常感谢任何帮助!拉里
以上来自于百度翻译 以下为原文 Project configuration: MPLAB X 3.40, XC32 V1.42, HARMony V1.09, PIC32MZ2048EFH144 I have an SPI port properly configured to write to an external chip, the external chip puts data on the MISO line while I write dummy bytes in order to read the data from the address I sent. The SPI port does support reading the data byte into the read buffer during the byte write but I can not find anyway to access the data read back during the write. The receive buffer is not directly accessable, only through SPI5BUF (I am using SPI5). I have confirmed that I am receiving data on the MISO pin using my logic analyzer but anytime I read SPI5BUF after a byte write I only read 0. Example: Write 3 address bytes, write a '0' dummy byte, write another '0' dummy byte and the data appears on MISO line during the second '0' write. I first tried the Harmony functions which write and read but they appear to write the bytes from my transmit buffer and then wait for the external chip to drive the CLK and MISO lines, but my device sends the data back during dummy writes. Then I tried manually writing a byte to SPI5BUF, waiting for the SPIBUSY bit to clear, then read the data from SPI5BUF, still getting zeroes. The Harmony Write and Read and WriteRead functions do not have sufficient description to know if I can do a synchronous read during a write ... Has anyone made this type of data transfer work, either with Harmony functions calls or without? I would greatly appreciate any help! Larry |
|
相关推荐
3个回答
|
|
SPI5BIF是接收缓冲区。SPI不是这样工作的,主控总是驱动时钟线。确保Harmony没有让MISO处于模拟模式。这样一来,它就总是读零。当自己访问寄存器时,调试这类东西总是比较容易的,而不是像Harmony那样通过额外的层。
以上来自于百度翻译 以下为原文 SPI5BIF is the receive buffer That is not how SPI works, the Master always drives the clock line. Make sure that Harmony has not left the MISO in in analog mode. That would make it always read zero. It's always easier to debug this sort of thing when accessing the registers yourself, rather than going through an extra layer like Harmony. |
|
|
|
谢谢,我第一次使用和声,我怀疑它的准确性,在使用EBI(我已经放弃了),现在使用SPI之前,必须手动设置一些位。我知道SPI5BUF既是发送缓冲器又是接收缓冲器,我只是想知道是否有SPE。在写SIP5BUF之后,我需要做一点或等一下,这样我就可以读回数据了。我能假设仅仅读取SPI5BUF应该从接收缓冲区读取吗?我将检查MISO引脚的配置…
以上来自于百度翻译 以下为原文 Thanks, I am using Harmony for the first time and I have my doubts about its accuracy, have had to set some bits manually before using it for the EBI (which I have abandoned) and now with SPI. I know that SPI5BUF is both the transmit and receive buffer, I was just wondering if there was anything special I needed to do or a bit to wait for after writing to SPI5BUF so I can read the data back in. Can I assume that just reading SPI5BUF should read from the receive buffer? I will check the configuration on the MISO pin ... |
|
|
|
问题解决,它有助于当MISO输入引脚作为一个良好的焊接连接到从设备…
以上来自于百度翻译 以下为原文 Problem resolved, it helps when the MISO input pin as a good solder connection to the slave device ... Oy ... |
|
|
|
只有小组成员才能发言,加入小组>>
5242 浏览 9 评论
2031 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3207 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2256 浏览 5 评论
778浏览 1评论
669浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
596浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
679浏览 0评论
577浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 00:59 , Processed in 1.138884 second(s), Total 80, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号