2024-02-20 01:36 PM
Hi community,
I have a display, which has only CLK, DI and CS pin for SPI communication. It uses TI protocol.
The original driver is only working with raspberry pi, I try to import it into my custom STM32 MCU board, the CLK and CS signals seem okay, Only the MOSI signal is always low. it seems no data is really sent to the display.
here is the signal capture from logic analyzer.
The whole write sequence:
zoom in, single byte write:
what could be the reason? Thanks in advance.
Solved! Go to Solution.
2024-02-22 01:32 PM - edited 2024-02-22 02:15 PM
Hi @tjaekel @Tesla DeLorean ,
thanks again for your reply, very appreciate it.
the master part is BlueNRG-LP, these 3pins are used as SPI2 and PA6 is MOSI.
2. without display, all these 3 pins are able to be toggled.
sorry for the confusion, I did something wrong. Now the question is only it´s not working properly in SPI mode.
2024-02-22 01:44 PM - edited 2024-02-22 01:47 PM
@Danny0007 wrote:
- the slave part is a display, CS is high activ, pretty sure.
You need to be more than just "pretty sure" - do you not have a datasheet or specification which states this?
As the others have said, it would be extremely unusual - so it should be easy to find reference to it.
Do you have a part number?
Link to manufacturer's or seller's page for it?
2024-02-22 01:52 PM
2024-02-22 02:22 PM
Yes, so that "SCS" is active high! 😳
So you really should not be calling it "NSS":
The 'N' in "NSS" is literally there to indicate an active-low signal!
2024-02-22 02:31 PM
actually I do not understand the name NSS pin very well, for me I simply just need a normal CS pin.
2024-02-22 02:41 PM
"SS" = "Slave Select" - it's a synonym for "CS" = "Chip Select"
Again, the 'n' just indicates "negative logic" - ie, active-low
2024-02-22 04:40 PM
OK, I assume you use a SHARP LCD module, like this:
|LS013B7DH03_datasheet.pdf (sparkfun.com)
OK, it has an SCS signal (not an NCS or NSS signal, just to be "picky"). Yes, this is high active in this datasheet.
The call it "Chip Select Signal" but use SCS (maybe a typo and it should be CSS).
OK, you have checked:
If all this works, your external LCD display is causing the issue:
BTW: please confirm:
Can you toggle PA6 as MOSI as a regular GPIO, when you drive/keep the SCS signal low (not selecting the module)?
Does it work?
Or: generate a SPI transaction but leave the SCS signal low (not selecting module). Do you see MOSI signal toggling?
If not - your LCD module causes the issue (and nothing you can do on MCU side).
2024-02-22 05:08 PM
@tjaekel wrote:They call it "Chip Select Signal" but use SCS (maybe a typo and it should be CSS).
Or maybe whoever wrote it was French ... ?
🤔
(see also: "UTC"...)
2024-02-23 12:45 PM
Hi @tjaekel
I just tested the PA6(MOSI) again, it can be toggled both as GPIO and as SPI MOSI, with and without Display.
So the pin works in terms of hardware no problem.
regardless of the complex display data format, now I just try to write some simple data on SPI like this:
uint8_t data[5] = {0x11,0x22,0x33,0x44,0x55};
BSP_SPI2_Init();
LL_mDelay(10);
while(1){
BSP_SPI2_Write(data, 5);
LL_mDelay(1);
}
even without display:
the CS pin during the write cycle unexpect goes down and it causes wrong transformation.
2024-02-23 12:49 PM
the IEEE should unify this, even the TI and Motorala mode... it will be much easier for us as developer😀