USB CDC project for a 8-bits microcontroller

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

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.

Labels (1)
Attachments
Comments

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

No ratings
Version history
Last update:
‎11-28-2013 05:22 PM
Updated by: