Shop OBEX P1 Docs P2 Docs Learn Events
losing lsb w/ tlc0831 a TI adc — Parallax Forums

losing lsb w/ tlc0831 a TI adc

nick bernardnick bernard Posts: 329
edited 2006-02-09 16:40 in General Discussion
ADC tech doc -> focus.ti.com/lit/ds/symlink/tlc0831.pdf

my sx routine isnt picking up the last bit from the adc
does anyone have any idea why?

the sentence is 10 bits with the first two bits ignored followed by a byte of analog data
the data i get ranges from 0 to 128

GET_ADC:
LOW CS0
SHIFTIN DAT, CLK, MSBPRE, analog_0\2
SHIFTIN DAT, CLK, MSBPRE, analog_0
HIGH CS0
LOW CS1
SHIFTIN DAT, CLK, MSBPRE, analog_1\2
SHIFTIN DAT, CLK, MSBPRE, analog_1
HIGH CS1
RETURN

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
engineer, fireman, bowler, father, WoW addict [noparse];)[/noparse]

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-02-09 16:40
    It looks to me like it's only ignoring the first clock bit -- data seems to be ready after the falling edge of the second clock. Make sure that you initialize your clock line low (the SX/B SHIFTIN and SHIFTOUT invert the clock state from where it is, so you can set clock polarity) and try MSBPOST.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.