PROGRAMING WITHOUT THE PAMUX DRIVER
4-16
Pamux User’s Guide
Determine Suitable I/O Addresses for an AC28
If an I/O address is unused, the I/O address should read &HFF or all 1’s. If the AC28 is not installed
and the Reset I/O address in not already in use, the following statement should print “255”:
PRINT INP( MyAc28ResetPort% )
The following loop will check a range of I/O port addresses for conflicts before the AC28 is installed.
The AC28 I/O address is assumed to be in the variable MyAc28IoPort%.
DIM i%
DIM InpByte%
CONST MaxPamuxAddress% = 63
DIM MaxPort%: MaxPort% = MyAc28IoPort% + MaxPamuxAddress%
FOR i% = MyAc28IoPort% TO MaxPort%
InpByte% = INP(i%)
IF &HFF <> InpByte% THEN
EXIT FOR
‘ Error -- a port is in use
END IF
NEXT
IF &HFF <> InpByte% THEN
‘ Print something like “Port &H100 is in use.”
PRINT “Port &H”; HEX$(i%); “ is in use.”
BEEP
ELSE
‘ Print something like “Ports &H100 thru &H13F are OK to use.”
PRINT “Ports &H”; HEX$(MyAc28IoPort%); “ thru &H”; HEX$(MaxPort%);
PRINT “ are OK to use.”
END IF
COMMON SUBROUTINES
MyKillTime
This function implements a pause when running QBasic under DOS. It uses the BIOS timer to detect a
“timer tick.” Environments other than DOS, such as Windows or real-time kernels, typically offer
better timing capability with better resolution.
SUB MyKillTime
CONST BiosTimerLocation% = &H46C
DIM TickCounter%: TickCounter% = 3
DIM OldTick%: OldTick% = PEEK(BiosTimerLocation%)
DIM NewTick%
DEF SEG = 0
DO WHILE TickCounter%
NewTick% = PEEK(BiosTimerLocation%)
IF OldTick% <> NewTick% THEN
TickCounter% = TickCounter% - 1
OldTick% = NewTick%
END IF
LOOP
EXIT SUB
END SUB
Summary of Contents for PAMUX
Page 10: ...TABLE OF CONTENTS x Pamux User s Guide...
Page 14: ...TABLE OF CONTENTS xiv Pamux User s Guide...
Page 103: ...PROGRAMING WITH THE PAMUX DRIVER 3 42 Pamux User s Guide...
Page 121: ...PROGRAMING WITHOUT THE PAMUX DRIVER 4 18 Pamux User s Guide...
Page 125: ...TROUBLESHOOTING AND TIPS A 4 A 4 A 4 A 4 A 4 Pamux User s Guide...
Page 135: ...SPECIFICATIONS B 10 Pamux User s Guide...
Page 141: ...TEMPERATURE CONVERSIONS ROUTINES C 6 Pamux User s Guide...
Page 143: ...PRODUCT SUPPORT D 2 Pamux User s Guide...
Page 149: ...GLOSSARY E 6 Pamux User s Guide...