this is part of arduino code for a 48*8 LED matrix display…i didnt undrstand the terms SPCR,SPDR,SPSR ,MSTR ,<<. . . anyone please explain the logic of this code…thanks
void setupSPI() {
byte clr;
SPCR |= ( (1 << SPE) | (1 << MSTR) ); // enable SPI as master
//SPCR |= ( (1<<SPR1) | (1<<SPR0) ); // set prescaler bits
SPCR &= ~( (1 << SPR1) | (1 << SPR0) ); // clear prescaler bits
clr = SPSR; // clear SPI status reg
clr = SPDR; // clear SPI data reg
SPSR |= (1 << SPI2X); // set prescaler bits
//SPSR &= ~(1<<SPI2X); // clear prescaler bits
delay(10);
}
MSG_txt_1-16-16_48x8_v15.10.ino (12.5 KB)