I am trying to use SPI to talk to a 25R3911b to get it to read a register with a SPI right command 0x42. To read the register at 02 address. The function gives the right address on the MOSI line but the chip select goes high and I cannot figure out why.
void Comand25r3911b (uint8_t commandaddress, uint8_t data )
{
uint8_t TEMP;
TEMP=commandaddress;
SPI_0_write_block(&TEMP,1);
TEMP=data;
SPI_0_write_block(&TEMP,1);
}
void Comand25r3911b (uint8_t commandaddress, uint8_t data )
{
uint8_t TEMP;
TEMP=commandaddress;
SPI_0_write_block(&TEMP,1);
TEMP=data;
SPI_0_write_block(&TEMP,1);
}
Attachments
-
29.9 KB Views: 5