Communication between K66 USB virtual serial port and PC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Communication between K66 USB virtual serial port and PC

1,009 Views
3115499229
Contributor I

First of all, thank you for answering my questions.

K66 single chip microcomputer as the control core,complete the collection of analog electric quantity and transfer the collection result through CAN and USB。Now there are the following questions:

1.How to improve the accuracy of AD acquisition? What is the relationship between sampling period and conversion time?Whether ADC accuracy can be improved by changing the configuration of conversion time register?

2.What is the reason that K66 can send data to PC, but can't receive the data sent by PC?

3.After downloading the program, connect the K66 control board and PC with USB. There is no device identification in the PC device manager. Why? During this time, the driver is replaced many times.

Thank you very much.

0 Kudos
3 Replies

900 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello,

1.How to improve the accuracy of AD acquisition? What is the relationship between the sampling period and conversion time? Whether ADC accuracy can be improved by changing the configuration of conversion time register?

Yes, when the conversion is too fast sometimes you trade the sampling speed for the accuracy, I will suggest checking the following document to know more about accuracy improvements.

2.What is the reason that K66 can send data to PC, but can't receive the data sent by PC?

The K66 should be able to receive data sent by the computer, I will suggest checking the usb_cdc_vcom_bm/freeRTOS, with this you should be able to sent and receive with the USB port.

3.After downloading the program, connect the K66 control board and PC with USB. There is no device identification in the PC device manager. Why? During this time, the driver is replaced many times.

This could be due to various problems, a hardware problem or a USB stack issue, are you using a custom board or is one of our development boards, 

Let me know if this helps you.

Best Regards,
Alexis Andalon

0 Kudos

900 Views
3115499229
Contributor I

Hello Alexis Andalon,Thank you very much for your help.

 

For  question 2: Wrong description of the problem.The problem is that when CAN is used to complete the transmission of acquisition results,K66 can send data to PC, but can not receive PC data.Why?

 

For  question 3: I use the board designed by myself.K66 single chip microcomputer as the control core,complete the collection of analog electric quantity and transfer the collection result through CAN and USB。

 

new question:K66 is often locked during commissioning.Sometimes it's useless if you can't unlock the chip. You have to change the chip.What causes the chip to be locked?What's a good way to unlock the chip?

 

Thanks again for you help.

 

Best wishes

DoudouZhang

0 Kudos

900 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello,

Question 2:

Since I can't see your code this is only a supposition, but you should avoid blocking code so any transfer can be done correctly, also as a recommendation, I will suggest using the DMA to handle the CAN transfers so this wouldn't interfere with the USB stack.

Question 3:

I think this is a software problem but if you have a FRDM-K66 maybe it is worth trying your same code to check if there isn't any hardware problem.

Question 4:

Usually, this is done when you write in the location 0x400 - 0x40C, usually in the linker file this section is reserved for the structure called Flash_Config in the startup code. If this section is modified is very likely your MCU will lock. Check the following link with some methods to unlock the board.

Best Regards,

Alexis Andalon

0 Kudos