I use at_register_uart_rx_intr(user_uart_rx_intr); to register a UART0 RX interrupt function.
I’m unsure about the calls to this function.
Let’s assume the other controller, connected to UART0, sends 32 bytes.
How often user_uart_rx_intr() will be called?
32 times once for each char?
Only once delivering 32 bytes in a bunch?
Or it is unpredictable?
Thanks for your time.
I figured it out myself.
You will not get any interrupt unless the last two bytes are 0x10, 0x13 (LF and CR) (or the UART0 buffer over runs at 100 bytes or so).
Strange, my intentionn is not to send a AT command neither a String.
So why is this?
((0x01 & UART_RXFIFO_FULL_THRHD) << UART_RXFIFO_FULL_THRHD_S) |
((0x01 & UART_RX_FLOW_THRHD) << UART_RX_FLOW_THRHD_S) |
Is there a description of all these registers and definitions?
Thanks in advance.
I found that a RX full threshold would not fit to my needs because I do not have a fix packet length.
Therefore I go for a TOUT threshold.
In 8E-ESP8266__Interface_UART__EN_v0.2.pdf manual it says:
„The unit of TOUT threshold value is equal to the time of transmitting 8 byte data via UART, almost a byte.“
I guess it must read … transmitting 8 bit …
Because my max packet length is 66 bytes and stop bit and parity is enable I should set the threshold to 82?
66 * 10 (8+2) = 660 bits div 8 = 82
To have a little safety gap I will set it to 85.
Is my math correct?
And my code would be something like this:
Code: Select all
WRITE_PERI_REG(0x60000024, 85 << UART_RX_TOUT_THRHD_S | UART_RX_TOUT_EN);
I have set TOUT to 5 (5x8=40; approx. 4 Byte) and it works ok.
There is one more question.
ESP does not receive the first byte. It always shows a zero instead. I did search a bit and think that ESP seems to expect a Break signal. Is there a way to configure ESP such that it will immediately capture the first byte?
Or is there another reason?
Who is online
Users browsing this forum: No registered users and 7 guests
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
We also have a RTOS version and a MESH version too!
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!