Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem in serial communication with hardware of ATMEGA32...

Status
Not open for further replies.

ismbn

Full Member level 3
Joined
Feb 11, 2012
Messages
160
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,308
Location
Mumbai. india
Activity points
2,444
Hi all...

I am using ATmega32. I have done this coding
Code:
int main(void)
{

	uart_init(103);  // set 9600 baud rate
	DDRA=0xFF;
	DDRB=0xFF;
	DDRC=0xFF;

	while(1)
	{
		PORTA=PORTB=PORTC=0xFF;
		_delay_ms(100);
		PORTA=PORTB=PORTC=0x00;
		_delay_ms(100);
		print('A');  // send 'A' via usart
	}
}

and burned (using USBasp for burning)it with Fuse setting for external ceramic resonator...
LOW Fuse = 0xCE;
HIGH Fuse = 0xC9;
But i am getting the correct communication on 600 Baud rate not on 9600 Baud rate...
I not understanding where i am wrong... please help me...
I have checked the same hardware before 3-4 week, It was working fine....
Please Help Its Urgent

Ismail
 

I am using serial Port communication via RS232..
On TXDpin i am getting 6.40V
And on RXD pin I am getting 7.79V

is there any problem with this

Ismail
 

What is the ceramic resonator frequency?
Did you previously use the same hardware with the same resonator?

- - - Updated - - -

I hope you have connected a MAX232 between the PC and AVR
 

thank you

What is the ceramic resonator frequency?

i have connected 16MHz crystal with 22pF cap...

Did you previously use the same hardware with the same resonator?

yes i have used it... this that kit only for which we have communicated in
https://www.edaboard.com/threads/265009/


- - - Updated - - -

I hope you have connected a MAX232 between the PC and AVR
yes i have connected that MAX232... why Sir?

Ismail
 

You said that you measure 7v in the rx/tx pins and this is wrong , you mean the AVR pins right?
 

You said that you measure 7v in the rx/tx pins and this is wrong , you mean the AVR pins right?
yes i have measured it.. but don't know that is it right or no?

yah this is the avr pin only

- - - Updated - - -

will you believe me if i will tell you i am getting 8.09 V form USBasp.. which i am using to burn the Hex

ismail
 

check whether MAX232 is working properly or not..........
or change MAX232 ic and see.........
 

Hi jjeevan007..
Thanks for the reply...
But as i told i am getting 8V from the USB... and more i am getting the correct output at 600 baud rate, if i am setting it to 9600...
after this is there is need to change the MAX... what do you think... :roll:
Ismail
 

i think the multimeter which you are using is not working properly, because u cant get USB voltage more than 5v,

so change the battery of multimeter and try to measure the voltage.........


jeevan
 

yes i think you are right.... i doing that only

ismail
 

Post your schematic, Most probably the problem is with hardware.

The fuse setting for oscillator may be problem.
 

Post your schematic, Most probably the problem is with hardware.

The fuse setting for oscillator may be problem.

Yes i also think the problem is with hardware only... because in simulation its working gr8.
this is a ready made kit... i have just this that i am attaching...

and the fuse bits are

Lower fuse = 0xCE;
Higher fuse =0xC9;

CKSEL0=1
CKSEL1=1
CKSEL2=1
CKSEL3=1

SUT0 = 1
SUT1 = 0

CKOPT =0

this setting is for
using external ceramic resonator.
frq. range is 1MHz and above full R/R swing in clk option
startup time = 0 ms additional delay after reset
Oscillator option= full R/R Swing


ismail

- - - Updated - - -

try this.........
Code:
uart_init(47);

i made
Code:
uart_init(47);
still its giving the output on 600 bps only....

but how it is possible....

ismail
 

Attachments

  • K245.pdf
    355.4 KB · Views: 88

Hay I have done it....it is working fine.... I am not sure but.. there is some problem in AVR studio 6 I think. I will put some screen shots tomorrow
 

please see the images which cause the problem



Ismail
 

Attachments

  • 1.png
    1.png
    209.3 KB · Views: 72
  • 2.png
    2.png
    214.9 KB · Views: 66
  • 3.png
    3.png
    231 KB · Views: 68
  • 4.png
    4.png
    229.1 KB · Views: 63
  • 5.png
    5.png
    229.9 KB · Views: 76

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top