|
| 1 | + |
| 2 | + |
| 3 | +--- |
| 4 | + |
| 5 | +# USB_UART4 Click |
| 6 | + |
| 7 | +- **CIC Prefix** : USB_UART4 |
| 8 | +- **Author** : Katarina Perendic |
| 9 | +- **Verison** : 1.0.0 |
| 10 | +- **Date** : Jan 2018. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +### Software Support |
| 15 | + |
| 16 | +We provide a library for the USB_UART4 Click on our [LibStock](https://libstock.mikroe.com/projects/view/2310/usb-uart-4-click) |
| 17 | +page, as well as a demo application (example), developed using MikroElektronika |
| 18 | +[compilers](http://shop.mikroe.com/compilers). The demo can run on all the main |
| 19 | +MikroElektronika [development boards](http://shop.mikroe.com/development-boards). |
| 20 | + |
| 21 | +**Library Description** |
| 22 | + |
| 23 | +Initializes and defines UART bus driver, and defines driver's functions for comunication (reading and writing) between USB UART 4 clicks. |
| 24 | + |
| 25 | +Key functions : |
| 26 | + |
| 27 | +- ``` void usbuart4_writeByte(uint8_t input) ``` - Write Single Byte |
| 28 | +- ``` uint8_t usbuart4_readByte() ``` - Read Single Byte |
| 29 | +- ``` uint8_t usbuart4_byteReady() ``` - Check for new byte received |
| 30 | + |
| 31 | +**Examples Description** |
| 32 | + |
| 33 | +- System Initialization - Intializes UART module |
| 34 | +- Application Initialization - Driver intialization |
| 35 | +- Application Task - (code snippet) - Checks if new data byte have received in rx buffer (ready for reading), |
| 36 | + and if ready than reads one byte from rx buffer. In second case aplication task writes |
| 37 | + message data via UART. |
| 38 | + |
| 39 | +```.c |
| 40 | +void applicationTask() |
| 41 | +{ |
| 42 | + char tmp; |
| 43 | + uint8_t rdyFlag; |
| 44 | + |
| 45 | +// RECEIVER - UART polling |
| 46 | + |
| 47 | + rdyFlag = usbuart4_byteReady(); |
| 48 | + |
| 49 | + if (1 == rdyFlag) |
| 50 | + { |
| 51 | + tmp = usbuart4_readByte(); |
| 52 | + mikrobus_logWrite( &tmp, _LOG_BYTE ); |
| 53 | + } |
| 54 | + |
| 55 | +// TRANSMITER - TX each 2 sec |
| 56 | + |
| 57 | + /* for (tmp = 0; tmp < 9; tmp++) |
| 58 | + { |
| 59 | + usbuart4_writeByte( MESSAGE_DATA[tmp] ); |
| 60 | + mikrobus_logWrite( "MESSAGE SENT", _LOG_LINE ); |
| 61 | + } |
| 62 | + Delay_ms(2000);*/ |
| 63 | + |
| 64 | +} |
| 65 | +``` |
| 66 | + |
| 67 | +The full application code, and ready to use projects can be found on our |
| 68 | +[LibStock](https://libstock.mikroe.com/projects/view/2310/usb-uart-4-click) page. |
| 69 | + |
| 70 | +Other mikroE Libraries used in the example: |
| 71 | + |
| 72 | +- UART |
| 73 | + |
| 74 | +**Additional notes and informations** |
| 75 | + |
| 76 | +Depending on the development board you are using, you may need |
| 77 | +[USB UART click](http://shop.mikroe.com/usb-uart-click), |
| 78 | +[USB UART 2 Click](http://shop.mikroe.com/usb-uart-2-click) or |
| 79 | +[RS232 Click](http://shop.mikroe.com/rs232-click) to connect to your PC, for |
| 80 | +development systems with no UART to USB interface available on the board. The |
| 81 | +terminal available in all Mikroelektronika |
| 82 | +[compilers](http://shop.mikroe.com/compilers), or any other terminal application |
| 83 | +of your choice, can be used to read the message. |
| 84 | + |
| 85 | +--- |
| 86 | +### Architectures Supported |
| 87 | + |
| 88 | +#### mikroC |
| 89 | + |
| 90 | +| STM | KIN | CEC | MSP | TIVA | PIC | PIC32 | DSPIC | AVR | FT90x | |
| 91 | +|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:| |
| 92 | +| x | x | x | x | x | x | x | x | x | x | |
| 93 | + |
| 94 | +#### mikroBasic |
| 95 | + |
| 96 | +| STM | KIN | CEC | MSP | TIVA | PIC | PIC32 | DSPIC | AVR | FT90x | |
| 97 | +|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:| |
| 98 | +| x | x | x | x | x | x | x | x | x | x | |
| 99 | + |
| 100 | +#### mikroPascal |
| 101 | + |
| 102 | +| STM | KIN | CEC | MSP | TIVA | PIC | PIC32 | DSPIC | AVR | FT90x | |
| 103 | +|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:| |
| 104 | +| x | x | x | x | x | x | x | x | x | x | |
| 105 | + |
| 106 | +--- |
| 107 | +--- |
0 commit comments