Probably a trivial problem
This is probably a trivial issue.· I am in the initial stages of trying to teach myself to use Basic Stamps.· Currently I am using a PS2 40 on a development board and running through some canned experiments from a Parallax book.· I could not get one of the experiments·to work·so I tried to write a simple program to raise and lower the voltage on output pin x:
Start:
HIGH X
PAUSE 500
LOW X
PAUSE 500
GOTO Start:
where X varies from 0 to 15.
Looking at the outpins with a 'scope, I can get pins 0 to 7 to cycle high and low with a 1 second duty cycle.· I get nothing from pins 8 to 15.
What am I doing wrong?
·
Start:
HIGH X
PAUSE 500
LOW X
PAUSE 500
GOTO Start:
where X varies from 0 to 15.
Looking at the outpins with a 'scope, I can get pins 0 to 7 to cycle high and low with a 1 second duty cycle.· I get nothing from pins 8 to 15.
What am I doing wrong?
·
Comments
What data type is the variable X? How are you setting its value?
DJ
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I believe the BS2-40 is numbered p0 - p15 down the left side, px0 to px15 up the right side.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
When you say pins 0-7 are you using the main I/o on IC pins 5-12 on the left side of the Stamp?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Alan Bradford ·N1YMQ
Plasma Technologies
Canaan NH 03741
www.plasmatechnologies.com
Maybe this will help . . .
' {$STAMP BS2p}
' {$PBASIC 2.5}
' The Professional Development Board (PDB) I/O pins are located in two DIFFERENT places,
' the connector labeled X15 and the connector labeled SX28. Depending on the actual port
' (there are 8 pins·to a port). The little program below demonstrates the location of the
' individual pins.
' Pins· 0 -· 7 are on connector X15· (0 - 7).
' Pins· 8 - 23 are on connector SX28 (RB0 - RC7).
' Pins 24 - 31 are on connector X15· (8 - 15).
X·· VAR·· Byte
Start:
· FOR X = 0 TO 31
··· IF X <= 15 THEN
····· MAINIO
····· ELSE
····· AUXIO
··· ENDIF
··· DEBUG "Blinking Pin: ", DEC X, CR
··· HIGH X
··· PAUSE 1000
··· LOW X
··· PAUSE 1000
· NEXT
GOTO Start:
' The program above could be written many ways. The following does the same thing
' and may be clearer . . .
'Start:
'· FOR X = 0 TO 31
'··· IF X <= 15 THEN
'····· MAINIO
'··· ENDIF
'··· IF X >= 16 THEN
'····· AUXIO
'··· ENDIF
'··· DEBUG "Blinking Pin: ", DEC X, CR
'··· HIGH X
'··· PAUSE 1000
'··· LOW X
'··· PAUSE 1000
'· NEXT
'GOTO Start:
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
They sure aren't where I'd LIKE for them to be! [noparse]:)[/noparse]
I hope I provided Rocks with the correct information. The program I posted above does exactly what I said it will do. Still, I did not take that information out of the PDB literature . . . I derived it empirically.
If you or anyone else thinks I am wrong, please let Rocks and me BOTH know! [noparse]:)[/noparse]
Thanks.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.