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 Porteus 7 professional for circuit simulation... and using AVR studio 4.
Now the problem is I am doing coding for making baud rate of 9600 or 19200 or what ever but when i am simulation the program it's working on baud rate of only 1200: what is the problem behind this i am sending the code all the file please tell me if i am wrong any where:I am using AT MEGA 2560 in the project :
View attachment serial comm.rar
Thanks Regards
ISMAIL
I am using Porteus 7 professional for circuit simulation... and using AVR studio 4.
Now the problem is I am doing coding for making baud rate of 9600 or 19200 or what ever but when i am simulation the program it's working on baud rate of only 1200: what is the problem behind this i am sending the code all the file please tell me if i am wrong any where:I am using AT MEGA 2560 in the project :
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 #include<avr/io.h> #include<avr/interrupt.h> #include<delay.h> #define Baud_rate 19200 #define ubrr_value (((F_CPU/(Baud_rate * 16UL))-1)) int a,c=1; int main(void) { DDRB=0XFF; DDRD=0XFF; UBRR0H = (ubrr_value>>8); UBRR0L = (ubrr_value); sei (); UCSR0B=(1<<RXCIE0) | (1<<TXCIE0)|(1<<RXEN0)|(1<<TXEN0); UCSR0C=(3<<UCSZ00); while(1) { //_delay_ms(10); //UDR0='p'; //a=UDR0; /*for(int i=0;i<=256;i++) { UDR0=i; }*/ } } int b=1; ISR (USART0_RX_vect) { PORTB=c; c++; a=UDR0;; UDR0=a; } ISR (USART0_TX_vect) { PORTD=b; b++; }
View attachment serial comm.rar
Thanks Regards
ISMAIL