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.

[SOLVED] problem in setting baud rate

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
How To Convert ascii to decimal To Send via USART For AT MEGA 32...

Hi all...

I am Using AVR Studio 6 for compiling...
here is my code i want to count the pulses from the external source and transmit it though USART. I have connected that(external pulse) to the External interrupt & incrementing it when interrupt hits, Also able to transmit it though USART but the problem is when i am checking it on hyper terminal the ascii characters are coming... like this "☺☻♥♣♣♠•◘○◙♂...."

What to do if i want to send it in decimal values like if the ISR hits 10 time it should send value "10"
not " ◙ "....

Is it Possible to make it like this.....

my
Code:
/*
#include <avr/io.h>
#include <avr/interrupt.h>
#include "dbits/uart.h"
#include "dbits/uart.c"
#include <math.h>
#define F_CPU 16000000l
int make;
int a=0,b=0,i=0;
void getpar() 
{
	uart_init(16);
	sei();
	uart_putc('w');
	uart_flush ();
	while(uart_available()==0);
	
	make= uart_getc();

}
void ex_intr()
{
	MCUCR |= (1<<ISC10)|(1<<ISC11)|(1<<ISC00)|(1<<ISC01);
	GICR |= (1<<INT0);
	sei();
}

int main(void)
{
	DDRA= 0xff;
	ex_intr();
	getpar();
	
	uart_putc('s');
    while(1)
    {
	}
}

ISR(INT0_vect)
{
	a++;
	PORTA=i;
	uart_putc(a);
	i++;
}

}

Regards...
Ismail
 
Last edited:

Joined
Jul 25, 2012
Messages
1,192
Helped
171
Reputation
342
Reaction score
162
Trophy points
1,343
Activity points
0
Re: How To Convert ascii to decimal To Send via USART For AT MEGA 32...

Have you set the hyperterminal baud rate properly?
 

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
@internetuser2k12
Thanks For the reply sir...
Yes i have set in right Sir alex guided me for that...

Ismail

- - - Updated - - -

https://www.edaboard.com/threads/265655/

By mistake i made the wrong title...
there for i made it correct... please look into this Sir internetuser2k12
Ismail
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top