bsx2 cod problem
Archiver
Posts: 46,084
Hi to all….
I'm using a bsx2 (basic stamp 2sx) and I'm trying to take 8-bit from
a parallel ADC (adc0820) by using a shift register (74HC166) and a
voltage reference (MC1403) that gives a 2.5v for +Vref on the ADC and
the (-ve ) Vref is grounded the input on Vin on the ADC is 1.25v and
this is the code that I wrote the output is spouse to be 128
The ADC mode that I'm using is (RD MODE) so I've connected mode pin
to ground
And wait for INT pin to go low and then tack the reading to the shift
register and put PE low and then do a shift in from the basic stamp
The problem is that I can't get it to show the out put on the screen
her is the code
NOTE: I've tested the voltages on the pins and it's ok.
'{$STAMP BS2sx}
q7 CON 0
cp CON 1
rd CON 2
int CON 3
pe CON 4
result VAR Byte
x VAR Byte
FOR x=1 TO 5
HIGH rd
PAUSE 3000
LOW rd
PAUSE 100 '1000=1sec.
IF int=0 THEN shift
shift:
LOW pe
SHIFTIN q7,cp,MSBPRE,[noparse][[/noparse]result\8]
HIGH pe
DEBUG bin result
NEXT
I'm using a bsx2 (basic stamp 2sx) and I'm trying to take 8-bit from
a parallel ADC (adc0820) by using a shift register (74HC166) and a
voltage reference (MC1403) that gives a 2.5v for +Vref on the ADC and
the (-ve ) Vref is grounded the input on Vin on the ADC is 1.25v and
this is the code that I wrote the output is spouse to be 128
The ADC mode that I'm using is (RD MODE) so I've connected mode pin
to ground
And wait for INT pin to go low and then tack the reading to the shift
register and put PE low and then do a shift in from the basic stamp
The problem is that I can't get it to show the out put on the screen
her is the code
NOTE: I've tested the voltages on the pins and it's ok.
'{$STAMP BS2sx}
q7 CON 0
cp CON 1
rd CON 2
int CON 3
pe CON 4
result VAR Byte
x VAR Byte
FOR x=1 TO 5
HIGH rd
PAUSE 3000
LOW rd
PAUSE 100 '1000=1sec.
IF int=0 THEN shift
shift:
LOW pe
SHIFTIN q7,cp,MSBPRE,[noparse][[/noparse]result\8]
HIGH pe
DEBUG bin result
NEXT