Hello All,
I have run into a bit of a problem with trying to get the /SPITE pin to do what I would like. I am using a SPI EEPROM that requires the CS pin (which is connected to /SPITE) goes low for each 8 bytes, then high again briefly before going low for the next 8 bytes. For instance, I need to send a Read_Status opcode, then have the CS go high, then low again for a Read opcode. However, if I have set the transmit buff to a value, then check the buffer full pin, and set the transmit buffer to the next value the CS pin stays low the whole time. However, if I only send one command one time then the CS pin comes back up right after that command.
The following code gives the screen capture below, the CS pin needs to come high after the op-code and then back low to transmit the dummy data:
if(eeprom.isTest == FALSE)
{
TRANSMIT_DATA_REGISTER = READ_STATUS_OPCODE;
while(COMMUNICATIONS_FLAG && (uwMicroTimeoutCounter < EEPROM_WRITE_TIMEOUT))
{
uwMicroTimeoutCounter++;
//Set global register to 1 to indicate micro timeout
if(uwMicroTimeoutCounter >= EEPROM_WRITE_TIMEOUT)
{
isEEPROMTimeout = TRUE;
eeprom.outputs.ubEEPROMTimeoutRegister = eeprom.outputs.ubEEPROMTimeoutRegister | 0x01;
}
}
uwMicroTimeoutCounter = 0;
//Send dummy data to the EEPROM to get the status back
TRANSMIT_DATA_REGISTER = 0x0000;
}
eeprom.isTest=TRUE;
Orange is the CS pin, Blue is SPICLK, Purple is transmit data from the micro (opcode 00000101, then 00000000)
If I remove the dummy data send then CS pin does come high right after sending the read status opcode.
I know the 2803x datasheet says: "In the master mode, SPISTE goes active 0.5tc(SPC) (minimum) before valid SPI clock edge. On the trailing
end of the word, the SPISTE will go inactive 0.5tc(SPC) after the receiving edge (SPICLK) of the last data bit,
except that SPISTE stays active between back-to-back transmit words in both FIFO and non-FIFO modes." but I'm essentially looking for a way around this functionality. Hardcoding the CS pin as a GPIO isnt hard and I did on a different processor with this same EEPROM, I'm just trying to use the micro's functionality to its fullest.
Thanks,
Justin