I have a skull-buster of a problem. Running at 57,600 baud the transmitter side works perfectly but the receiver doesn't seem to recognize an incoming character. I know the transmit interrupt is working since the interrupt handler (on a simple 8051 CPU) is capable of driving a string of characters out and they are received OK. But sending a character (or a string of characters) back into the UART fails to produce an interrupt (I've watched the interrupt pin with a logic probe on both transmit and receive). Both of the interrupt enable bits (bits 0 and 1) are set in the UART interrupt enable register, and I'm certain the character coming in is good (a loopback test to the far-end sender works just fine). The baud rate has to be correct (since the same clock drives the receiver as the transmitter), and I'm just kinda stumped. The same code I'm using to initialize it is known to have worked (about 4 years ago) in another application using the same UART.
Any thoughts??
HELP!!!!
2007-10-12
13:26:50
·
2 answers
·
asked by
doug_donaghue
7
in
Science & Mathematics
➔ Engineering
Thanks, inmorri....
After a marathon de-bugging session (it's 0145 here, in Tucson) I finally nailed the problem. It seems that there was just enough ground bounce (due to several relays being energized elsewhere at initialization) and it caused just enough noise that the receiver data available interrupt bit wasn't getting set. So, even 'tho the receiver was getting a probperly framed character and putting it in the holding register, the interrupt was never getting pulled.
All I've had to do is initialize the UARTS (there are 4 of them) -before- making energizing 4 relays and, voila!, the problem is gone.
Fortunately I have a few shots of a very good Scotch left and then I'm gonna pull the plug. Looks as if the customer will get his equipment on time after all ☺
Doug
2007-10-12
21:55:26 ·
update #1