[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] "Why me?" UART problem.

From: Laszlo
Subject: [avr-gcc-list] "Why me?" UART problem.
Date: Sun, 20 Jun 2004 21:49:37 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113

I'm a bit of a newbie, but not a complete imbecile. Still, I'm having the most basic or UART problems. I get nothing but garbage on the PC end from a serial transmission from my 2313.

The essence of the code is this:
.include "2313def.inc"

  sbi UCR,TXEN
  ldi r16,47
  out UBRR,r16
  ldi r17,'A'
  out UDR,r17

I've put this code on the 2313. Unfortunately, my terminal programs receive 0x5F in stead of the 0x41 I expect.

The 2313 crystal is 7.3728MHz. The PC is set to 9600,n,8,1. I have also tried other 2313's , other crystal frequencies, and other PC settings. I have written a loop to cycle through 1-255 for the UBRR value looking for anything that works. No matter what I do, I can't seem to get anything but garbage.

I've connected the 2313 TX pin (pin 3) to my RS232 DB-9 RX (pin 2) (along with a ground connection and likewise the RX to TX).

I've also tried RX, displaying the received by on LEDs connected to PORTB. Apparently RX is also receiving garbage. Am I not connecting the 2313 and RS-232 correctly?

- Lost Laszlo

"That's the last time *I* answer to the name 'Sarah Conner'!" - me

reply via email to

[Prev in Thread] Current Thread [Next in Thread]