ADC sample time varies whle using USB HID rpotocol

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ADC sample time varies whle using USB HID rpotocol

跳至解决方案
951 次查看
kamransial
Contributor I

I am using Kiel uvision for arm bare metal example project of  usb device with K20 72 Mhz.I have configured hid to 1 endpoint to send adc data to PC. hid binterval time is 1ms after every 1 ms the PC sends in token to kinetis controller and controller sends 64 bytes of adc data to pc. I have set adc on continuous conversion in interupt mode if i do not connect controller to pc the sample time of adc remains constant but when i connect controller to pc the samples time varies about 10 usec. i want a constant sample time of adc and usb communication in hid

mode together.

标签 (2)
0 项奖励
回复
1 解答
729 次查看
CarlosCasillas
NXP Employee
NXP Employee

Hi Kamran,

Have you verified the ADC conversion time and the ISR duration? Have you checked the duration of the USB transmission function? On some USB tasks, the interrupts are disabled, and during such time, the ADC interrupts will not be serviced. So, you could try implementing DMA transfers for moving the ADC results to a memory buffer at the same time that the USB is transferring the data to the PC.


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
1 回复
730 次查看
CarlosCasillas
NXP Employee
NXP Employee

Hi Kamran,

Have you verified the ADC conversion time and the ISR duration? Have you checked the duration of the USB transmission function? On some USB tasks, the interrupts are disabled, and during such time, the ADC interrupts will not be serviced. So, you could try implementing DMA transfers for moving the ADC results to a memory buffer at the same time that the USB is transferring the data to the PC.


Hope this will be useful for you.
Best regards!
/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复