Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 2 months ago.
Delay with serial.getc()
I have had problems with a receive routine and found that characters are lost because the getc () function takes a very long time.
Then I measured the time with:
if( pc.readable()) {
led1 = 1;
sdata = pc.getc();
led1 = 0;
}
Result: 24.3µs
And then:
if( pc.readable()) {
led1 = 1;
sdata = USART2->RDR & 0xff;
led1 = 0;
}
And here the result: 350ns
Where does the delay of 24μs come from