Flutterby™! : Serial woes

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Serial woes

2003-08-26 18:32:28.748022+00 by Dan Lyke 2 comments

Aaargh! I'm at my wit's freakin' end. I'm using an Atmel ATmega8515. I'm trying to get the UART to talk at 9600 N-8-1. I have standard PC hardware right next to me sending out capital "A"s at 9600 N-8-1 so that I can compare on the 'scope. The ATmega8515 is clocked at 8MHz, my initialization code is

clr temp
out UBRRH, temp
ldi temp, 51
out UBRRL, temp
clr temp
out UCSRA, temp
ldi temp, (1<<RXEN)|(1<<TXEN)
out UCSRB,temp
ldi temp, (1<<URSEL)|(1<<UCSZ0)|(1<<UCSZ1)
out UCSRC,temp

And the output seems to be about 1/10th the speed it ought to be. I realize only about two of you understand whatintheheck that was about, but if anyone's got a clue, please help me out.

[ related topics: Hardware Hackery Dan's Life Embedded Devices ]

comments in ascending chronological order (reverse):

#Comment Re: Serial woes made: 2003-08-26 19:09:56.241807+00 by: dws

Speculation: 1/10th sounds a bit like a confusion between characters-per-second and bits-per-second.

#Comment Re: Serial woes made: 2003-08-26 21:58:41.559322+00 by: Dan Lyke

Turns out that the chip ships with its internal oscillator enabled, and I'd diddled the motor timings so that I didn't notice the difference in speed between that and the crystal.

Sigh.