Chaostreff-Potsdam / erika3004

19 stars 5 forks source link

Test ESP8266/32 #36

Open sirexeclp opened 4 years ago

sirexeclp commented 4 years ago

Does the ESP support RTS/CTS, can we use it to control the erika? -- Yes it does!

ESP32 has three UART interfaces, i.e., UART0, UART1 and UART2, which provide asynchronous communication(RS232 and RS485) and IrDA support, communicating at a speed of up to 5 Mbps. UART provides hardwaremanagement of the CTS and RTS signals and software flow control (XON and XOFF). All of the interfaces can beaccessed by the DMA controller or directly by the CPU.

From: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf

$4. Peripheral Interface Data transfers to/from UART interfaces can be implemented via hardware. The data transmission speed via UART interfaces reaches 115200 x 40 (4.5 Mbps). UART0 can be used for communication. It supports flow control. Since UART1 features only data transmit signal (TX), it is usually used for printing log.

By default, UART0 outputs some printed information when the device is powered on and booting up. The baud rate of the printed information is relevant to the frequency of the external crystal oscillator. If the frequency of the crystal oscillator is 40 MHz, then the baud rate for printing is 115200; if the frequency of the crystal oscillator is 26 MHz, then the baud rate for printing is 74880. If the printed information exerts any influence on the functionality of the device, it is suggested to block the printing during the power-on period by changing (U0TXD, U0RXD) to (MTDO, MTCK).

From: https://www.espressif.com/sites/default/files/documentation/0a-esp8266ex_datasheet_en.pdf Page 21

ArchibaldBienetre commented 4 years ago

We could not use ESP in the end because of a limited buffer

Can we rule out such issues here (or am I totally off track? :D )

FT232RL

The USB-to-serial adapter FT232RL supports hardware control flow (using the RTS/CTS lines), however, it can take up to three characters after the Erika sends its busy signal until the adapter stops sending data.

If CTS# is logic 1 it is indicating the external device cannot accept more data. the FTxxx will stop transmitting within 0~3 characters, depending on what is in the buffer.

This potential 3 character overrun does occasionally present problems.

source: https://www.ftdichip.com/Support/FAQs.htm

For our case, this is not enough. https://github.com/Chaostreff-Potsdam/erika3004/wiki/Hardware-control-flow-(RTS,-CTS)#ft232rl

sirexeclp commented 4 years ago

This is mostly an hardware TODO issue.

cyroxx commented 4 years ago

@sirexeclp From the different specs that you quoted, ESP32 seems to be the better choice than its predecessor ESP8266. Because of its limitations (your second quote and link), it would be cumbersome to get it to work on a ESP8266 (only UART0 has RTS/CTS and we would need to find a way to suppress information that is printed during boot).