Using I2C To Talk To A Maxim Digital To Analogue Converter - FIGnition FUZE Hardware Reference Manual

Table of Contents

Advertisement

ino's loop function tests to see if the SPI slave has received a byte and if so, reads the
SPi Data Register and displays the character.
The FIGnition code is similarly fairly simple. To use SPI on FIGnition we need to define an
SPI Packet format, because FIGnition already uses SPI when executing code so FIGnition
needs a special SPI driver. The Spi driver expects a port pin to be defined for the Slave
select, then a source packet to be sent to the Spi device and an address for a destination
packet to be received from the Spi device afterwards.
Here we place the spi packet at the beginning of the UDG area ( vram 600 +). The Slave
select is defined as PORTD ($2B) bit 5 ($20)on FIGnition. The source packet starts at
spiSrc
which is 10 bytes after the spi packet and it's length is 1. We don't need a destina-
tion packet, so the next two words are 0, 0.
The main code sets up PortD5 to be an output, then goes into a loop. It waits for a key-
press, displays it; stores the key press in the
spiSrc
address and finally sends the spi
packet (
spiPckt
>spi).
To Use it you need to load the programs (but don't run it yet) on your arduino and FIGni-
tion; then execute
spiDemo <exe>
on FIGnition and finally run the sketch on the arduino.
After that, whatever you type on FIGnition should be sent to the arduino and output on its
monitor (although carriage returns will be displayed incorrectly).
9.4 Using I2C to talk to a Maxim Digital To
Analogue Converter.
FIGnition can be setup to talk to a Max517 or a Max519 DAC (RS Parts: 622-9392 and
540-4019). To setup FIGnition to use I2C, you must first cut the track between the pins of
LK1 in order to disable the LED.
Cut Here
Fig 9.4
To use I2C with a FIGnition you must then add two resistors (2K2 resistors will work well)
between Pin 27 and Vcc and between Pin 28 and Vcc.

Advertisement

Table of Contents
loading

Table of Contents