Skip to main content
mariecurie
Associate
July 24, 2024
Solved

STW81200 does not answer on MISO line

  • July 24, 2024
  • 7 replies
  • 7897 views

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.

 

Best answer by AScha.3

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.

7 replies

AScha.3
Super User
July 24, 2024

Hi,

 

>What the SPI mode?

Looks like CPOL = 1, and CPHA = 1 , right.

 

Why not using Cube+HAL , to use the SPI ?

"If you feel a post has answered your question, please click ""Accept as Solution""."
mariecurie
Associate
July 24, 2024

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?

TDK
Super User
July 24, 2024

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.

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
mariecurie
Associate
July 24, 2024

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.

TDK
Super User
July 24, 2024

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.

"If you feel a post has answered your question, please click ""Accept as Solution""."
mariecurie
Associate
July 24, 2024

I uploaded an image of the transactions with this configuration. I see that the pin is driven low. 

Forgot to attach the image.

Chris21
Associate II
July 24, 2024

"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.

mariecurie
Associate
July 24, 2024

> "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.

 

 

TDK
Super User
July 25, 2024

Are you following the power on sequence exactly?

TDK_0-1721912800940.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
mariecurie
Associate
July 25, 2024

> Are you following the power on sequence exactly?

Sort of because Im missing some information that does not allow me to completely verify that the power sequence is correct.

1. I measured this with an oscilloscope and all the inputs are receiving 5 V. Passed.

2. There is no way for me to certify this since I dont know what are the expected values to be read on these LDO. 

3. Currently the board I have, does NOT have the reference clock signal and this is one of the questions I made. This is my first time interacting with a synthesizer and Im not really sure if you need to have some signal in place before actually communicate through SPI. 

Based on this diagram, I can somehow infer that the spi block communication is separated from the rf stage. Please see spi-and-reference-signal-block.png

4. By the time this step is about to be made, 50 ms has elapsed since powering up the ic. I initially tried to do a write transfer on ST9 as in previous screenshots, but as this is a writing, I dont have any way to certify that the writing transfer is successful without actually getting back from the ic, so I tried to read the device id register ST11, without not having success. So, this step has not been made following exactly what it says because of my uncertainty of not know that ic is receiving the data. 

Maybe I should try to follow exactly as its stated and see if when reading on ST11, I will get a response. 

Maybe, all the steps below 5 needs to be made in order for the ic to reply back on ST11 as its stated on step 5. 

TDK
Super User
July 25, 2024

> Maybe I should try to follow exactly as its stated and see if when reading on ST11, I will get a response. 

That seems like the best approach, especially as you are running into issues.

"If you feel a post has answered your question, please click ""Accept as Solution""."
AScha.3
AScha.3Best answer
Super User
July 25, 2024

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.

"If you feel a post has answered your question, please click ""Accept as Solution""."
mariecurie
Associate
July 30, 2024

During the last couple of days I implemented first the whole transfer that its given in section 7.17 of the data sheet with no success. 

After that, I started to work on some parts of the circuit that were in charge of providing the reference clock signal as suggested by @AScha.3 and it has been proved that STW81200 indeed needs the reference clock signal to be able to reply through SPI.

The image attached is when the ic replies back when reading device id register.

Thanks everyone,