[Tinyos-help] Re: DAC on telosb
joe at polastre.com
Mon Sep 19 18:56:05 PDT 2005
You may want to check out this message from tinyos-msp430, as it is
the "beta" version of the drivers that will make their way into a
TinyOS release shortly.
On 9/19/05, Dan Steingart <steinda at berkeley.edu> wrote:
> 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
> these lines:
> 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.
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
More information about the Tinyos-help