I have been stuck for days now.
I am using the latest AVR Studio and WINAVR. I am trying to talk to the dataflash on the DB101 module. It uses USART0 as SPIM.
void DF_SPI_init (void)
UBRR0 = 0;
PORTG |= (1<<PG5);
DDRG |= (1<<DDG5); // set SS as outputs
UCSR0C = (1<<UMSEL01) | (1<<UMSEL00) | (1<<UCSZ00) | (1<<UCPOL0); //Enable SPI in Master mode, mode 3
UCSR0B = (1<<RXEN0)|(1<<TXEN0);
UBRR0 = BAUD;
PORTG &= ~(1<<PG5);
I used debug stepping into it to see if the registers were set to right numbers, but they were not.
UCSR0C and UCSR0B were unchanged though this call.
Any help will be greatly appreciated.