Shop OBEX P1 Docs P2 Docs Learn Events
Help with BS2SX Analog/digital code — Parallax Forums

Help with BS2SX Analog/digital code

SiriSiri Posts: 220
edited 2007-06-22 14:14 in BASIC Stamp
This is my first attempt to write some cose for OEM Basic Stamp 2sx to doa analog to digital conversion.
I used the Board of Education BS2 to practice and the attached code worked which was taken from Matt Gilland's book.
I also read the Basic Stamp Manual - "pulsout" command the only difference is Duration units and the Maximum pulse width.
I really do not see if I need to change any part of the code and when I run the code in BS2sx - it does not work.
The hardware is connected exactly the same to the same pins etc.

I would appreciate any help to sove this problem.

Thank you.
Siri

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-06-22 01:04
    Why not attach the real code so we could test it by running it? It also would make sure you made no mistakes in transcribing the code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • SiriSiri Posts: 220
    edited 2007-06-22 02:15
    Stephen,

    That is the exact code Iused in the BS2 and BS2sx.

    I get the 8 bit results from the ADC0832CCN and it shows up in the debug window when I run it in the BS2 but not with the BS2sx OEM.

    The· BS2 and BS2sx pins used are:

    PINS 3,4 and 5 from the stamp are connected to pins CS,CLK and D0 respectively.

    I have attached the circiut and the code page from the book.

    Thanks

    Siri
  • FranklinFranklin Posts: 4,747
    edited 2007-06-22 03:31
    You know the BS2sx is nearly 2.5 times faster than the BS2 and the pulses are shorter by that factor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • SiriSiri Posts: 220
    edited 2007-06-22 14:14
    I tried running the code using "PULSOUT and SHIFTIN" commands and changing the duration of the pulse.

    I get "11111111" for about a fraction of a sec. and then "00000000" but nothing happens when you continue to turn pot in any direction.

    The code is attached.

    Thanks

    Siri
Sign In or Register to comment.