UART debugging technique

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

Dear all,

 

I am working on my new project & using UART for Communication,

 

But it is creating some weard problem...... what I have tried for debugging Explain below

1) I checked the loop back both PC(hyper terminal)  & ATMEL code, both are working fine separately but together I am not getting any Interuppt at Controller 

2) I have checked Signal is coming till the controller port is 4.8volt

3) and weirdest I am getting Interrupt only when I pressed space, but received is OxFF 

 

I am using 328P as µc, I will share the code in'few hours, meanwhile kindly suggest If I can try something.-.-.

 

So many Experts are here:)

 

 

Rgds

Goswami

This topic has a solution.

Goswami Sourabh,

The Creator....

Last Edited: Thu. May 19, 2016 - 04:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you using a real RS232 com port or a USB to TTL adapter? If the former do you have a RS232 interface chip in your board?

 

Is the chip REALLY running at the frequency you THINK it is running at?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

See FAQ#3.

 

In particular the fact that the two loop-backs worked is quite telling. The implication is that individually they work but together they don't. That to me says "mis-matched speed".

 

How are you clocking the 328?

 

(oh and why in the name of all that is holy are you starting with interrupt comms? The way you usually approach this is simple polling send/receive first (which is simple) just to prove the link. Add the fancy stuff later. Oh and the usual advice about 'U' !!)

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

Thanks for such a quick Response......

I am using 12MHz crystal to clock 328P

& Using USB to TTL converter

 

please find attached Rough diagram

 

Rgds

Goswami

 

Attachment(s): 

Goswami Sourabh,

The Creator....

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

goswami sourabh wrote:

I am using 12MHz crystal to clock 328P

How sure you are, if it is clocked from crystal instead of internal RC oscillator?

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

jnk0le wrote:
How sure you are, if it is clocked from crystal instead of internal RC oscillator?

His point being that just wiring it up does not make it work. To activate it you have to set the CKSEL fuses. While you are messing with the fuses you also want to disable the CKDIV8 fuse which is active by default (otherwise even if CKSEL is set right you are running at 1.5MHz not 12MHz)

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

yes , I think this is the mistake I am doing, i changed 328 P Recently for some other reason & dn't change the clk

 

I'll check & Reply

 

thanks & Rgd

goswami

Goswami Sourabh,

The Creator....

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

First

Do they have the same GND?

Make sure that TX go to RX etc.

Make sure that you don't have a div8 fuse programmed in the AVR!

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

thank you the problem is solved now. The clock is not configured properly. There is mismatch between clock and F_CPU as so baud is not configured as it required. 

 

Anyways someone said if you not doing mistake thats means u r not learning new things... 

 

Thanks  and regards 

GOSWAMI 

Goswami Sourabh,

The Creator....