I am working on SPC5604C microcontroller to interface a EEPROM chip using SPI communication (DSPI_2 module). I am using CW 10.6 as development platform.
I am facing two issues:
1) Tx and Rx FIFOs are being used for transmitting and receiving instructions and data to the EEPROM. Once an instruction is pushed into the TX fifo (writing it to DSPIx_PUSHR),
I can see the data received from the EEPROM in the debugger peripheral register view for DSPIx_POPR register and DSPIx_RXFR0 register. But as soon as I read the DSPIx_POPR
register in a variable, I do not get the data from that register. However Rx counter value in the DSPIx_SR register decreases by 1.
This is really confusing as reading the data should be as simple as other peripheral register read operations. Am I missing something in initialization?
I found this line in the target reference manual. "For compatibility, configure the TLB entry for DSPIx_POPR as guarded". Does this condition apply to my target?
Any help would be appreciated in this regard.
2) Secondly, once I initialize DSPIx_SIN pin as input buffer enable, I get a low value on the PIN. But as soon as I enable DSPIx_SOUT pin as alternate function and output buffer
enable I get a high voltage (5 volts) on this pin. Not only that, but as soon as I initialize this SOUT pin as output buffer enable the SIN pin also starts giving a high voltage level.
However, the CS and CLK pins once used for their alternate mode function and output buffer enable, I get a low voltage on these pins.
So is this the normal behaviour (getting high voltage on SIN pin with input buffer enable and getting high voltage on SOUT pin)