Setting up UART after A/D Conversion

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi.

I'm having some problems transferring my A/D conversions out through my UART. I'm using an ICE 200 to emulate an AT90S4433. I'm also using the STK200 as my target board. My A/D converter is working fine. When I run my program using AVR Studio (Version 3.10), the data is not being transferred to the UART Data Register(all zeroes). Instead, I'm getting a bunch of crazy ASCII characters that are not related to my conversions (when I open a terminal to my monitor)!!! I'm thinking that I don't have the appropriate bits enabled. Here's how my register's are set up:

UBRR = BAUD9600;
UCR |= 0x08; //Enables the UART transmitter
DDRD = 0x01; //To enable PIN D1 as the transmitter???? Is //this redundant??

DDRC = 0x00; //Sets Port C as input pins
PORTC = 0x00 //Not too sure why I have this, I was following
//some existing code that worked

If anyone could help me out, it would be greatly appreciated!!

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

first off, is BAUD9600 valid for the crystal frequency you actually have in place ?

second, to get proper handshake happening you may have to enable the receiver as well as the transmitter - interfaces for rs232 often steal voltages from other pins so without seeing the schematic who knows what is going on there.

third, yes as far as I know that ddrd is redundant and may actually cause a problem.

fourth, initially I was tripped up on rs232 since I used a subroutine and call and had not initialized the stack pointer correctly beforehand. If your device has ram you need to as well.

Hope at least one of these helps you.

admin's test signature