XMC4800 SPI Half Duplex Mode - No Answer (Detailled with pictures)

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

cross mob
Not applicable
Dear Community,

I am using a display and it would be nice if you could help me out with a little issue of mine.

Whenever I send a receive request, there is no response from the display driver.
Writing to the display works perfectly fine.
Whenever I send a read request,(e.g.

static UINT8 cmd = 0x09;
SPI_MASTER_Transmit_CMD(&SPI_MASTER_DISP, &cmd, 1);//DISPL_CMD_READ_PWR
IO_SET_MODE_P4_6(INPUT); // tested with and without this option to set it "tri-state"
static UINT8 ReadData[4];

if(SPI_MASTER_Receive(&SPI_MASTER_DISP, ReadData, 4U))
{
while(SPI_MASTER_DISP.runtime->rx_busy){}
}
)

I only see on my oscilloscope the following:
(Blue: ChipSelect, Green: MISO/MOSI, Yellow: D/C, Red: SCLK)



I am using 3 line serial interface half-duplex and a xmc4800 with the following configurations (see pictures at the end of the mail).

Do you have any idea what the reason could be for not seeing any answer from the display?

Thank you very much in advance!

Best regards

Tim
0 Likes
3 Replies
Not applicable
2296.attach next image scope (see: no answer)
0 Likes
DRubeša
Employee
Employee
First solution authored First like received
Hi Tim,

try to set the MOSI pin to Open Drain Mode and also add an external pull up resistor. I should look like something like this...
2300.attach

Resistor value....try something like 4.7 kOhm 🙂 (this resistor value is mentioned in a lot of posts as a rule of thumb value).

You also need to remove the change of the pin to Tristate. In pseudocode it should be like:

-> DAVE APP initialization (MOSI pin will be set to Open Drain)
-> SPI_TRANSMIT
-> SPI_RECEIVE

Best regards,
Deni
0 Likes
Not applicable
Hello Deni,

thank you for you answer!
I did now put the Output to open drain and added a pullup as you recommended.
Unfortunately I still see no answer from my Display. Could it be errorous, that between transmit and receive my clock has a Little "gap" where it is constantly 0 ? (see scope_6.bmp in my second post)

my code:
SPI_MASTER_Transmit_CMD(&SPI_MASTER_DISP, &cmd, 1);//DISPL_CMD_READ_PWR
static UINT8 ReadData[4];

if(SPI_MASTER_Receive(&SPI_MASTER_DISP, ReadData, 4U))
{
while(SPI_MASTER_DISP.runtime->rx_busy){}
}


Thank you for you answers!
Best regards
Tim
0 Likes