Skip to main content
DMalo.2
Associate
Aug 27, 2020 6:43 AM UTC
Solved

How to transmit a 32 bits word with SPI on a stm32 to a GPS receiver chip (MAX2769C)

Hi there

I am trying to configure a GPS receiver chip (MAX2769C) with an stm32f446re MCU using SPI in half duplex master mode. The chip is expecting a 32 bit word (4 bits address and 28 bits data). This is on page 21 of the attached datasheet.

  1. My first question is how can I transmit a 32 bits word when the maximum bits format that cubemx allows is 16 bits transfer.
  2. My second problem is that, I have to generate a clock of exactly 16,384 MHZ to feed the MAX2769C chip (this is not the data clock SCK of the SPI). So I selected MCO1 in cubemx and played around with clock configuration until I got 16.384 MHZ. How is this going to affect the SPI speed?

It's my first time asking a question on this platform. Thank you in advance!

This topic has been closed for replies.
TDK
TDKBest answer
Aug 27, 2020 2:04 PM UTC

> My first question is how can I transmit a 32 bits word when the maximum bits format that cubemx allows is 16 bits transfer.

You send multiple bytes while holding CS low.

> My second problem is that, I have to generate a clock of exactly 16,384 MHZ to feed the MAX2769C chip (this is not the data clock SCK of the SPI). So I selected MCO1 in cubemx and played around with clock configuration until I got 16.384 MHZ. How is this going to affect the SPI speed?

SPI speed is selected by the relevant peripheral bus speed along with the SPI prescaler.

"If you feel a post has answered your question, please click ""Accept as Solution""."

2 replies

TDK
TDKBest answer
Aug 27, 2020 2:04 PM UTC

> My first question is how can I transmit a 32 bits word when the maximum bits format that cubemx allows is 16 bits transfer.

You send multiple bytes while holding CS low.

> My second problem is that, I have to generate a clock of exactly 16,384 MHZ to feed the MAX2769C chip (this is not the data clock SCK of the SPI). So I selected MCO1 in cubemx and played around with clock configuration until I got 16.384 MHZ. How is this going to affect the SPI speed?

SPI speed is selected by the relevant peripheral bus speed along with the SPI prescaler.

"If you feel a post has answered your question, please click ""Accept as Solution""."
DMalo.2
DMalo.2Author
Associate
Aug 27, 2020 3:11 PM UTC

Thank you!