I am using Raspberry pi in CoDeSys. I have connected Adruino to Raspberry pi through SPI pins where Adruino is sending data and Raspberry pi needs to receive that data which I am not able to get.
Can someone please help me in understanding how to receive data over Raspberry pi in CoDeSys?
I tried to use function:
spiMaster.transfer(TXBUFF, RXBUFF, Len, Delay, Freq) but didn't work. I don't understand what the issue could be.
I didn't find any description for the input arguments provided to above function. So, I declared these variables and used as input arguments.
I am using Raspberry pi 4.
I have used pins on Raspberry pi for SPI connections:
MISO: GPIO 9
MOSI: GPIO 10
CLK: GPIO 11
Chip enable CE1: GPIO 7
Ground is common for both Raspberry pi and Adruino.
I checked on Raspberry pi SPI pins too using oscilloscope, but it looks that Raspberry pi is not sending any data.
So, I suspect that the function I am using is not correct.
Anyone has any suggestion?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am using Raspberry pi in CoDeSys. I have connected Adruino to Raspberry pi through SPI pins where Adruino is sending data and Raspberry pi needs to receive that data which I am not able to get.
Can someone please help me in understanding how to receive data over Raspberry pi in CoDeSys?
I tried to use function:
spiMaster.transfer(TXBUFF, RXBUFF, Len, Delay, Freq) but didn't work. I don't understand what the issue could be.
I didn't find any description for the input arguments provided to above function. So, I declared these variables and used as input arguments.
I am using Raspberry pi 4.
I have used pins on Raspberry pi for SPI connections:
MISO: GPIO 9
MOSI: GPIO 10
CLK: GPIO 11
Chip enable CE1: GPIO 7
Ground is common for both Raspberry pi and Adruino.
I checked on Raspberry pi SPI pins too using oscilloscope, but it looks that Raspberry pi is not sending any data.
So, I suspect that the function I am using is not correct.
Anyone has any suggestion?
Have you enabled SPI in Pi using raspi-config
Yes
reduce SPI Maxspeed in the CODESYS config.