need UART debugging tips

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

Alright..

So i have a dev board from bdmicro.com

it's a mega128 board..

here's the problem

I have two of these boards.. i wrote UART code for them, and one board works fine, and the other doesn't (with the same code)..

I'm trying to send something to hyper terminal, the first board sends the correct message, while the second board sends garbage (consistant garbage).

I pretty much coming to the conclusion that either the UART hardware in the mega128 is busted, or the RS232 chip on this dev board is busted..

Does anyone have any other suggestions before i hang my hat and declare the hardware busted?

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

What is the clock source on the boards? If you are using the internal oscillators on the mega128s, then this is likely your problem. The internal oscillators can be off of the nominal frequency by enough to cause problems with your baud rate.

Regards,
Steve A.

The Board helps those that help themselves.

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

i'm using external oscillators on the board..

for the record, other things work.. like my LCD code works on both boards..

yea.. i'm starting to give up on this.... i think it's the hardware..

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

Are you 100% sure you're running on external crystal? If you haven't changed the fuse settings, they're running on the internal RC.

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

yup.. fuse bits on both boards are identical.... could it be the external oscillator?.. maybe it's physicaly damaged

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

AAA HAHAH i got it..

okay so.. this second dev board i have, was lent to me by a friend...

the oscillator on it is 14.7MHz.. the oscillator on my board is 16MHz

LOL... so i was setting the timing wrong...

good stuff lol

i assumed my friends board was running with a 16MHz oscillator