Using Spi To Backup The External Flash - FIGnition FUZE Hardware Reference Manual

Table of Contents

Advertisement

The
ioxDev
is set to ioxBase+4 because the address offset in the example circuit has
been set to 4. To use the I/O expander you must first execute i2cini.
By default the ports are set up as input ports with pull-ups turned off. To read the port's in-
put pins you'd type:
ioxGpio iox.c@ <exe>
Which would put the value of the port's inputs on the stack (which you could then display
using
. <exe>
).
To enable or disable pull-ups on the input port you would type (for example):
$40 ioxGppu iox.c! <exe>
This would enable the pull-up on port bit 6 and disable all the others.
To change the data direction of the ports you'd type (for example):
$B ioxDdr iox.c! <exe>
This would make port bits 3, 1 and 0 outputs.
To write a value to the port you'd type (for example):
$2 ioxOlat iox.c! <exe>
Which would output 0 to bit 3, 1 to bit 1 and 0 to bit 0 of the output port bits.
The
ioxDemo
example initializes the i2c; sets the bottom 4 port bits to outputs then acti-
vates pull-ups on port bits 4 and 5. After that it goes into a loop where every second it out-
puts the values 0 to 15 on port bits 0..3 and displays the input value of the port.

9.6 Using SPI to backup the external Flash.

As standard, FIGnition only supports a single external Flash chip for storage, which means
it isn't possible in Forth to copy blocks to another Flash chip or backup the external Flash.
However it's possible to do this by adding a small shield design and writing a program that
uses the Forth Spi Driver. 1Mbyte SPI Amic Flash chips can be bought from RS Compo-
nents, part number: 711-7972. First the circuit:

Advertisement

Table of Contents
loading

Table of Contents