Replies: 2 comments
-
The UARTs have FIFOs so when you return from |
Beta Was this translation helpful? Give feedback.
0 replies
-
I understand, I will look for methods, thank you very much!! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Good evening! I ask for advice..

In my project there is communication between the Pico Pi and an external device. I need to transfer a large amount of data and sometimes check it, to reduce the exchange time I try to reduce time delays
for this I use micros in this form - timer = micros();
while (micros() - timer < 500) {
}
in the sketch it looks like this -
Serial1.write(0xe1);
Serial1.write(0x74);
Serial1.write(byte(n));
Serial1.write(byte(m));
timer = micros();
while (micros() - timer < 500) {
}
Serial1.write(0x50);
timer = micros();
while (micros() - timer < 500) {
}
Before my command "50" I must receive a response from the processor - "3C", for which this pause of 500 μs is done. but in fact, my delay is ignored, and without having time to receive and process the response from the external device, Pico transmits my further command...
in this screenshot - E1740000 - my data, then I need a pause to receive the answer - 3C, and then there should be my command - 50..
I'm using Serial1(0, 1) as UART, baud rate is 76800
after my command 50, I again use a pause of 500 µs, in the screenshot it is calculated as 578 µs ..
it feels like I need to stop the data transfer - Serial.Stop (this is my opinion) and then do a delay...
Beta Was this translation helpful? Give feedback.
All reactions