??? 01/22/06 09:59 Modified: 01/22/06 10:45 Read: times |
#108036 - Using USBXpress Responding to: ???'s previous message |
These links show implementation and its problem using USBXpress.
"UART to USB data transfer" http://www.cygnal.org/ubb/Forum9/HTML/000445.html "Data trsnsfer from UART to USB" http://www.cygnal.org/ubb/Forum9/HTML/000537.html "Block_Write problem in USBXpress" http://www.cygnal.org/ubb/Forum9/HTML/000718.html "USBexpress Device to Host" http://www.cygnal.org/ubb/Forum9/HTML/000645.html Summarized here. a) USBXpress firmware library provides these resources, - Communication channel over USB, Block_Read() and Block_Write() - Transfer timing, USBXpress pseud-interrupt (interrupt #16) b) UART interrupt and buffers USB ISR occupies fairly long execution period. Therefore, UART must be handled by interrupt. Though USB is a packet (burst) transfer, but UART is basically continuous transfer. To connect these different type communications, buffer is needed to resolve timing issue. - Set UART interrupt priority high, USB to low. - For UART TX, ring buffer is suitable. For UART RX, double buffer is better. c) Combine them! In the USBXpress pseud-interrupt, receive data to TX buffer with Block_Read() and send contents of RX buffer with Block_Write(). Thats all. - Handle both Block_Read() and Block_Write() in RX_COMPLETE condition - Send 'empty data' when no data on buffer d) Multi-thread in host application As USB character, devices cannot notify to host PC until host polls the device. To ensure high speed communication, host must poll the device frequently. Unfortunately, USBXpress host API blocks application execution. Therefore multi-thread approach is needed to call USBXpress API. Optionally, e) 'Control channel' for baudrate setting and handshake signals USBXpress provides only single IN/OUT channel, respectively. To make another 'control channel', this small protocol is useful. - Add 'header' to each USBXpress transfer, both IN/OUT. - 'Header' consist of two field, number of data bytes and data type. - Data type distinguishes a) usual UART communication b) 'control' data, such as baudrate setting or handshake signals c) empty data f) Detection of device connection/disconnection Device connection/disconnection is detected using WM_DEVICECHANGE message on Windows application. This method is available not only for USBXpress but for any USB device. Please see this topic. "Trouble handling connect/disconnect with UsbXPress" http://www.cygnal.org/ubb/Forum9/HTML/000701.html Tsuneo |
Topic | Author | Date |
C8051F320 USB<->RS232 how to make it | 01/01/70 00:00 | |
SiLabs Website | 01/01/70 00:00 | |
To make an USB-serial converter | 01/01/70 00:00 | |
Using USBXpress | 01/01/70 00:00 | |
FTDI's latest | 01/01/70 00:00 | |
SiLabs Mistake | 01/01/70 00:00 | |
converter usb<->rs232,SPI,SMBus, 1-wire | 01/01/70 00:00 | |
USBXpress and other examples on SiLabs | 01/01/70 00:00 | |
Q: How can you eat a whole whale? | 01/01/70 00:00 | |
you wer give the pole, now you want us t | 01/01/70 00:00 | |
SiLabs![]() | 01/01/70 00:00 | |
BEWARE | 01/01/70 00:00 |