Need help integrating a BS2e with two sensors
'O Flyer
Posts: 9
Hi people,
I'm attempting to integrate a BS2e with two sensors - barometric pressure and fluid level - sending their output of approx. 0.25 to 4.75v ea. to an A to D converter , on to the Stamp and then on to a Decade Engineering BOB3 video overlay module. Because I may later·add a couple more sensors, I chose a Texas Instuments TLV2544· 4-ch A to D converter. Compared to the Linear Technology LTC1298 (for which there's probably adequate example programming documentation·in "Stamp Applications no.4", the '2544 is "high speed" with a sampling·rate of 200 KSPS vs 11.1 KSPS for the '1298. The '2544 data sheet gives a recommended 10 microsec. max. for the "sample clock" cycle time.·Would this indicate that the TLV2544 is too high·speed a device to be compatable with the BS2e?
Assuming they can work together, the '2544 needs to be "configured" with a 16 bit setup word.·I want to "feed" this word ("Setuptotal") to the '2544s serial data in pin MSBF. I was trying out this particular code:
Setuptotal····· VAR······· W0
n·················· VAR······· Nib
Bitn··············· VAR······· Bit
Setuptotal = %1010101111101010
FOR n = 15 TO 0
·· DEBUG BIN Bitn
·· PAUSE 250
NEXT
At this stage my goal is simply to reproduce the above constant "Setuptotal" in the DEBUG window with this code. What am·I doing wrong here?·Aren't the bits making up the number "Setuptotal" in RAM register W0 known to the·Stamp as Bit15 through Bit0?
'O Flyer
Post Edited By Moderator (Chris Savage (Parallax)) : 4/27/2005 12:47:58 AM GMT
I'm attempting to integrate a BS2e with two sensors - barometric pressure and fluid level - sending their output of approx. 0.25 to 4.75v ea. to an A to D converter , on to the Stamp and then on to a Decade Engineering BOB3 video overlay module. Because I may later·add a couple more sensors, I chose a Texas Instuments TLV2544· 4-ch A to D converter. Compared to the Linear Technology LTC1298 (for which there's probably adequate example programming documentation·in "Stamp Applications no.4", the '2544 is "high speed" with a sampling·rate of 200 KSPS vs 11.1 KSPS for the '1298. The '2544 data sheet gives a recommended 10 microsec. max. for the "sample clock" cycle time.·Would this indicate that the TLV2544 is too high·speed a device to be compatable with the BS2e?
Assuming they can work together, the '2544 needs to be "configured" with a 16 bit setup word.·I want to "feed" this word ("Setuptotal") to the '2544s serial data in pin MSBF. I was trying out this particular code:
Setuptotal····· VAR······· W0
n·················· VAR······· Nib
Bitn··············· VAR······· Bit
Setuptotal = %1010101111101010
FOR n = 15 TO 0
·· DEBUG BIN Bitn
·· PAUSE 250
NEXT
At this stage my goal is simply to reproduce the above constant "Setuptotal" in the DEBUG window with this code. What am·I doing wrong here?·Aren't the bits making up the number "Setuptotal" in RAM register W0 known to the·Stamp as Bit15 through Bit0?
'O Flyer
Post Edited By Moderator (Chris Savage (Parallax)) : 4/27/2005 12:47:58 AM GMT
Comments
I think this is what you want:
setupTotal··· VAR··· Word
idx·········· VAR·· ·Nib
theBit······· VAR·· ·Bit
Main:
· setupTotal = %1010101111101010
· FOR idx = 15 TO 0
··· theBit = setupTotal.LOWBIT(idx)
··· DEBUG BIN theBit
··· PAUSE 250
· NEXT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Thank you for that quick reply. I'll experiment a bit in order to better understand what you're saying. And I'll eventually have more questions!
Vern Roach (O'Flyer)