Uart

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

Hai,
In my prototype Board's Uart Protocol is working fine in 1 Board and not in other Board.Can any tel Me what is the Problem here and what's the resolution for this ambiguous?

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

We do not have crystal balls! First, what is meant by "not working"? No characters at all or scrambled characters or something else?

Find out what is different between the two boards.

If the micro is a DIP plugged into a socket, try moving the micro from the board that works to the board that does not. Then, which board works?

Are you using a crystal to set the CPU clock frequency? If not, then it is very probable that you have run into internal clock tolerance issues between two micros.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

Write a test program that initializes the uart and sends UUUUU in a loop. Run this program on good board. Now either move avr to other board, or load same program and fuse setting into other board. Logical Troubleshooting.

Imagecraft compiler user

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

The one thing you probably say given almost no information in the original post is that it's a hardware, not a software problem. So I'll take a stab at it being C47 as I cannot tell you that it's the semi-colon on line 47.

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

Pity, the poor crystal balls must be taking the day off, today. Like they do most days!

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

My crystal ball says his second chip is fried.

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

Mine says the divide by 8 fuse is set on one, not on the other.

JC

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

Have you guys seen my crystal ball reading of the "220V appliance" as a water heater? I mentioned water heater and he just went along with it like I'd read his mind.

Imagecraft compiler user

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

Thanks for the Info i tried all above suggestion like crystal and other but all those din't resolved my problem.
well for more info,
1>I2C protocol is working superbly.
2>Checked I/O lines even that is working correctly.
3>During Debugging irrespective of the value given(Tx)it is taking '0' and during RX it is showing 'FF'

Please help to resolve this.

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

yasha.samantha wrote:
Thanks for the Info i tried all above suggestion like crystal and other but all those din't resolved my problem.

We weren't talking about your crystal. We were referring to how we can't look into a magic ball 'crystal' and see what you are trying to ask. Answer these questions first.

Are they the same micro?
Are they running the same code?
Are they on the same type of board?
What baud rate are you using?
How are you testing if it is working or not?
Are you using a level shifter for rs232?
Have you used a multimeter to check the connections or see if there are any shorts?
You could try posting code you are using.

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

Are the fuses set the same on both boards?
Are you running on the internal RC or an external crystal?

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

Are they the same micro?--Yes Atmega64
Are they running the same code?----Yes
Are they on the same type of board?----Yes
What baud rate are you using?----9600
How are you testing if it is working or not?----Hyper terminal
Are you using a level shifter for rs232?--No
Have you used a multimeter to check the connections or see if there are any shorts?--Yes
You could try posting code you are using--Sorry its not possible

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

Are the fuses set the same on both boards?--Yes
Are you running on the internal RC or an external crystal?--External Crystal

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

Without the max232 chip to convert the +-12V rs232 levels from the pc to the 0-5V ttl levels at the avr pins, there will be a problem.

Imagecraft compiler user

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

yasha.samantha wrote:
Hai,
In my prototype Board's Uart Protocol is working fine in 1 Board
yasha.samantha wrote:
Are you using a level shifter for rs232?--No

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

If you probe every pin of the AVR on boards1 and 2 do they appear to have similar signals on every pin? This is almost certainly going to be a dry joint or solder splash or similar so some part of the failing circuit will be behaving differently to the other. Pay particular attention to the clock oscillators on each board.

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

Quote:
Are you using a level shifter for rs232?--No

That would be the problem right there.
the PC serial port uses RS232 voltage levels, which require a minimum of +3v and -3v for data levels. The Atmega puts out +5v and 0v logic levels.
The +5v is fine. but 0v instead of -3v is not. It might work, but your voltage is right on the decision threshold, with no margin for either noise or component tolerance. If it works more than half the time like that, consider yourself lucky.
The solution would be to use a TTL to RS232 level shifter like the MAX232 or one of its many clones.