Project

General

Profile

change SPI clock?

Added by jalmasi almost 5 years ago

Hi,

can I change SPI clock of a jeenode?
If so, how?
If not, why?

I’ve attempted with SPI.setClockDivider(), with no luck.
After looking at how clock divider works, I’ve seen talks about bugs, attemted to fix, to directly modify SPCR… no results.
Right now I’m confused:)


Replies (4)

change SPI clock? - Added by martynj almost 5 years ago

jalmasi,

Are you driving the SPI bus directly or through a support library?

RE: change SPI clock? - Added by jalmasi almost 5 years ago

I used arduino SPI lib.

It clashes with RF code, I get it, I did not disable interrupts yet.

RE: change SPI clock? - Added by jcw almost 5 years ago

To use the SPI lib in combination the the JeeNode’s radio, you’re going to have to pick a chip-enable pin other than D10, disable interrupts, change the clock speed, communicate with what you’ve connected to SPI, restore the clock speed, and re-enable interrupts.

Another approach would be to use software “bit-banged” SPI on 4 other unused I/O pins instead. The RFM12B radio needs very quick and frequent access to the hardware SPI bus to properly send or receive an entire packet (about 160 µs between interrupts).

RE: change SPI clock? - Added by jalmasi almost 5 years ago

Excellent, thanks!

    (1-4/4)