Discussion in "8051 Discussion Forum" started by    kmag1953    Apr 30, 2018.
Mon Apr 30 2018, 12:56 am
#1
I need help on how to write a serial input timeout – the sample code in C that I need with 8051 microcontrollers. The input serial timeout is that if there is no key pressed from the PC for more than 60 seconds, then the program should display a timeout.

Tue May 01 2018, 12:29 am
#2
This sounds like a homework question, so we don't supply code.
One way would be to use the timer to generate interrupts every 50mS.
In the interrupt handler add one to a count.

When a character arrives clear the count.
If the count ever reaches 60*20, display the timeout message.


[ Edited Tue May 01 2018, 11:51 am ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

carpinteyrowrl
Fri Apr 19 2024, 02:51 pm
DonaldJAX
Fri Apr 19 2024, 01:08 pm
Lewisuhakeply
Thu Apr 18 2024, 06:00 pm
Darrellciz
Thu Apr 18 2024, 11:07 am
Charlessber
Thu Apr 18 2024, 09:29 am
BartonSem
Thu Apr 18 2024, 04:56 am
DonaldKnown
Thu Apr 18 2024, 12:24 am
utaletxcyw
Wed Apr 17 2024, 10:21 am