完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我试图生成直接从HARMony附带的cdc_com_port_single示例派生的USB应用程序的最小可能工作版本。问题是,当设备从USB端口连接或断开时,框架不会产生中断事件。首先,设备必须是PIC32MX270F256D、和谐1_8_1、mplabx 3.35、编译器版本1.42。该设备是只带有USB连接器(和解耦电容器)的裸板。为了尽可能完整,我已经包括了相关图像,比如和谐配置器设置和时钟图。HED),所有的工作正常,返回一个有效句柄,并设置事件处理程序。但是,当设备从USB端口连接/断开时,事件处理程序永远不会被调用。另外,Windows对连接没有反应。在连接/断开USB设备时,不会触发system_inter..c的主ISR例程中的断点。非常感谢您的帮助!
以上来自于百度翻译 以下为原文 Hi, I have tried to generate the smallest possible working version of a USB app derived directly from the cdc_com_port_single sample that comes with Harmony. The problem is that no interrupt events are ever generated by the framework when device is connected/disconnected from a USB port. First the essentials, device is PIC32MX270F256D, harmony 1_8_1, mplabx 3.35, compiler version 1.42. The device is on a bare board with a USB connector (and decoupling capacitors) only. In an attempt to be as complete as possible, I have included what I believe to be the relevant images such as the Harmony configurator settings and clock diagram. When stepping through the INIT state (see app.c attached), everything works correctly, a valid handle is returned, and the event handler is set. However, the event handler is never invoked when the device is connected/disconnected from a USB port. Also, Windows does not react to the connection. While connecting/disconnecting the USB device, a breakpoint in the main ISR routine of system_interrupt.c is never triggered. Any help would be greatly appreciated! Attached Image(s) Attachment(s) app.c (9.95 KB) - downloaded 59 times |
|
相关推荐
10个回答
|
|
在调试项目并在附图中所示的断点停止时,很明显,Harmony没有生成代码来启用USB单元……U1CON中的位USBEN是0,因此USB单元没有上电。因此,当插入USB端口时,Windows不会做出反应。如果我手动设置USBEN位,恢复执行,并插入USB端口,Windows就会做出反应,但是因为设备没有响应,因为没有生成中断并且事件处理程序从未被调用,所以Windows会失败。如果它能对这个问题有所启发,很明显,这是一个和谐的配置错误。
以上来自于百度翻译 以下为原文 When debugging the project and stopping at the breakpoint shown in the attached image, it is obvious that Harmony has not generated code to enable the USB unit....bit USBEN in U1CON is 0, so the USB unit is not powered up. As a result, Windows does not react when plugging into a USB port. If I manually set the USBEN bit, resume execution, and plug into a USB port, Windows reacts, but it fails because the device does not respond since no interrupts are generated and the event handler is never invoked. I have included system_init.c in case it can shed some light on the subject. Clearly, this is a Harmony configuration error. Attached Image(s) Attachment(s) system_init.c (20.25 KB) - downloaded 51 times |
|
|
|
我不确定,但是在我看来,48MHz的USB时钟不能从内部8MHzFRC获得(即使您将UFRCEN设置为ON)。我不能找到6 X PLL的内部FRC在时钟图。我需要一个外部时钟,我想。
以上来自于百度翻译 以下为原文 I am not sure, but it seems to me that the 48MHz USB clock cannot be got from the internal 8MHz FRC (even if you set UFRCEN to be ON). I cannot find 6 x PLL for the internal FRC in the Clock Diagram. An external clock is needed, I think. yts |
|
|
|
图显示时钟为8MHZ/2×24/2=48 MHz…基本上是96/2…所以是48兆赫。
以上来自于百度翻译 以下为原文 The diagram shows clock is 8MHz / 2 * 24 / 2 = 48MHz....basically 96 / 2....so it is 48MHz |
|
|
|
嗨,奥马,我的理解是:从系统锁相环出来的48MHz时钟不是为了USB时钟,而是为了外围总线时钟。系统PLL的输出时钟没有连接到USB模块。请参阅附图。
以上来自于百度翻译 以下为原文 Hi Oma; My understanding is as follows; The 48MHz clock coming out from the System PLL is not for the USB Clock but for the Peripheral Bus Clock. The output clock of the System PLL is not connected to the USB module. Please see the attached figure. yts Attached Image(s) |
|
|
|
嗨,Oma;系统PLL输出设置为48兆赫在你的情况下。你的PIC PIC32 MX27 0F256D50?请参阅PIC手册“60001168J.pdf”的342页,Speed()=40MHz–()表示空白字段;40MHz设备的封装标记不包括Speed50=50MHzyts。
以上来自于百度翻译 以下为原文 Hi Oma; The System PLL output is set to be 48MHz in your case. Is your PIC PIC32MX270F256D-50? Please see the 342 page of the PIC manual “60001168J.pdf”. Speed ( ) = 40 MHz – ( ) indicates a blank field; package markings for 40 MHz devices do not include the Speed 50 = 50 MHz yts |
|
|
|
该图显示了来自外部时钟的8MHz,因为UFRCEN关闭。
以上来自于百度翻译 以下为原文 The diagram shows the 8MHz coming from an external clock, because UFRCEN is off. |
|
|
|
如果PIC32MX270F256D-50使用外部8MHz时钟,则没有问题。但是该图显示FNOSC被设置为FRCPLL,这意味着使用内部时钟。
以上来自于百度翻译 以下为原文 Hi qhb; There would be no problem if the external 8MHz clock was used in PIC32MX270F256D-50. But the diagram shows that FNOSC is set to be FRCPLL, meaning that the internal clock is used. yts |
|
|
|
啊,是的,我明白你的意思了。如果从FRC到USB PLL的线路不能满足48MHz的要求,那么它的用途是什么?另外,你认为U1CON的USBEN位没有被设置为USB模块电源的原因是因为FNOSC没有被设置为PRIPLL吗?见评论和图像显示USB寄存器在第二个职位。
以上来自于百度翻译 以下为原文 Ah, yes, I see what you mean. What would be the purpose of the line from FRC to the USB PLL if it could never satisfy the requirement for 48MHz? Also, do you think that the reason that USBEN bit of U1CON has not been set to power the USB module is because FNOSC is not set to PRIPLL? See comment and image showing USB registers on second post. |
|
|
|
嗨,Oma,我没有足够的知识来回答你的问题。至于第一个问题,我也有同样的问题。信息1:我的PIC板上有PIC32 MX27 0F256B-50。外部X时钟在那里使用。我今天确认CDCKM的单一样本在我的董事会中运作良好。当我根据您的设置配置PIC来使用内部时钟时,这个示例不起作用。信息2:作为PIC32 MX27 0F256等没有“活动时钟调谐功能”,我总是使用外部X-TAL时钟来满足USB规范(频率稳定度)。/偏差+-2500 ppm)。YTS
以上来自于百度翻译 以下为原文 Hi Oma; I cannot have enough knowledge to answer your questions. As for the first question, I have had the same question. Information #1: I have my pic board with PIC32MX270F256B-50. The external x-tal clock is used there. I conformed today that the cdc_com_port_single sample works well in my board. When I configured the PIC by following your settings to use the internal clock, this sample did not work. Information #2: As PIC32MX270F256 etc. do not have an “Active clock tuning functionality”, I have always used an external x-tal clock to satisfy the USB specification (the frequency stability/deviation +- 2500ppm) . yts |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5153 浏览 9 评论
1995 浏览 8 评论
1924 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3167 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2221 浏览 5 评论
718浏览 1评论
604浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
489浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
618浏览 0评论
516浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-16 21:23 , Processed in 1.160627 second(s), Total 65, Slave 58 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号