PROGRAMING WITHOUT THE PAMUX DRIVER
Pamux User’s Guide
4-5
TURN OFF RESET
Before reading from or writing to any Pamux station, you must make sure a reset is not being
requested. To do so you will need to turn off the reset if it is configured on the brain board as active
high, or turn on the reset if it is configured as active low. (See Chapter 3 to review the positions of the
reset jumpers on the brain boards.)
OUT MyAc28ResetPort%, NOT MyAc28ResetLevel%
‘ Restore reset line
RESETTING THE SYSTEM
The following example pulses the reset line. First, it asserts the reset line by turning it on if it is active
high, turning it off it is active low. Then, after a brief time interval, it returns the reset line to its normal
state. The subroutine MyKillTime is used to pause the routine (see “Common Subroutines” at the
end of this chapter for specifics).
DECLARE SUB MyKillTime ()
OUT MyAc28ResetPort%, MyAc28ResetLevel%
‘ Reset I/O
CALL MyKillTime
‘ Wait at least 20 ms
OUT MyAc28ResetPort%, NOT MyAc28ResetLevel%
READING FROM AND WRITING TO DIGITAL PAMUX
STATIONS
The I/O on digital B4 and B5 Pamux stations is accessed eight bits at a time. Channel 0 is the least
significant bit.
READING DIGITAL INPUTS
The following example reads 16 digital input channels and prints the hex representation on the
screen. During the loop, the address LED should be on almost continuously and the watchdog LED
should be off.
DIM UpperByte%
DIM LowerByte%
DO WHILE 1
‘ Loop until ctrl-break
UpperByte% = INP(MyAc28IoPort% + MyDigitalBoard% + 1)
‘ Read bank 1
LowerByte% = INP(MyAc28IoPort% + MyDigitalBoard%)
‘ Read bank 0
PRINT HEX$( UpperByte%); HEX$( LowerByte%)
LOOP
Содержание PAMUX
Страница 10: ...TABLE OF CONTENTS x Pamux User s Guide...
Страница 14: ...TABLE OF CONTENTS xiv Pamux User s Guide...
Страница 103: ...PROGRAMING WITH THE PAMUX DRIVER 3 42 Pamux User s Guide...
Страница 121: ...PROGRAMING WITHOUT THE PAMUX DRIVER 4 18 Pamux User s Guide...
Страница 125: ...TROUBLESHOOTING AND TIPS A 4 A 4 A 4 A 4 A 4 Pamux User s Guide...
Страница 135: ...SPECIFICATIONS B 10 Pamux User s Guide...
Страница 141: ...TEMPERATURE CONVERSIONS ROUTINES C 6 Pamux User s Guide...
Страница 143: ...PRODUCT SUPPORT D 2 Pamux User s Guide...
Страница 149: ...GLOSSARY E 6 Pamux User s Guide...