I/O Trade-Off - FIGnition FUZE Hardware Reference Manual

Table of Contents

Advertisement

And therefore:
This is what
tempDemo
tempDemo <exe>
How does the analog port code work? To initialize the adc you provide the temperature
reference and channel selection as a combined value and then execute adInit. To use
an external adc with Vcc as the reference voltage you set the value of the port: 0..5 + $40
(as in the analogDemo). For the internal temperature reference you must provide the in-
ternal reference voltage: 1.1v which is encoded as $C0 + the port => $C8, hence the tem-
perature demo starts with
bits will be 0, so you would just use
The
period code is a timeout mechanism that allows your program to use either
sample?
the internal TCNT1 timer (which has a 0.4µs resolution up to 13.1ms) or the clock timer
(which has a 50ms resolution up to 655s) and still do background processing. The follow-
ing code snippet shows how:
begin
sample? if
chan sample
processSample
then
backgroundProcessing
condition until
To set the sample period in units for the current timer you would type:
aValue samplePeriod ! <exe>
To switch to the TCNT1 timer you would type:
Tcnt1 sampClock ! <exe> ( clock sampClock ! to switch back)
So,
1250 samplePeriod ! Tcnt1 sampClock ! <exe>
period 500µs. Note, owing to the video generation on FIGnition, sample periods <10ms
cannot be reliably measured.

9.2.4 I/O Trade-Off

Access more I/O pins can be achieved with a trade-off in FIGnition's Functionality.
calculates:
adInit. To use AVREF as the voltage reference the upper
$C8
$5 adInit
.
would make the sample

Advertisement

Table of Contents
loading

Table of Contents