Hi, im using RZ A2M processor and trying to send data through RSPI configured as slave. The hardware manual says that the data can be sent at 4.125 Mhz speed. but at 1 Mhz speed itself when i try to send data, in between instead of correct value, zero has been sent in the MISO line. For example, when i try to send 3 bytes of data, the third byte is sent as zero. I have attached the code and screenshot of probed data with this.
Code :
st_rspi_data_t reg;
int_t error;
uint8_t buf_size[3] = "Bag";
reg.p_send_data = (void *)buf_size;
reg.p_recv_data = NULL;
reg.send_size = 3;
reg.recv_size = 0;
error = control(handle, CTL_RSPI_TRANSFER, ®);
if(error<0){
printf("Error");
return -1;
}
Probed data:
The yellow line is the clock generated by master at 1 mhz speed.
The blue line is the MISO pin output.
As you can see, the first value is "B" ( 42 hex code) is correctly send. the second value is "a" (61 hex code) is correctly send. But the third byte is sent as 0, but the correct value "g" should have been sent.
for higher frequencies, this invalid data can be seen more frequently, for example, if i try to send 20 bytes of data, there are 2 to 3 invalid data being send.
Can anyone explain why this is happening? and how to solve this issue?