Serial SPI frequency arduino

Hello my friends, how can I clock at this speed exactly with Arduino?

See SPISettings and legacy setClockDivider() how to limit the clock frequency. A specific frequency is not required for SPI transfers, only a maximum (safe) frequency.

1 Like

Is this a 16-bit signal that two 8-bit numbers are sent? You can write the code for this part for me
Thankful

You can separate it into 8 bit bytes, send them then recombine them at the receiving end.

Can you please write the code for me?

What data item do you want to send from Arduino-1 to Arduino-2?
Mention the type numbers of the Arduinos - UNO/NANO/MEGA?

By the by, do you know about lowByte() and highByte() functions which can isolate bytes from a 16-bit data item?

I write for stm32. But because I could not find a good forum, I asked my questions here. If you write the Arduino code for me, I will convert it to stm32.

Which libraries do you have available for SPI?

We expect your answers to the questions of Post-6 and Post-8.

From the 'HAL' Library. I do not understand anything from post number 6

Ok!
Say, you have an int-type data item 0x1234. If it is broken into bytes, what data items would appear?

Which functions does that library offer for SPI transfers?
If these functions differ from the Arduino framework, what help do you expect in an Arduino forum?

The STM32 supports 16 bit SPI frame, and can probably go down to 200 kHz with it's assortment of SPI pre-scalers.

Which SPI peripheral are you using and what particular version of STM32?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.