Port control in SPI half duplex mode - Seeing dummy bytes on MOSI/MISO channel

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello everybody,

when I use the out of the box DAVE SPI Half Duplex Mode
(Output = OpenDrain with external PullUp, FIFO RxSize=TxSize=32, I use Pin 4.7 as MISO/MOSI Line (as recommended by DAVE) on USIC2_CH1.)

I can see the dummy bytes on the oscilloscope being send on my MISO/MOSI Line. As the dummy bytes should only generate the clock for my slave, this should never occur, right?

I only want a one byte answer, but to be sure I store the following9 bytes asw well to not miss anything (I am in "debug" mode 😉 )


static UINT8 cmd = 0x0A;
UINT8 receivedWord[10];
SPI_MASTER_TransmitWord_CMD(&SPI_MASTER_DISP, cmd);//DISPL_CMD_READ_PWR
SPI_MASTER_Receive(&SPI_MASTER_DISP, receivedWord, 10); //in receive mode, device gives clock to receive data


I can see the following in my debugger:

HPCEN is alsways DISABLED also after the CCR Settings made in XMC_SPI_CH_SetTransmitMode(handle->channel, runtime_handle->spi_master_mode); with mode = XMC_SPI_CH_MODE_STANDARD_HALFDUPLEX
but still the SPI_MASTER_lReceivePolling() my sends the dummy bytes via XMC_USIC_CH_TXFIFO_PutDataHPCMode();

Is anyting known about this behaviour ? Am I doing s.th. wrong here?

Thank you!
Peter

Edit:
After Reading my XMC4800 Manual, I am confused. How can a 4 Bit (4UL = 100Bin) be written in a 2 Bit Bitfield?
The define is (xmc4800.h)
****XMC_SPI_CH_MODE_STANDARD_HALFDUPLEX = 4UL, = 100/**< SPI standard half duplex mode */


But the Bitfield of CCR.HPCEN (see picture or Page 1911 on http://www.infineon.com/dgdl/Infineon-ReferenceManual_XMC4700_XMC4800-UM-v01_02-EN.pdf?fileId=5546d4...)
2314.attach

Furthermore in my spi_master_conf.c I see that

SPI_MASTER_GPIO_CONFIG_t SPI_MASTER_DISP_MOSI0_Config =
{
.port_config =
{
.mode = XMC_GPIO_MODE_OUTPUT_OPEN_DRAIN_ALT1,
.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH,
.output_strength = XMC_GPIO_OUTPUT_STRENGTH_STRONG_MEDIUM_EDGE
},
.hw_control = XMC_GPIO_HWCTRL_DISABLED
};


And in my USIC2_CH1 Interconnects I see, that my Pin (4.7) ist not listet with any DX.. configs in HPCEN (see above) -> Do I have to use totally different settings for running this Pin in Half Duplex mode?
2315.attach
in my uC P4_HWSEL it is defined as "Sortware Control Only" (= 00) => What does this mean for my config?

I am confused, why is a Hardware Controlled pin "Software Only"? Does this qualify the pin to use HPCEN? If not, how do I set it up to be used as half-duplex bidirectional MOSI/MISO?

Thank you very much for your answers!
0 Likes
0 Replies