完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
使用EF启动器套件(MZ芯片)、MPLABX 4、和声2.04、XC32 1.44加载并测试了CDCL COMPARTPORTH双演示。效果不错。对同一个端口上的回音字符做了一些微小的修改,并从Styth.CONFIG.H文件中定义了一些定义为App.CREAD和测试的。注意:将MHPC/USB选项中的EnpPNT 0缓冲区大小设置为USB Hs的64。将AppRead缓冲区大小从512更改为64。这是用户数组在U***DeVeluxCCDCARD()函数中的维度。演示不起作用。然后我尝试了不同大小的读写数组(所有都是64的倍数)。只有512个尺寸用于阅读。其他大小的工作为写。这给了我什么,除了头痛几天,所以如果任何人都有奇怪的问题与USB CDC库,检查缓冲区大小,你正在使用的阅读。
以上来自于百度翻译 以下为原文 Using EF Starter Kit (MZ chip), MPLABX 4.00, HARMony 2.04, XC32 1.44 Loaded and tested the cdc_com_port_dual demo. That worked. Made a few minor changes to echo characters on the same port and moved some #defines from the system_config.h file to app.c Reloaded and tested. Worked again. Note: The EndPpint 0 Buffer Size in the MHC/USB option must be set to 64 for the USB HS. Changed APP_READ_BUFFER_SIZE from 512 to 64. This is the dimension of the user array in the USB_DEVICE_CDC_Read() function. The demo did not work. I then tried different sizes for both the READ and WRITE arrays (all with multiples of 64). Only the 512 size worked for the READ. Other sizes worked for the WRITE. This caused me nothing but headaches for days, so if anyone is having strange problems with the USB CDC library, check out the buffer size you are using for the READ. |
|
相关推荐
3个回答
|
|
缓冲区*可以是64,但是然后您需要手动编辑Sys*.c,因为缓冲区大小必须是最大块大小和HS默认值为512字节块的整数倍…0x4040可以,0x0200将强制512字节或N×512字节缓冲器和读取请求。
以上来自于百度翻译 以下为原文 The buffer *can* be 64, but then you need to manually edit system_.c because the buffer size must be an integer multiple of the maximum block size and HS defaults to 512 byte blocks... 0x0040 is OK, 0x0200 will force a 512 byte or N*512 byte buffer and read request. /* Bulk Endpoint (OUT)Descriptor */ 0x07, // Size of this descriptor USB_DESCRIPTOR_ENDPOINT, // Endpoint Descriptor 4|USB_EP_DIRECTION_OUT, // EndpointAddress ( EP4 OUT) USB_TRANSFER_TYPE_BULK, // Attributes type of EP (BULK) 0x40,0x00, // Max packet size of this EP 0x00, // Interval (in ms) /* Bulk Endpoint (IN)Descriptor */ 0x07, // Size of this descriptor USB_DESCRIPTOR_ENDPOINT, // Endpoint Descriptor 4|USB_EP_DIRECTION_IN, // EndpointAddress ( EP4 IN ) 0x02, // Attributes type of EP (BULK) 0x40,0x00, // Max packet size of this EP 0x00, // Interval (in ms) |
|
|
|
我不认为这是MHC问题。它是传递给USPBDEVICEXCDCX Read()函数的数组的大小(在App.c中)。数组大小必须为512,否则函数不起作用。
以上来自于百度翻译 以下为原文 I don't think this is an MHC problem. It is the size of the array passed to the USB_DEVICE_CDC_Read() function (in app.c). The array size must be 512 or the function does not work. |
|
|
|
在和声驱动程序中有一行代码,测试请求大小是包大小的整数倍。CDC代码使用缓冲区大小作为请求大小。如果你编辑代码,你可以解耦它们,但是你必须传递一个足够大的缓冲区来接受一个数据包,然后你也可以请求一个完整的缓冲区。它会返回一个部分缓冲区,如果数据比你要求的少。对于MZ来说,试图节省512到64个字节是没有意义的。
以上来自于百度翻译 以下为原文 There is a line of code in the Harmony driver that tests that the request size is an integral multiple of the packet size. The CDC code uses the buffer size as the request size. If you edit the code, you can decouple them, but you have to pass a buffer that is large enough to accept a packet and then you may as well request a full buffer. It will return a partial buffer if there is less data than you requested. With the MZ there really is no point in trying to save 512-64 bytes though. |
|
|
|
只有小组成员才能发言,加入小组>>
5244 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3214 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2261 浏览 5 评论
781浏览 1评论
676浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
602浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
684浏览 0评论
581浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-26 10:01 , Processed in 1.501092 second(s), Total 83, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号