FIGnition FUZE Hardware Reference Manual page 69

Table of Contents

Advertisement

Here, the A2 to A0 lines determine the address offset from 0 to 7. A2 is set to 5v ('1') with
A1 and A0 both set to 0v ('0'), which means the address offset is 4. /Reset is held high.
First you need to set up FIGnition as in section 9.2.6 up to the code that enables FIGnition
to talk to I2C devices. The following code provides access to a Microchip 8-bit I/O Ex-
pander.
I/O Expander Library
$40 const ioxBase
0 const ioxDdr
1 const ioxIpol
5 const ioxIoCon
6 const ioxGppu
9 const ioxGpio
10 const ioxOlat
ioxBase 4 + const ioxDev
: iox.c! ( val reg)
ioxDev i2c{
>i2c >i2c
}i2c
;
: iox.c@ ( reg - val)
ioxDev i2c{
>i2c
ioxDev 1 or i2c{
i2c>+
}i2c
;
Fig 9.7
I/O Expander Demonstration
: ioxDemo
i2cini
$F ioxDdr iox.c!
$30 ioxGppu iox.c!
16 0 do
i ioxOlat iox.c!
ioxGpio iox.c@ .
! 50 pause
loop
;

Advertisement

Table of Contents
loading

Table of Contents