Joined: 23 Apr 2004 Posts: 227 Location: The Netherlands
SPI and MAX7221 and DS1306
Posted: Sun Sep 09, 2007 4:49 am
I want to display on a dot matrix display board (constructed with ten max7221's) the time (constructed with a ds1306)
My question is now:
The max7221 use
setup_spi(SPI_MASTER | SPI_H_TO_L | SPI_CLK_DIV_16);
The ds1306 use
setup_spi(SPI_MASTER | SPI_L_TO_H | SPI_CLK_DIV_16);
How to get this to work on a single spi bus??
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
Posted: Sun Sep 09, 2007 7:33 am
Easy. You can only send to one device at a time, so when you switch from one device to the other you call the setup_spi() function for your new device.
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