Replies: 4 comments 3 replies
-
Agree with your assessment - @MX682X ? |
Beta Was this translation helpful? Give feedback.
-
I've never used SPI on this devices before, so no practical experience, but I know that SPI is a bi-directional interface - every bit that is clocked out is one bit that is clocked in and the same time - Data received and Data transmitted Interrupt flags are the same things on SPI. |
Beta Was this translation helpful? Give feedback.
-
After failing to get it to work on an Attiny412 I moved to a 204 with more pins and got below SPI Host mode sketch for writing to a 74HC595D working. Now I want to find out why I failed on the 412.
[EDIT] Got it sort of working on the 412 now, but very unstable. I suspect a HW issue, most likely in my breadboard. |
Beta Was this translation helpful? Give feedback.
-
And you are right about SPI working without an ISR. I made a lighter version of the demo sketch.
|
Beta Was this translation helpful? Give feedback.
-
I am playing with SPI and a shift register to understand how the SPI mechanism actually works. I now want to make a low level SPI transmitter sketch to blink all sorts of led patterns and save that for the future as a SPI building block/example.
I was peeking in the SPI source code and am puzzled about the byte transfer function:
https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/libraries/SPI/src/SPI.cpp#L353
Why is it checking the SPI_RXCIF_bm (Receive Complete Interrupt Flag)?
I had expected the SPI_TXCIF (Transfer Complete Interrupt Flag) to be checked.
[edit] Or do I need to interpret it that you are not using SPI buffer mode but using SPI_RXCIF_bm to define the 7th bit position in the SPI Intflags register and in fact checking the Bit 7 – IF Interrupt Flag, for SPI Normal Mode?
Beta Was this translation helpful? Give feedback.
All reactions