Shop OBEX P1 Docs P2 Docs Learn Events
using an external clock and ADC to read data — Parallax Forums

using an external clock and ADC to read data

fightflyfightfly Posts: 5
edited 2006-06-12 14:26 in BASIC Stamp
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

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-06-12 14:15
    Lars,

    ·· 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
  • edited 2006-06-12 14:15
    I may be wrong, but I don't think that Mr. Stamp like to have its clock set by anyone but Mrs. Stamp. (<--- Pulp Fiction reference)

    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
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-12 14:18
    Interfacing with the ADC0831 is covered well in "Stampworks" (available at www.parallax.com·).
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-06-12 14:18
    Lars -

    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 -->
  • fightflyfightfly Posts: 5
    edited 2006-06-12 14:20
    I am trying to measurean unrelated voltage, the ADC has a pin for a clock, so I thought I needed to provided it, I am still new to basic, so how do i use the stamps clock? And what sets the Baud rate then?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-06-12 14:24
    Please see the Help file under the SHIFTIN/SHIFOUT commands...They will explain what the clock line does.· The Stamp Module provides this signal synchronously with the data.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • fightflyfightfly Posts: 5
    edited 2006-06-12 14:26
    Thanks All!
Sign In or Register to comment.