[Tinyos-help] Re: DAC on telosb
steinda at berkeley.edu
Mon Sep 19 18:46:31 PDT 2005
I've got some DAC on telosb code working. On the 6 pin header, the
#1 and two pins are 0 and 1 respectively. I call it directly with
For Pin 1 (port 0)
To set the pin to 0 V
DAC12_0CTL = DAC12IR + DAC12AMP_1; // This grounds the pin
To set the pin to some value between 0 and 2.5 V.
DAC12_0CTL = DAC12IR + DAC12AMP_5 + DAC12ENC; // Internal ref gain 1
DAC12_0DAT = X ;// where X is some value between 0 and 4095
4095 is 2.5 V, and 0 is 0V, the it's linearly related in between. I
find that grounding it works better than setting 0 V.
To use Pin 2 (port 1) use 1CTL and 1DAT, respectively. If anyone
wants I can make a demo application for this functionality.
More information about the Tinyos-help