Razvan Ionut Stoian wrote:
> I tried to interface a 12 bit ADC with the SPI port on my TS7200.
> However, whenever I try to read all 8 channels, four of them send the
> value of the voltage present on pin 1 (ADC0) and the other 4 (5
> through 8) send the value on pin 5 (ADC4).
> In order to access a particular channel I used the following algorithm
> adapted from 2 sources:
[snip]
> Could you tell me what I did wrong?
I haven't tried talking with that particular part. I did recently have to set
up routines to control some relays via the MCP23S08 chip. If you are
interested, I can show you the code I used.
The one thing you don't show in your code snipped is how you initialized the
SPI interface. Check the state of the SPH, SPO, and FRF bits in the SSP1CR0
control register. Make sure the output line is idling in the right state, the
phase of the clock in relation to the data, and that the SSP system is set for
SPI.
--
Cheers!
Kevin.
http://www.ve3syb.ca/ |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172 |"Same thing we always do, Pinkutus:
| Try to assimilate the world!"
#include <disclaimer/favourite> | -Pinkutus & the Borg
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|