Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Siegurd01 authored Dec 7, 2020
1 parent 508eab2 commit eec2379
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ For now comunication is made by 2 functions:
* **uart_recv( data, len, bit_length);**
* **data** (uint8_t) is the byte array where you want to store incoming bytes;
* **len** (uint32_t) is a length of incoming message (here the timeout is neded so use len=1 for now);
* **bit_length** (uint32_t) is length of 1 bit in microseconds. You can enter a length you measure for example with oscilloscope (**uint32_t bit_time = 580000**), or enter baud you know by **#define baudRate 5.6** for example (the baud value will be converted to bit time automatically)
* **sendfromserial();** uses a USB-serial interface to send messages from PC terminal to Tx pin. The message you typed would be separated from x00 and leave only x0D at the end witch is 'Enter' comand for linux like systems. So if you send comand sudo in the adruino terminal the board would send s u d o + x0D masage to the Tx pin. (Useful when comunicating with old VT100 terminals)
* **bit_length** (uint32_t) is length of 1 bit in microseconds. You can enter a length you measure for example with oscilloscope (**uint32_t bit_time = 580000**), or enter baud you know by **#define baudRate 5.6** for example (the baud value will be converted to bit time automatically).
* **sendfromserial();** uses a USB-serial interface to send messages from PC terminal to Tx pin. The message you typed would be separated from x00 and leave only x0D at the end witch is 'Enter' comand for linux like systems. So if you send comand sudo in the adruino terminal the board would send s u d o + x0D masage to the Tx pin. (Useful when comunicating with old VT100 terminals).
## Hardware
I use a chep and powerfull STM32F103C [bluepill board](https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill.html). It should work on any other STM32 board too. And maybe arduino Nano (not tested).
## Software
* [Standart Arduino IDE](https://www.arduino.cc/en/software)
* [STM32duino core](https://github.com/stm32duino/Arduino_Core_STM32)
* [Standart Arduino IDE](https://www.arduino.cc/en/software);
* [STM32duino core](https://github.com/stm32duino/Arduino_Core_STM32).
## Limitations
* Max baudrate for RX and Tx lines is 38400 (tested with osciloscope and UART decoder). That's a lot especially when no interrupts used. And you can always use usual Serial librarys for higher bauds;
* Min baud is limited by timer overflow for functions micros() and delayMicroseconds(); (1.0 baud tested with signal analyzer). Probably lower bauds (<1) would work too.
* Only 8-N-1 (standard) mode implemented for now. (8-N-1 means 1 start bit, 8 data bits, 1 stop bit).
* Only half-duplex communication implemented (RS485-like).
* While read timeout is not yet implemented you should connect both Rx and Tx pins to UART interface of the device because it will stuck on receive *while()* loop waiting for HIGH signal
* Min baud is limited by timer overflow for functions micros() and delayMicroseconds(); (1.0 baud tested with signal analyzer). Probably lower bauds (<1) would work too;
* Only 8-N-1 (standard) mode implemented for now. (8-N-1 means 1 start bit, 8 data bits, 1 stop bit);
* Only half-duplex communication implemented (RS485-like);
* While read timeout is not yet implemented you should connect both Rx and Tx pins to UART interface of the device because it will stuck on receive *while()* loop waiting for HIGH signal.
## To do:
* library;
* read timeout;
* duplex communication;
* interrupts.
* interrupts;
* RTOS usage, maybe.
## Any help would be useful!
## Thanks
Expand Down

0 comments on commit eec2379

Please sign in to comment.