View previous topic :: View next topic |
Author |
Message |
zero2004
Joined: 18 Aug 2013 Posts: 2
|
help in spi function |
Posted: Sun Aug 18, 2013 11:26 pm |
|
|
Hi every one
I want flip the initial spi clock state to be hi instead of low, i declare the spi function as follow
Code: | #USE SPI (MASTER, SPI1, CLOCK_HIGH=1, CLOCK_LOW=1, MODE=0, BITS=8, LOAD_ACTIVE=1, STREAM=SPI_1, MSB_FIRST)
|
Thanks for your help |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19545
|
|
Posted: Mon Aug 19, 2013 12:43 am |
|
|
The mode number specifies the 'idle' (initial) state. Mode0, idles low. Modes 2 and 3 idle high.
Code: |
USE SPI (MASTER, SPI1, MODE=3, BITS=8, LOAD_ACTIVE=1, STREAM=SPI_1, MSB_FIRST)
|
Have a look at:
<http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus>
Look at 'CPOL' (clock polarity), and the effect of the mode numbers on this.
Best Wishes |
|
|
zero2004
Joined: 18 Aug 2013 Posts: 2
|
|
Posted: Tue Aug 20, 2013 12:50 am |
|
|
Thanks |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|