Is it possible to have the SPI clock run at 3.5MHz

71 views
Skip to first unread message

SGen

unread,
Mar 27, 2020, 6:53:55 PM3/27/20
to bcm2835
Hi,

I am doing a project to interface a customized multi-channel ADC with SPI. The ADC only samples data at some set frequencies by writing the right number in registers. So the required SPI clock speed is different from those given in the bcm2835 library. Setting BCM2835_SPI_CLOCK_DIVIDER_128 gives 3.15M on pi 3 and BCM2835_SPI_CLOCK_DIVIDER_64 give 6.25M. What should I do if I need a non-standard clock rate such as 3.5M? Thank you for any help.

Mike McCauley

unread,
Mar 27, 2020, 7:35:02 PM3/27/20
to bcm...@googlegroups.com
Hi,

Are you sure that you have to use that SPI frequency? Most such SPI devices
will tolerate a wide range of SPI frequencies. Check the specs on your device.

Cheers.
--
Mike McCauley VK4AMM mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com 5R3MRFM2+X6
Phone +61 7 5598-7474



Arjan van Vught

unread,
Mar 28, 2020, 2:24:51 AM3/28/20
to bcm...@googlegroups.com

Op 27 mrt. 2020, om 23:53 heeft SGen <suryg...@gmail.com> het volgende geschreven:

Hi,

I am doing a project to interface a customized multi-channel ADC with SPI. The ADC only samples data at some set frequencies by writing the right number in registers. So the required SPI clock speed is different from those given in the bcm2835 library. Setting BCM2835_SPI_CLOCK_DIVIDER_128 gives 3.15M on pi 3 and BCM2835_SPI_CLOCK_DIVIDER_64 give 6.25M. What should I do if I need a non-standard clock rate such as 3.5M?
Thank you for any help.

--
You received this message because you are subscribed to the Google Groups "bcm2835" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bcm2835+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bcm2835/1bc1a8b6-d9ed-44e4-8c10-1dcb7e5008aa%40googlegroups.com.

Geng Jinghui

unread,
Mar 30, 2020, 8:33:30 PM3/30/20
to bcm...@googlegroups.com
Hi Mike,

I checked the datasheet. It gives a table of the ADC sampling rate per channel and the corresponding buffer bias and mux bias for the registers. Do you mean that the ADC should follow the SPI speed and each set of register variables is able to give different sampling rates in a range? Are there any devices that I can use to test the ADC? Than you.

Best,


--
You received this message because you are subscribed to the Google Groups "bcm2835" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bcm2835+u...@googlegroups.com.

Geng Jinghui

unread,
Mar 30, 2020, 8:34:30 PM3/30/20
to bcm...@googlegroups.com
Hi Arjan,

Thank you. Do you mean it's impossible? 

Best,

Arjan van Vught

unread,
Mar 31, 2020, 3:18:00 AM3/31/20
to bcm...@googlegroups.com

Op 31 mrt. 2020, om 02:33 heeft Geng Jinghui <suryg...@gmail.com> het volgende geschreven:

Hi Arjan,

Thank you. Do you mean it's impossible? 
You can set any frequency you would like between 4KHz and 125MHz

- Arjan

Geng Jinghui

unread,
Mar 31, 2020, 6:08:02 PM3/31/20
to bcm...@googlegroups.com
Thank you, Arjan! I think I got it. 

Reply all
Reply to author
Forward
0 new messages