So I understand how conditionals work using typical UART serial data transfer. In arduino if serial.available is true and if serial.read returns some value that matches some variable then an action is performed and thats good, but I don’t like the slow baud rate of UART
So I’m using SPI, but what I’m not understanding is how do I transfer the data as a slave device from the SPDR register and send it for processing WITHIN the slave MCU and apply my conditional parameters like I would if I was using UART? I understand that SPI is a serial communication protocol, but the spi.begin object seems to be reserved for UART.
I don’t need to send my data back to the master, I just want to wait for 8 bits to load into my SPDR register, then move/import/send those bits not out of MISO, but to some buffer where I’ll be able to apply my conditional statements and use the data to perform some action like I would in uart, I’d like to be able to do something like
if (Serial.available() >0){
if (Serial.read() == 'x'){
// perform some action
}
else{
But instead of serial.read it would be reading 8 bits that came in through the spi ports.
Thanks in advance
So I’m using SPI, but what I’m not understanding is how do I transfer the data as a slave device from the SPDR register and send it for processing WITHIN the slave MCU and apply my conditional parameters like I would if I was using UART? I understand that SPI is a serial communication protocol, but the spi.begin object seems to be reserved for UART.
I don’t need to send my data back to the master, I just want to wait for 8 bits to load into my SPDR register, then move/import/send those bits not out of MISO, but to some buffer where I’ll be able to apply my conditional statements and use the data to perform some action like I would in uart, I’d like to be able to do something like
if (Serial.available() >0){
if (Serial.read() == 'x'){
// perform some action
}
else{
But instead of serial.read it would be reading 8 bits that came in through the spi ports.
Thanks in advance