Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/13/00 23:01
Read: times


 
#2662 - RE: help with code?
I know nothing about the ADuC812 but quickly scanning your code the fundamental error is that you have the serial port initialisation right there inside the program loop.

The instructions that set up the serial port should come before the execution loop, and be executed once and once only.

Also you should test to see if it has sent the previous character, and is ready to accept another before the SBUF write. If you test after then you are wasting processor time that could be employed to get more data ready to send.

Let the transmitter set the TI bit. That's what it does for a living - so don't keep forcing it as it can only send as fast as the Baud rate will allow. Also don't mess with the Rx when you are sending - you can ignore the receiver if the interrupts are disabled (which they are by default).

The code probably works on the emulator because the emulator does not take into account the time it actually takes to send the byte.

BTW how do you know which channel the data is coming from?

--Alan

List of 5 messages in thread
TopicAuthorDate
help with code?            01/01/70 00:00      
RE: help with code?            01/01/70 00:00      
RE: help with code?            01/01/70 00:00      
RE: help with code?            01/01/70 00:00      
RE: help with code?            01/01/70 00:00      

Back to Subject List