cancel
Showing results for 
Search instead for 
Did you mean: 

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

DMalo.2
Associate

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!

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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

View solution in original post

2 REPLIES 2
TDK
Guru

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

Thank you!