# SPI CLOCK - working with the falling edge of the clock

**URL:** <https://forums.digi.com/t/spi-clock-working-with-the-falling-edge-of-the-clock/12746>\
**Category:** Rabbit\
**Tags:** rabbit\
**Created:** [March 31, 2014, 9:01am UTC](https://forums.digi.com/t/spi-clock-working-with-the-falling-edge-of-the-clock/12746 "2014-03-31T09:01:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![reggie720](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@reggie720](https://forums.digi.com/u/reggie720)\
**Post date:** [March 31, 2014, 9:01am UTC](https://forums.digi.com/t/spi-clock-working-with-the-falling-edge-of-the-clock/12746/1 "2014-03-31T09:01:10Z")

</div>

hi.  
i have the rabbit 4000 and try to work with the SPI.  
the SPI is working with the rising edge of the clock . i want it to work with the falling edge of the clock .  
how can i config the rabbit to work with the falling edge of the clock ? ( i want my data to work with the falling edge of the clock)

---

<div class="post-metadata">

**Author:** ![petermcs](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@petermcs](https://forums.digi.com/u/petermcs)\
**Post date:** [March 31, 2014, 2:58pm UTC](https://forums.digi.com/t/spi-clock-working-with-the-falling-edge-of-the-clock/12746/2 "2014-03-31T14:58:37Z")

</div>

The clock phases are set using the SPI\_CLOCK\_MODE macro which should be defined with a value of 0, 1, 2 or 3 (default is 0).

Figure 16.1 on page 130 of the Rabbit 4000 users manual shows the operation for the different modes. You need either mode 2 or mode from the sound of it.

Regards,  
Peter
