The FSL_USB_Stack Processor Expert component (see USB CDC reloaded) has been extended to support USB CDC for the Freescale S08MM128 targeted for medical devices:
In the FSL_USB_Stack I can now select the MC9S08MM128 both for small and banked memory models:
I used a TWR-S08MM128 board with the TWR-SER board. The picture shows the green S08MM128 board in the front connected through the TWR-ELEV board to the TWR-SER board. Attached to the TWR-SER board is the USB cable for USB communication and powering the boards.
A demo application is available (see links below). The application echos received characters on the host console:
/*
* cdc_demo.c
*/
#include "cdc_demo.h"
#include "USB1.h"
#include "LED1.h"
#include "LED2.h"
static uint8_t cdc_buffer[USB1_DATA_BUFF_SIZE];
static uint8_t in_buffer[USB1_DATA_BUFF_SIZE];
void CDC_Run(void) {
int i;
for(;;) {
while(USB1_App_Task(cdc_buffer, sizeof(cdc_buffer))==ERR_BUSOFF) {
/* device not enumerated */
LED1_Neg(); LED2_Off();
}
LED1_Off(); LED2_Neg();
if (USB1_GetCharsInRxBuf()!=0) {
i = 0;
while( i<sizeof(in_buffer)-1
&& USB1_GetChar(&in_buffer[i])==ERR_OK
)
{
i++;
}
in_buffer[i] = '\0';
(void)USB1_SendString((unsigned char*)"echo: ");
(void)USB1_SendString(in_buffer);
(void)USB1_SendString((unsigned char*)"\r\n");
}
}
}
The result is then shown in the host console:
Note: It is important that USB1_App_Task() is called early and often. Otherwise the USB device might not be recognized by the host.
Links:
Happy USBinging




Pingback: CRC Calculation with MCU10 | MCU on Eclipse
Excellent Info. Thanks, Take a look of my newer blog http://candelectronica.blogspot.com/
You can setup USB component as HID device?
Right now the FSL USB Processor Expert component only supports CDC. Extending it for HID (and MSD) is on my short list.