# [SOLVED]problem in setting baud rate

Status
Not open for further replies.

#### ismbn

##### Full Member level 3
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:

#### internetuser2k12

##### Banned
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
@internetuser2k12
Yes i have set in right Sir alex guided me for that...

Ismail

- - - Updated - - -

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.