# AVR ATmega32 UART Not Reciving

I'm trying simple UART transaction functions for ATmega32. I can send the bytes but not receiving anything. I am using polled UART receive.

void UARTReadStr12(uint8_t *buffer) {

uint16_t i = 0;

for (i = 0; i < 12; i++) {
while (!(UCSRA & (1 << RXC)));
*(buffer + i) = UDR;
}
}


and initialized as,

void UARTInit(uint16_t ubrr_value) {

//Set Baud rate
UBRRL = ubrr_value;
UBRRH = (ubrr_value >> 8);
UCSRC = (1 << URSEL) | (3 << UCSZ0);
UCSRB = (1 << RXEN) | (1 << TXEN);
}

• Uhm well it is hard to tell sth from that, if you can send something from atmega then it looks like uart is working. You are sure that you send data to atmega with proper baud rate and proper data format ? – molok May 18 '16 at 17:36