完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我需要控制一个外部ADC,一个AD5664,从一个PIC32 MZ通过SPI。通信工作正常,但速度很慢。时钟设置为50兆赫。要设置所有四个通道,我需要发送4组24位,总共96位,在50 MHz时应该略小于2个。然而,整个通信需要大约15个美国!在示波器上,我注意到每组24位都需要正确的发送时间,即时钟是正确的,但是每组之间有很长的延迟。也就是说,从我发出WrdEffFuffelHub句柄到SDO线发送第一位的时间大约有3个。在连续写入操作之间也有大约3个美国。此外,AD566R需要在每组24位之前和之后的同步信号,所以我使用SPI驱动程序中的回调来启动和操作,并且我看到同步线下降和第一位出现在SDO线之间的长停顿,并且在最后一个之间有较长的延迟。组中的位和同步线返回。MCU是PIC32 MZ2048 EFG064。我使用的是和声V1.11。对什么是错误的有什么想法?
以上来自于百度翻译 以下为原文 I need to control an external ADC, an AD5664R, from a PIC32MZ through SPI. The communication works properly but it's very slow. The clock is set to 50 MHz. To set all four channels I need to send 4 groups of 24 bits, for a total of 96 bits, which at 50 MHz should take a little less than 2 us. However, the entire communication takes about 15 us! On the oscilloscope I noticed that each group of 24 bits takes the correct amount of time to be sent out, that is the clocking is correct, but there are long delays between each group. Namely, from the time I issue the Write_Buffer_Handle to the time the first bit is sent out on the SDO line there are about 3 us. There are also about 3 us between consecutive write operations. Moreover, the AD5664R requires a SYNC signal before and after each group of 24 bits, so I use callbacks in the SPI Driver for operationStarting and operationEnded, and I see long pauses between the SYNC line going down and the first bit coming out of the SDO line, and a longer delay between the last bit in the group and the SYNC line going back up. The MCU is a PIC32MZ2048EFG064. I'm using HARMony V1.11. Any ideas on what can be wrong? |
|
相关推荐
10个回答
|
|
|
每一层都增加了一点开销,你当然可以同时发送所有96位。它会减少开销,或者你可以移除和声层并直接通过硬件发送。
以上来自于百度翻译 以下为原文 Every layer adds a little bit of an overhead. You certainly can send all 96 bits at once. It'll decrease the overhead. Or you can remove the Harmony layers and send directly through the hardware. |
|
|
|
|
|
对于SPI,您可能希望在SPI中断例程中实现SPIX任务状态机,而不是为主循环中的SPIX任务提供服务。这是从SPI快速频率方面受益的一种方式。
以上来自于百度翻译 以下为原文 Hi, For SPI, you may want to implement the SPI_tasks state machine within the SPI interrupt routine rather than to serve the SPI_tasks from the main loop. This is one way to benefit from the speedy SPI peripheral frequency Regards |
|
|
|
|
|
好的,我在期待一些开销,但不是微秒级的。不管怎样,我试着直接使用PLIB函数,但是我不能让我的代码编译。看来我找不到包含文件的正确组合。如果我试图包含Sealth/Stuly.h和外围设备/外围设备,我会从EbIIAp32 MZ2048 EFM100.h文件中获得大量未声明的标识符错误。然后,我试图包括外围设备/SPI/PLEBYSPI.Hutal/INT/PLBIJ.INT.H和St/INT/INS/SysIn .h,但是我得到了一个未定义的引用ToysSyIn SooSeleStabel.我找不到任何有关如何直接使用PLIB库的好的文档或例子。到目前为止,我一直使用和声驱动程序,只使用GPIO的PLIPHPOUNT函数。我从哪里开始?
以上来自于百度翻译 以下为原文 Ok, I was expecting some overhead, but not in the order of microseconds. Anyway, I tried to use the PLIB functions directly, but I can't get my code to compile. It seems I can't find the right combination of include files. If I try to include system/system.h and peripheral/peripheral.h I get lots of undeclared identifier errors from the ebi_p32mz2048efm100.h file. Then I tried to include only peripheral/spi/plib_spi.h peripheral/int/plib_int.h and system/int/sys_int.h, but then I get an undefined reference to SYS_INT_SourceDisable. I can't find any good documentation or examples on how to use the PLIB libraries directly. So far I always worked with Harmony drivers, and only used the PLIB_Ports functions for GPIO. Where do I start? |
|
|
|
|
|
嗨,有几个SPI例子的和谐。你检查过了吗?和谐V2.03B:C:Microchip和谐 V2Y03BApp\Excel 外围 SPISPILCONBURBACK Microchip 和声 V2Y03BAppFSSST25FAT(SPI闪存)
以上来自于百度翻译 以下为原文 Hi, There are a few SPI examples in Harmony. Did you check them ? In Harmony v2.03b : c:microchipharmonyv2_03bappsexamplesperipheralspispi_loopback c:microchipharmonyv2_03bappsfssst25_fat (SPI flash memory) Regards |
|
|
|
|
|
是的,我检查过了,但是它们都是基于和谐驱动程序,而不是外围程序库。例如,我从这个例子中提取了一个初始化代码,并把它添加到一个新的和声应用程序中,但是我不知道如何编译它,而不需要将整个SPI驱动程序添加到我的项目中。从我所理解的,我应该能够只包括SPI外围库。
以上来自于百度翻译 以下为原文 Yes, I checked them, but they are all based on the Harmony Driver, not the Peripheral Library. For instance, I took the initialization code from one of the example, and added it to a new Harmony application, but I can't figure out how to compile it without adding the entire SPI Driver to my project. From what I understand, I should be able to include only the SPI Peripheral Library. |
|
|
|
|
|
我回答我自己关于如何使用外围图书馆的问题。显然,XC32编译器的协调和部分支持补丁文件存在问题(在论坛上还有一个线程),因此包括外围设备/外围设备。H总是会产生一些错误。但是,我能够编译我的代码,包括只包括外围设备/SPI/PLEBYSPI.Hutal/INT/PLEBY INT.H和St/INT/SysItIn。在协调器中实现中断系统服务。现在代码编译,但我看不到SDO引脚的预期输出。它一直很低。但是,我可以看到SCK和同步线的行为符合预期。返回故障排除…
以上来自于百度翻译 以下为原文 I reply to my own question about how to use the Peripheral Library. Apparently, there's a problem with Harmony and the Part Support Patch Files of the XC32 compiler (there's another thread on the forum), so including peripheral/peripheral.h always generates some errors. However, I was able to compile my code by including only peripheral/spi/plib_spi.h peripheral/int/plib_int.h, and system/int/sys_int.h and enabling the Interrupt System Service in the Harmony Configurator. Now the code compiles, but I don't see the expected output from the SDO pin. It is constantly low. However I can see the SCK and the SYNC lines behaving as expected. Back to troubleshooting... |
|
|
|
|
|
找到了丢失的部分,我不得不手动映射SDO引脚到正确的RPN端口输出,因为和声配置器不让我这样做图形。现在它以最小的开销工作。
以上来自于百度翻译 以下为原文 Found the missing piece, I had to manually map the SDO pin to the correct RPn port output, since Harmony Configurator doesn't let me do that graphically. Now it works with minimal overhead. |
|
|
|
|
|
看来你使用的是和声V1.11。我建议你尝试和谐V2.XX,它优化了PLIBS,这将节省20-30的时间。
以上来自于百度翻译 以下为原文 it seems you are using Harmony v1.11. i would suggest you to try Harmony v2.xx which has optimized PLIBs which will save you 20-30% of the timing. |
|
|
|
|
|
MHC“引脚设置”或“PIN表”窗口应该允许你这样做,我想知道你怎么能做到这一点。
以上来自于百度翻译 以下为原文 MHC "Pin Setting" or "Pin Table" windows should allow you to do that, i am wondering how are you not able to do that. |
|
|
|
|
|
你使用SPI FIFO缓冲器(在PIC32上被称为HiNBUF,Ben在DSPIC33 E中发言)?它有助于使单词更接近,特别是在更高的速度。
以上来自于百度翻译 以下为原文 Do you use the spi FIFO buffer (bit is called ENHBUF on pic32, and BEN in dspic33e speak) ? It helps getting the words even closer together, specially on higher speeds. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 06:46 , Processed in 0.915087 second(s), Total 92, Slave 75 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
5425