www.RFM.com
Technical s1.678.684.2000
Page 24 of 82
© 2010-2012 by RF Monolithics, Inc.
E-mail:
DNT90 Integration Guide - 05/10/12
5.2 Configuring the SPI Port
1. Enable either SPI
master mode
or SPI
slave mode
by setting the
SpiMode
parameter in Bank 3.
The serial port remains operational in SPI master mode but is disabled in SPI slave mode.
2. If using SPI master mode:
a. Select the SPI clock rate by setting the
SpiRateSel
parameter in Bank 3 (default
is 125 kbps)
b. Set the SPI master command string and string length by setting the
SpiMasterCmdStr
and
SpiMasterCmdLen
parameters respectively in Bank 3.
3. Configure the edge trigger direction, bit-sampling edge and bit-order options by setting the
SpiOptions
parameter in Bank 3.
5.3 Configuring Digital I/O
1. GPIO2 through GPIO 5 have configurable alternate functions as discussed in Section 7.4.7. Se-
lect either digital (state) functionality or alternate functionality for each of these pins by setting the
GpioAlt
parameter in Bank 6. Note that selecting SPI slave mode overrides the
GpioAlt
parameter
setting for GPIO3 though GPIO5.
2. Configure the direction of each GPIO pin as needed by setting the
GpioDir
parameter in Bank 6
(the default is all inputs).
3. Configure the direction of each GPIO pin for sleep mode as needed by setting the
GpioSleepDir
parameter in Bank 6 (the default is all inputs).
4. Set the initial state (power on) of all GPIO pins configured as outputs by setting the
GpioInit
pa-
rameter in Bank 6 (the default is all logic low).
5. Set the state of all GPIO pins configured as outputs in sleep mode by setting the
GpioSleepState
parameter in Bank 6 (the default is all logic low).
6. GPIO0 through GPIO3 can trigger I/O event reporting when functioning as digital inputs. Enable
event report triggering and optional sleep hold-off for these pins by setting the
GpioEdgeTrigger
parameter in Bank 6.
5.4 Configuring Analog I/O
1. Select the ADC full-scale reference by setting the
AdcReference
parameter in Bank 6. This set-
ting applies to all ADC channels. The default is the ADC_EXT_REF input. If ADC operation is not
needed, setting this parameter to 0x03 disables ADC operation, reducing current consumption.
2. Select the ADC mode, either single-ended or differential by setting the
AdcDiffMode
parameter in
Bank 6. The default is single-ended ADC operation.
3. If differential ADC mode is selected, set the desired ADC preamplifier gain for each ADC channel
with the
AdcGainCh0
and
AdcGainCh1
parameters in Bank 6. The default gain is 1. Note that the
full scale output voltage from the preamplifier is 2.4 V.