USB CDC project for a 8-bits microcontroller

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

USB CDC project for a 8-bits microcontroller

USB CDC project for a 8-bits microcontroller

Hi everyone,

 

I would like to contribute to the Freescale Community sharing a simple project in which I have developed a customized USB communication through a Virtual COM (CDC).

This project is based on a 8-bits microcontroller - particularly MC9S08JS family - working on CodeWarrior Development Studio 10.3.

I attach a zip file with two internal files. One of them is the complete CodeWarrior project and the other is the USB CDC driver.

Files are working properly, and obviously they are totally safe. Users only have to add their routines to send and receive data through endpoints functions.

 

I really hope that it can help someone to build a USB CDC project in an easier and faster way.

 

Best regards,

Mauricio.

标签 (1)
附件
评论

Hi Mauricio,

It's great you posted USB CDC project for MC9S08JS.

I've run it successfully on MC9S08JS16 and able to receive data. However I have some issues while sending data back to the host. Basically it works only once while receiving still works fine.

What do I wrong?

Here is part of my code:

...main loop:

for(;;) {

     Check_USBBus_Status();

     if(CheckEndPointOUT(EP2))

     {

          EndPoint_OUT(EP2);

          if (EP2_Buffer[0] == 'X')

          {

               Led_PutVal(ledRed);

               EP3_Buffer[0] = 'A';

               EndPoint_IN(EP3, 1);

          }

          else Led_PutVal(ledOff);

     }

}

I'm sure I can receive bytes correctly because I can switch on the LED sending 'X' letter and switch it off by sending something else.

After sending the 'X' for the first time it responds with 'A' correctly but that's the only one. Then LED can be switched on/off but no more data is sent back to host.

Could you help me?

Thank you in advance!

Best regards,

Michal

无评分
版本历史
最后更新:
‎11-28-2013 05:22 PM
更新人: