Murata Electronics North America DNT24 Manual Do Utilizador

Página de 83
www.Murata.com
Technical support +1.678.684.2000
Page 24 of 83
© 2015 by Murata Manufacturing Co. Ltd.
E-mail:
tech_sup@murata.com
DNT24 Integration Guide – 03/04/15
5.3 Configuring Digital I/O
1. GPIO2 through GPIO 5 have configurable alternate functions as discussed in Section 7.4.7.
Select 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 pa-
rameter 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.
4.
Reconfigure the ADC measurement interval as needed by setting the AdcSampleIntvl parameter.
The default is 100 ms, and applies to all ADC channels.
5.
Set the AdcAveSelect parameter to the number of ADC readings to be averaged to produce a
measurement. The larger the AdcAveSelect parameter is set, the greater the noise filtering effect,
but the longer it takes to produce a measurement. Setting this parameter to 8 or more when the
ADC is operating in single-ended mode is especially helpful in stabilizing ADC measurements.
6.
Measurements on each ADC input can be compared to high/low threshold values, triggering an
I/O event report if the measurements go above/below the respective thresholds. The thresholds
for each ADC channel are set by loading the AdcXThresholdLo and AdcXThresholdHi, where X
refers to the ADC channel designator, 0 through 2. When the ADC is operating in differential
mode, the ADC1 to ADC0 differential measurement is compared to the “0” high and low thresh-
olds, and the ADC2 to ADC0 differential measurements is compared to the “1” high and low
thresholds. In this case the “2” threshold values are not used.