Shop OBEX P1 Docs P2 Docs Learn Events
Tlc542 adc — Parallax Forums

Tlc542 adc

bjhamltnbjhamltn Posts: 21
edited 2007-06-24 16:50 in General Discussion
I am going to use Texas Instrument's TLC542 ADC in a future project and would like to hear from thoses who have used this chip.
If anyone has has any experience using this ADC would you mind looking over this BS2 prorgam. I think I understand the chip's
operation but would just like to make sure what I'm doing will work.

The data sheet for the chip can be found here focus.ti.com/lit/ds/symlink/tlc542.pdf

' {$STAMP BS2px}
' {$PBASIC 2.5}

'
[noparse][[/noparse] Variables ]
EOC PIN 5
Clk PIN 4
SigL PIN 3
CS PIN 2

'
[noparse][[/noparse] Variables ]
addr VAR Nib
reading VAR Byte


TLC542_Read:
Input EOC
LOW CS
SHIFTOUT SigL,Clk, MSBFIRST,[noparse][[/noparse]Addr\4,0\4]
HIGH CS
DO WHILE(EOC=0):LOOP
LOW CS
Reading.BIT7 = SigL
SHIFTIN SigL, Clk, MSBFIRST,[noparse][[/noparse]reading\7]
RETURN

Comments

  • bjhamltnbjhamltn Posts: 21
    edited 2007-06-24 16:50
    i was able to get the chip to work and completed.
    I had to modify the above code slightly

    Modified Code

    TLC542_Read:
    reading = $00
    LOW CS
    OUTPUT SIGL
    SHIFTOUT SigL,Clk, MSBFIRST,[noparse][[/noparse]Addr\4,0\4]: LOW SIGL
    INPUT SIGL
    PAUSE 1
    SHIFTIN SigL, Clk, MSBPOST,[noparse][[/noparse]readings(addr)\8]
    HIGH CS
    RETURN

    A video demo of this project can be found here www.bjhamltn.com/zVideo.aspx
    It is the fourth video.
Sign In or Register to comment.