Hello Martin,
I have attached a generic HID project for CodeWarrior v10.2. It is a SCI to HID bridge application, using the MC9S08JS16 MCU. It is based on Mouse example Freescale USB Stack v3.2.0, but generating a stand-alone project that doesn’t require installing any USB Stack version or placing the project on a specific location. Besides, it adds the implementation of the optional OUT endpoint, which is not included on any of the HID examples of USB Stack.
On this project, the SCI module is configured by default to 8N1, 115200 bps. These configurations are declared on file “sci.h” and on the call of function “u8SCI_init”. Then, on interrupt function “SCI_rx_srvc”, the SCI data is received and stored on the circular buffer “g_sci_rx_buf”, and the proper flags are set. Finally, on “Serial2HID_Task” function (on “Serial2HID.c” file), the SCI’s buffer is sent by HID’s IN endpoint, and the data received from HID´s OUT endpoint is sent by the SCI module.
The time interval between transaction is configured to 1mS, and this time base is generated by the TPM module, which is configured inside function “TestApp_Init” of “Serial2HID.c” file. On TPM´s interrupt function “TPM_OVF_ISR”, the circular buffer (used for transactions) is managed.
I hope you could use it as reference.
Best regards!
/Carlos