2024-07-24 05:49 AM
Hi,
Im interfacing STW81200 with SPI without no success. I do have the following questions:
What the SPI mode? Its not clear on the datasheet. It seems that CPOL = 1, and CPHA = 1.
In either way, I have tested the communication with several modes and none of them works.
On the MCU side, which is the one that will act as a master on spi, whats the configuration for the GPIO pin? Im using STM32L412 and I have set the MISO as an alternate function with push pull open drain and this does not work either.
I can confirm that the SPI signal for SCLK and MOSI its working because the data is being pushed out of the pins. Please see the logic analyzer graphs, but MOSI line is not responding.
Im following the datasheet section Example of register programming, its required when programming in SPI to have enabled a reference clock or this can be absent?
Also, when the MCU is configuring for spi, it clear HW_PD, PD_RF_1 pins.
Solved! Go to Solution.
2024-07-25 11:14 AM - edited 2024-07-25 11:15 AM
Hi,
>its required when programming in SPI to have enabled a reference clock or this can be absent?
because its a Wide Band Synthesizer , it needs a clock anyway, to do something useful.
So give it the needed reference clock first.
2024-07-24 06:20 AM
Hi,
>What the SPI mode?
Looks like CPOL = 1, and CPHA = 1 , right.
Why not using Cube+HAL , to use the SPI ?
2024-07-24 06:40 AM
Are you toggling LE for each transfer? It's not shown in your photo--the line is low the entire time. Everything else looks correct.
2024-07-24 06:54 AM
> Looks like CPOL = 1, and CPHA = 1 , right.
Thanks.
> Why not using Cube+HAL , to use the SPI ?
Are you suggesting that if HAL is used, the problems will disappear?
I must add to this that, I changed the MISO gpio configuration as alternate function push pull with pull up, and this does NOT work either.
Also, other question that I have would be, what are the voltage set on the internal LDO when no programming has been made?
2024-07-24 07:11 AM
I did not think that it matters to show that. As soon as LE goes from high to low, then the transfer is made, its not obligatory to assert LE again, or maybe Im missing something?
This time Im showing the whole transaction. The extra difference regarding first one is that, MISO line has been set as alternate function push pull with pull up.
Still, it does NOT work.
2024-07-24 07:17 AM
You are correct, but it's important that it happens, and if you don't show it, I have no way of knowing that it's happening. We are debugging after all, just going through the possibilities.
The MISO pin should be set as alternate function. The settings apart from that shouldn't matter. Can you configure it with pull-down to see if its value becomes 0 instead of 1? That would let you know if the chip is driving it at all. If the chip isn't driving it, perhaps there's a hardware error--maybe it's not connected.
Not familiar with STW81200 but looks like you're doing everything right from what I can see.
2024-07-24 07:35 AM
> You are correct, but it's important that it happens, and if you don't show it, I have no way of knowing that it's happening. We are debugging after all, just going through the possibilities.
I understand this and your are right.
> The MISO pin should be set as alternate function. The settings apart from that shouldn't matter. Can you configure it with pull-down to see if its value becomes 0 instead of 1?
I uploaded an image of the transactions with this configuration. I see that the pin is driven low.
Regarding hardware issues, I yesterday measure continuity between the MCU and STW81200 and I have continuity on each pins. Also, I have attached the logic analyzer probes just right near by the SPI STW81200 to certify that the signal went all through.
If this is a hardware problem, I would be interested to know what are the default output values that the internal LDO should have, I doubled check that the power supply is stable.
2024-07-24 07:36 AM
2024-07-24 08:31 AM
"The first bit, CO is used for mode selection (0=Write Operation, 1=Read Operation)."
It looks like you issued a write, it's not clear what response the device makes in that case.
2024-07-24 08:43 AM
> "The first bit, CO is used for mode selection (0=Write Operation, 1=Read Operation)."
This is correct. Im trying to follow the "example of register programming" indicated in 7.17 from datasheet.
Write to ST9 = 0x48000000
Read from ST11.
Please see steps indicated on attached image.
I would expect a dont care when writing to ST9 register, but get some results when reading device id register, ST11.