Tlc542 adc
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
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
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.