Skip to main content
DMalo.2
Associate
August 27, 2020
Solved

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

  • August 27, 2020
  • 2 replies
  • 2406 views

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.
Best answer by TDK

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

2 replies

TDK
TDKBest answer
August 27, 2020

> 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
August 27, 2020

Thank you!