English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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

2 answers

Because there are so many variables that need to be addressed in an attempt to solve this problem (hardware, firmware, software, etc..), I can not provide a definite answer to your problem. I can only offer some ideas.

It appears that you have the 8051 receiving an interrupt when the UART transmit holding register is empty and it causes the 8051 to place the next character(s) in the queue. You also appear to have the UART scheduled to provide an interrupt when you receive a single character or a fixed number of characters (trigger point) in the FIFO.

In an attempt to debug your problem, might I suggest you disable the receive interrupt and work on a polled method for the receive side of the UART. This way you can check to see when either a valid character is received or you can see if an overrun, parity, framing, etc. error occurred.

Second, you have done a loop back of the UART on the other device to make sure that it is transmitting properly. I suggest you perform a loop back test on this device. When you receive the interrupt that the holding register is empty, you can start polling the UART to see what it has received and compare it to what was sent before sending again. This has always been the best test for me.

If the polling method works, it would appear that there is a problem with your UART programming. I know the receive status and data available have higher priority over the transmit holding register being empty so it would have to be that the interrupt is not truely enabled.

Finally, make sure you are programming the correct channel. I've been confused before and programmed the wrong channel of a dual UART before. (Its late, you are tired, etc..)

Good luck.

2007-10-12 16:27:48 · answer #1 · answered by Anonymous · 0 0

they are nonetheless round. i ended worrying about them at the same time as Chino start up bitchng at the same time as rap/rock were given commonplace and he did not get credit for innovating in at the same time as bands like faith no more suitable and the purple warm Chili Peppers were doing it contained in the early mid 80's before the Deftones even shaped

2016-10-21 01:48:07 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers