Hi,
I have interfaced RFID and atmega162 as in picture , but I am getting garbage with blank spaces, hypens on lcd , please see my code and tell me whats could be the problem, Hoping for your help.
Please have a look on schematic and also coding for USART. What could be the problem that Y i getting garbagr on my lcd.
Coding I used for USART for getting input from rfid and displaying on LCD, all other lcd functions are not included in code below.
I initialized my uart using the code below I got it on internet.
I am getting data from RFID using
Regards,
I have interfaced RFID and atmega162 as in picture , but I am getting garbage with blank spaces, hypens on lcd , please see my code and tell me whats could be the problem, Hoping for your help.
Please have a look on schematic and also coding for USART. What could be the problem that Y i getting garbagr on my lcd.
Coding I used for USART for getting input from rfid and displaying on LCD, all other lcd functions are not included in code below.
I initialized my uart using the code below I got it on internet.
Code:
UCSR0C = 0b10000110;
// Enable Tx and Rx, disable interrupts
UCSR0B = 0b00011000;
// Normal speed, disable multi-proc
UCSR0A = 0b00000000;
// Baud rate 1200bps, assuming 1MHz clock
UBRR0L = BAUD_PRESCALE; // Load lower 8-bits of the baud rate value..
// into the low byte of the UBRR register
UBRR0H = (BAUD_PRESCALE >> 8); // Load upper 8-bits of the baud rate value..
// into the high byte of the UBRR register
Code:
while ((UCSR0A & (1 << RXC0)) == 0); // Do nothing until data have been received..
// and is ready to be read from UDR
return(UDR0); // return the byte