View Single Post
Old 06-04-2009, 06:41 PM   #1535 (permalink)
MPaulHolmes
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
squiggles, you are not wasting my time! I really appreciate your suggestions. They are very helpful.

I ordered the parts today. The boards came to the engineer too. I need to ship 3 programmed AtMega8's to him, but I can't really test them first, since the old control section isn't working any more. I've simulated them, and one problem is that the simulator doesn't seem to really do a good job with the USART. The USART data register never gets empty in the simulator! It acts like an infinite loop.


void PutCharUSART(unsigned char c) {
// wait until UDR ready
while(!(UCSRA & (1 << UDRE))); // wait until the USART data register is empty.
UDR = c; // send character
}


Oh dear. Maybe I should leave that part out?
__________________
kits and boards
  Reply With Quote