Eugen_E
Full Member level 6

Hello,
I want to use SPI as master on ATmega8 clocked at 16MHz to generate a fast square signal on MOSI - not for data transmission, but for signal generation. To do this I configure SPI as master at 2Mb/s and write the 8 signal "samples" in SPDR register. In the SPI interrupt (generated at end of transmission of the previous "samples") I write 8 new "samples" in SPDR.
Because the SPI in AVR in transmission is not double buffered, i want to ask if there will be a gap in the MOSI signal between the succesive 8 samples. In the interrupt routine, I write imediatly the new SPDR value - it is computed outside ISR, in the main program.
Also, when i simulated in AVR studio, with SPDR=0xFF, the MOSI output isn't continously '1' when it transmits 0xFF, but 1010101010101010 - i think it is '1' only on the sampling edges of the SCK signal. This is strange.
I've used SPI before for communication with other chips, but without observing the actual SPI signals.
I want to use SPI as master on ATmega8 clocked at 16MHz to generate a fast square signal on MOSI - not for data transmission, but for signal generation. To do this I configure SPI as master at 2Mb/s and write the 8 signal "samples" in SPDR register. In the SPI interrupt (generated at end of transmission of the previous "samples") I write 8 new "samples" in SPDR.
Because the SPI in AVR in transmission is not double buffered, i want to ask if there will be a gap in the MOSI signal between the succesive 8 samples. In the interrupt routine, I write imediatly the new SPDR value - it is computed outside ISR, in the main program.
Also, when i simulated in AVR studio, with SPDR=0xFF, the MOSI output isn't continously '1' when it transmits 0xFF, but 1010101010101010 - i think it is '1' only on the sampling edges of the SCK signal. This is strange.
I've used SPI before for communication with other chips, but without observing the actual SPI signals.