Quantcast
Channel: Microcontrollers, Programming and IoT
Viewing all articles
Browse latest Browse all 1271

SPI freezes

$
0
0
Hello,
I have an issue with spi that freezes. I'm using atmega88 with nrf24l01 but when i try to test spi communication i get stuck.
I initialize spi based on atmel specifications:
Code:
DDRB |= (1<<DDB5) | (1<<DDB3) | (1<<DDB2) |(1<<DDB1);
SPCR |= (1<<SPE)|(1<<MSTR);
And when I try to test out writing to spi (and print out to terminal ) i get stuck looping... ( i have usart initialized and used without any problems)
Code:
char spi_rw(unsigned char x)
{
    SPDR = x;   
    //get...
SPI freezes

Viewing all articles
Browse latest Browse all 1271

Latest Images

Trending Articles



Latest Images