using an external clock and ADC to read data
fightfly
Posts: 5
I am trying to read a voltage from a breadboard, and I am having trouble.· I am using an ADC0831 analog to digital converter, with a SE555P clock.·· I am trying to measure a voltage, then store it as reference to compare it to the next value.· I am trying to use serin, but I am not sure that I am doing it right, and when i use debug, nothing shows up after the serin command in my program.
any help would be great.
Lars
any help would be great.
Lars
Comments
·· The ADC0831 is an SPI device, which requires the use of the SHIFTIN/SHIFTOUT commands.· SERIN/SEROUT are for Asynchronous Serial devices.· Also, is the clock what you are trying to measure or are you trying to drive the ADC0831 with that clock?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
In the manual, it says that SERIN is to be used in Async applications. That is, when you are not using a clock. SHIFTIN uses a clock, but it wants to use the Stamps own clock. This should be fine since the ADC0831 has a timing sequence compatable with the Stamps.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Freeing smoke from wire and IC captivity since 1972
You want touse SHIFTIN rather than SERIN to obtain the data from the ADC0831.
SERIN and SEROUT are used for asynchronous serial data. SHIFTIN and SHFTOUT are used for synchronous serial data.
How can you tell the difference? Very easily. If a clock line is one of the required connections for the chip, then it is synchronous serial data. If the there is no clock (asynchrounous data is self-clocking) then you have asynchronous serial data.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com