I am trying to set up my first serial connection between an ATmega15L and my computer. I made a small program that constantly sends out data to the serial port to test and I am running into some problems I haven’t been able to solve. I loaded the UDR to 55h so the output frequency of Tx should be about equal the baud rate divided by two. When measuring the frequency with my DMM I get a frequency of 116.2kHz, which means the output baud rate is really 232400 when it should be 9600. I set the terminal baud rate to 232400 and the result is garbage data for an output.
I am using Bary’s terminal program (which I see everyone seems to recommend from searching for USART related topics :) )
Below is the source code I am using minus a few extras such as a delay routine and LED indicator functions.
.equ cbaud = 0d32 ;9600 baud
.def rmp = R16
Reset: ldi rmp, high(ramend) ; Set up stack
out SPH, rmp
ldi rmp, low(ramend)
out SPL, rmp
ldi rmp, cbaud ; Baud rate setup
out UBRRL, rmp
ldi rmp, 0b00000000 ; UART setup
out UCSRA, rmp
ldi rmp, 0b00001000
out UCSRB, rmp
ldi rmp, 0b10000110
out UCSRC, rmp
Loop: sbis UCSRA, UDRE ; Wait for Tx complete
ldi rmp, 0x55 ; Send this number to the serial port
out UDR, rmp
Thank in advance for any assistance you can offer me.