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 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
Regards...
Ismail
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