drtvskuthsav
Member level 2
Hi I need small help in sending data from Atmega32 to PC via Serial Port(atleast printf). I use CodeVision AVR compiler and Proteus to simulate. I can receive data from the PC to Micro but the other way is not happening. I am getting some garbage values in the terminal. Am attaching the circuit and the code is as given
View attachment usartone_0001.jpg
Thanks to all in advance
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 /* Chip type : ATmega32 Program type : Application AVR Core Clock frequency: 7.372800 MHz Memory model : Small External RAM size : 0 Data Stack size : 512 *****************************************************/ #include <mega32.h> #include <stdio.h> #include <delay.h> void main(void) { UCSRA=0x00; UCSRB=0x08; UCSRC=0xb6;/*odd parity, 8bit*/ UBRRH=0x00; UBRRL=0x2f;/*9600*/ while (1) { printf("kuthsav"); delay_ms(1000);// Place your code here } }
View attachment usartone_0001.jpg
Thanks to all in advance
Last edited by a moderator: