完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
首先是背景。我正在做一个USB到串行转换器,相当于一个老学校RS232模拟调制解调器。(后端是唯一的,但是前端使用RS232端口(TX、RX、RTS、DTR、CTS、DSR、RI和DCD)中正常的8个IO线路。我使用安装有MCC 3.36的APIC32 MM0256GPM048和MPLABX 4.05。什么工作:TX、RX、RTS、DTRT什么NoCTS、DSR、RI、DCD(所有由CDCntiFICICHACTHER处理的)I DId找到下面的缺陷并启用它们:γ定义UbjdCDCpSpRePosidSrRebug,定义UARTHARDTS PORTCITS。RC3*定义了Ubj*CdcDrScAc能能能级0和MimItdTcNoScript()函数调用,将PIN设置为输入。ODE在我的末尾有一点胶粘代码,把TX消息打包回RX缓冲区和连接器、DTR、CTS、DSR、RI和DCD到物理引脚。缓冲包装+ RTS和DTR引脚按预期切换。开始调试时,我使用标准USB到串行狗耳,并验证测试程序正在正确读取输入状态。(我能够切换所有4个输入,并得到状态显示,如预期在测试程序)下,我启动了微软消息分析器(我们正在运行在Windows 10),并看了看巴士,因为我切换输入通过PIC。当我切换输入时,我看到“清除端点0x81EndoPositHalt”和“在EntdBaseStutsSuffErr.OrrRun”中的“在每个引脚切换中的对”。在3天的时间里,我一直在抨击这个bug,只是在PIC结束时需要改变我的想法来获得这些信息。状态正确传输。猜测我只是错过了一些简单的,但到目前为止没有运气。
以上来自于百度翻译 以下为原文 Bit of background first. I am working on making a USB to serial converter for what amounts to a old school RS232 analog modem. (Back end is unique but the front end uses the normal 8 IO lines in a RS232 port (TX, RX, RTS, DTR, CTS, DSR, RI, and DCD) I am using a PIC32MM0256GPM048 and MPLABX 4.05 with MCC 3.36 installed. What works: TX, RX, RTS, DTR What does not CTS, DSR, RI, DCD (everything handled by CDCNotificationHandler ) I did find the following defs and enabled them: #define USB_CDC_SUPPORT_DSR_REPORTING #define UART_DTS PORTCbits.RC3 #define USB_CDC_DSR_ACTIVE_LEVEL 0 along with the mInitDTSPin() function call to set up the pin as a input. Also the USB CDC device is running in interrupt mode. Other than the USB CDC device code I have a bit of glue code on my end to wrap the TX messages back to the RX buffer and connect RTS, DTR, CTS, DSR, RI, and DCD to physical pins. The buffer wrap + the RTS and DTR pins toggle as expected. To start out the debug I took a standard USB to serial dongle and verified the test program was reading the input states correctly. (I was able to toggle all 4 inputs and get the state to show up as expected in the test program) Next I fired up Microsoft message Analyzer (we are running on windows 10) and took a look at the bus as I toggled the inputs via the PIC. When I toggle the inputs I see "clear endpoint 0x81 feature endpoint_halt" and "Interrupt in transfer - USBD_STATUS_BUFFER_OVERRRUN" pairs at every pin toggle. Been bashing my brain against this bug for 3 days now and just running out of ideas on what I need to change on the PIC end to get the SerialState to transfer correctly. Guessing I am just missing something simple but so far no luck. |
|
相关推荐
4个回答
|
|
定义了UbjdCDCsPusith.AdxDealPosialStayl编码,SETION CONNEL LYNEL状态,GETY-LYNEL编码,以及SerialLyStand命令//SO定义UBSCDCDA支持。B.T.S.C.M.3/**的定义,定义,***
以上来自于百度翻译 以下为原文 #define USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D1 //Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and Serial_State commands //#define USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D2 //Send_Break command In u***_device_config.h ADD THIS: #define USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D3 /** DEFINITIONS ****************************************************/ /** DEFINITIONS ****************************************************/ #endif //USBCFG_H |
|
|
|
OK添加了一个编译错误消息:如果定义了(Ubj.CDCl SpPosithExpActudioMaultMyCababiListIsd3)错误,这个选项目前不被支持。看起来没有对该模式的代码支持。有什么例子需要添加这个支持吗?谢谢你的帮助!
以上来自于百度翻译 以下为原文 Ok added that and hit a compile #error message below: #if defined(USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D3) #error This option is not currently supported. Looks like there is not code support for this mode. Is there any examples out there of what is needed to add this support? Thanks for the help! |
|
|
|
得到了一些来自Microchip支持的帮助:在MCC生成的描述符和需要修复的MLA实例中存在一个错误:/*端点描述符*//siZeof(UBS.Epple DSC)、DSCYP EP、OP02IIN、γIN、CDCL IN EPLE大小、0x02.0、0x07、/*siZeof(UBS.EPU-DSC)*/UBS-描述符端点、/端点DESCRealTurl EP01IN,//EndoPotoAddiSsId中断,//AtvestTo0x08/0x00,//SiZe0x02,//间至第二行需要0x0A而不是0x08。更新固定的DSR、RI和DCD。他们现在反应如出一辙,但现在CTS被卡住了。我还没有找到设置这个位状态的代码。
以上来自于百度翻译 以下为原文 Got some help from Microchip support: There is an error in the descriptor generated by MCC and in one of the MLA examples that needs to be fixed: /* Endpoint Descriptor */ //sizeof(USB_EP_DSC),DSC_EP,_EP02_IN,_INT,CDC_INT_EP_SIZE,0x02, 0x07,/*sizeof(USB_EP_DSC)*/ USB_DESCRIPTOR_ENDPOINT, //Endpoint Descriptor _EP01_IN, //EndpointAddress _INTERRUPT, //Attributes 0x08,0x00, //size 0x02, //Interval the second to last line needs to be 0x0A rather than 0x08. Updating that fixed DSR, RI, and DCD. They react as expected now. But now CTS is stuck active. I have not located the code that sets up the state of this bit yet. |
|
|
|
请注意,上面的修复工程没有定义USP.CDCL支持。
以上来自于百度翻译 以下为原文 Note above fix works without #define USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D3 change from above. |
|
|
|
只有小组成员才能发言,加入小组>>
5150 浏览 9 评论
1994 浏览 8 评论
1922 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3164 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2220 浏览 5 评论
716浏览 1评论
602浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
486浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
616浏览 0评论
515浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-13 21:37 , Processed in 0.985936 second(s), Total 51, Slave 46 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号