EmbeddedRelated.com
Forums

*** F2013's SD16_A ***

Started by ez430project November 23, 2008
Hi, thanks for the feedback.

What would this "resistor divider for measuring voltages above 0.6V"
be? In terms of values, etc? And a layout?

--- In m..., "Nirosh P. Wijayaratne"
wrote:
>
> Check your clock source. Sometimes that seems to decrease the
accuracy.
>
> Also, if you have already applied 4V to the pins, you may have
damaged the part. Try a new F2013 part in there. Use a resistor
divider for measuring voltages above 0.6V
>
> This is directly from the sample code zip file. I have used it and
I know it works. It's been a while though. You may have to make some
tweaks to suit your particular pin out etc:
>
> //******************************************************************
************
> // MSP430F20x3 Demo - SD16A, Sample A1+ Continuously, Set P1.0 if
> 0.3V
> //
> // Description: A continuous single-ended sample is made on A1+
using internal
> // VRef Unipolar output format used.
> // Inside of SD16 ISR, if A1 > 1/2VRef (0.3V), P1.0 set, else
reset.
> // ACLK = n/a, MCLK = SMCLK = SD16CLK = default DCO
> //
> // MSP430F20x3
> // ------------------
> // /|\| XIN|-
> // | | |
> // --|RST XOUT|-
> // | |
> // Vin+ -->|A1+ P1.2 |
> // |A1- = VSS P1.0|-->LED
> // | |
> //
> // M. Buccini / L. Westlund
> // Texas Instruments Inc.
> // October 2005
> // Built with CCE Version: 3.2.0 and IAR Embedded Workbench
Version: 3.40A
> //******************************************************************
************
> #include void main(void)
> {
> WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
> P1DIR |= 0x01; // Set P1.0 to output
direction
> SD16CTL = SD16REFON + SD16SSEL_1; // 1.2V ref, SMCLK
> SD16INCTL0 = SD16INCH_1; // A1+/-
> SD16CCTL0 = SD16UNI + SD16IE; // 256OSR, unipolar,
interrupt enable
> SD16AE = SD16AE2; // P1.1 A1+, A1- = VSS
> SD16CCTL0 |= SD16SC; // Set bit to start
conversion
>
> _BIS_SR(LPM0_bits + GIE);
> }
>
> #pragma vector = SD16_VECTOR
> __interrupt void SD16ISR(void)
> {
> if (SD16MEM0 < 0x7FFF) // SD16MEM0 > 0.3V?, clears
IFG
> P1OUT &= ~0x01;
> else
> P1OUT |= 0x01;
> }
> ----- Original Message -----
> From: ez430project
> To: m...
> Sent: Tuesday, November 25, 2008 7:58 AM
> Subject: [msp430] Re: *** F2013's SD16_A ***
> Hi, I'm really struggling here. Could anyone help me out - I've
> lowered my voltage input to 0.3V and am feeding this through Pin
6
> (P1.4).
>
> I'm getting different values for each reading.
>
> Could anyone provide a piece of code (that works) I could use to
get
> my program working - I would so appreciate it, beyond words.
>
> Donald
>
> --- In m..., "ez430project"
> wrote:
> >
> > I've tried feeding a constant 1.5V through Pin 6 (P1.4) using
the
> > sample code of sd16_a3.c, but still get a max of 2^16. As soon
as I
> > remove this voltage, there's still about 0.23V going through. I
> then
> > get numbers like 22, 365.
> >
> > Even though P1.0 (Pin 2) has no voltage going through, it still
> shows
> > a value. As does P1.2 (Pin 4).
> >
> > I'm confused as to why.
> >
> > --- In m..., "old_cow_yellow"

> > wrote:
> > >
> > > The input voltage has to be within the power rail. That is,
it
> has
> > to
> > > be above Vss (0.0V) and below Vcc (3.6V max). Otherwise, you
may
> > > damage the MSP430. Further more, the analog input has to be
below
> > > Vref. Otherwise, you always get the max digital reading.
> > >
> > > --- In m..., "ez430project"
> wrote:
> > > >
> > > > The voltage has a max. range of (currently) 4V. I want to
> sample
> > it
> > > > for every i = 50,000 delay. The voltage input does tend to
> change.
> > > >
> > > > Currently all I seem to be getting is 2^16 value regardless
of
> > the
> > > > input, even when it changes.
> > > >
> > > > --- In m..., "old_cow_yellow"
>
> > > > wrote:
> > > > >
> > > > > Here is a basic layout of a F2013 SD16_A example.
> > > > >
> > > > > #include
> > > > > void main( void )
> > > > > {
> > > > > // Stop watchdog timer to prevent time out reset
> > > > > WDTCTL = WDTPW + WDTHOLD;
> > > > > // set up used and unused io pins
> > > > > // ...
> > > > > // set up all clocks if defalts are not applicable
> > > > > // ...
> > > > > // set up TA and WDT if used
> > > > > // ...
> > > > > // set up SD16_A controller
> > > > > // ...
> > > > > // set up interrupts and enable them if used
> > > > > // ...
> > > > > // set up and run in an endless loop, or go to LPM
> > > > > // ...
> > > > > }
> > > > > // add interrupt service routines if applicable
> > > > > // ...
> > > > >
> > > > > There are lots of examples. But examples are just
examples,
> > they
> > > > will
> > > > > not be exactly what you want. What is the voltage range
of
> the
> > > > input?
> > > > > What is the frequency range? How often do you want to
sample
> it?
> > > > >
> > > > > --- In m..., "ez430project"

> > wrote:
> > > > > >
> > > > > > Hi, I've already looked but they don't seem to provide
a
> > basic
> > > > layout
> > > > > > for measuring a simple voltage coming in - does anyone
have
> a
> > > > basic
> > > > > > layout code?
> > > > > >
> > > > > > --- In m..., "marek.gaik"
wrote:
> > > > > > >
> > > > > > > --- In m..., "ez430project"
> >
> > > > wrote:
> > > > > > > >
> > > > > > > > Hi, I'm trying to measure the voltage output from a
> > circuit,
> > > > and
> > > > > > > > convert this to digital using the SD16_A.
> > > > > > > >
> > > > > > > > Is there a sample code I could use for ADC
conversion
> > using
> > > > one
> > > > > > pin.
> > > > > > > >
> > > > > > > > Donald
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Donald,
> > > > > > > Have you looked at this examples:
> > > > > > > http://focus.ti.com/mcu/docs/mcuprodcodeexamples.tsp?
> > > > > > sectionId&tabId68
> > > > > > >
> > > > > > > I suggest to download them all. And just find code
> examples
> > > > with
> > > > > > SD16_A.
> > > > > > > As i noticed, slac077c.zip contains some example
codes,
> > wich
> > > > can be
> > > > > > > helpful for you.
> > > > > > >
> > > > > > > Regards,
> > > > > > > Mark
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
>

Beginning Microcontrollers with the MSP430

Hi,

I'm not sure if it's damaged or not (how can I check this?)

Also, I've used that sample code - my SD16MEM0 = 0.

Could you suggest a voltage value I can apply and a pin I can use
that you know works well (I'm using the small detachable board which
is always connected to the USB debugging interface).

Much appreciate your reply,

Thanks,

Donald

--- In m..., "Nirosh P. Wijayaratne"
wrote:
>
> Check your clock source. Sometimes that seems to decrease the
accuracy.
>
> Also, if you have already applied 4V to the pins, you may have
damaged the part. Try a new F2013 part in there. Use a resistor
divider for measuring voltages above 0.6V
>
> This is directly from the sample code zip file. I have used it and
I know it works. It's been a while though. You may have to make some
tweaks to suit your particular pin out etc:
>
> //******************************************************************
************
> // MSP430F20x3 Demo - SD16A, Sample A1+ Continuously, Set P1.0 if
> 0.3V
> //
> // Description: A continuous single-ended sample is made on A1+
using internal
> // VRef Unipolar output format used.
> // Inside of SD16 ISR, if A1 > 1/2VRef (0.3V), P1.0 set, else
reset.
> // ACLK = n/a, MCLK = SMCLK = SD16CLK = default DCO
> //
> // MSP430F20x3
> // ------------------
> // /|\| XIN|-
> // | | |
> // --|RST XOUT|-
> // | |
> // Vin+ -->|A1+ P1.2 |
> // |A1- = VSS P1.0|-->LED
> // | |
> //
> // M. Buccini / L. Westlund
> // Texas Instruments Inc.
> // October 2005
> // Built with CCE Version: 3.2.0 and IAR Embedded Workbench
Version: 3.40A
> //******************************************************************
************
> #include void main(void)
> {
> WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
> P1DIR |= 0x01; // Set P1.0 to output
direction
> SD16CTL = SD16REFON + SD16SSEL_1; // 1.2V ref, SMCLK
> SD16INCTL0 = SD16INCH_1; // A1+/-
> SD16CCTL0 = SD16UNI + SD16IE; // 256OSR, unipolar,
interrupt enable
> SD16AE = SD16AE2; // P1.1 A1+, A1- = VSS
> SD16CCTL0 |= SD16SC; // Set bit to start
conversion
>
> _BIS_SR(LPM0_bits + GIE);
> }
>
> #pragma vector = SD16_VECTOR
> __interrupt void SD16ISR(void)
> {
> if (SD16MEM0 < 0x7FFF) // SD16MEM0 > 0.3V?, clears
IFG
> P1OUT &= ~0x01;
> else
> P1OUT |= 0x01;
> }
> ----- Original Message -----
> From: ez430project
> To: m...
> Sent: Tuesday, November 25, 2008 7:58 AM
> Subject: [msp430] Re: *** F2013's SD16_A ***
> Hi, I'm really struggling here. Could anyone help me out - I've
> lowered my voltage input to 0.3V and am feeding this through Pin
6
> (P1.4).
>
> I'm getting different values for each reading.
>
> Could anyone provide a piece of code (that works) I could use to
get
> my program working - I would so appreciate it, beyond words.
>
> Donald
>
> --- In m..., "ez430project"
> wrote:
> >
> > I've tried feeding a constant 1.5V through Pin 6 (P1.4) using
the
> > sample code of sd16_a3.c, but still get a max of 2^16. As soon
as I
> > remove this voltage, there's still about 0.23V going through. I
> then
> > get numbers like 22, 365.
> >
> > Even though P1.0 (Pin 2) has no voltage going through, it still
> shows
> > a value. As does P1.2 (Pin 4).
> >
> > I'm confused as to why.
> >
> > --- In m..., "old_cow_yellow"

> > wrote:
> > >
> > > The input voltage has to be within the power rail. That is,
it
> has
> > to
> > > be above Vss (0.0V) and below Vcc (3.6V max). Otherwise, you
may
> > > damage the MSP430. Further more, the analog input has to be
below
> > > Vref. Otherwise, you always get the max digital reading.
> > >
> > > --- In m..., "ez430project"
> wrote:
> > > >
> > > > The voltage has a max. range of (currently) 4V. I want to
> sample
> > it
> > > > for every i = 50,000 delay. The voltage input does tend to
> change.
> > > >
> > > > Currently all I seem to be getting is 2^16 value regardless
of
> > the
> > > > input, even when it changes.
> > > >
> > > > --- In m..., "old_cow_yellow"
>
> > > > wrote:
> > > > >
> > > > > Here is a basic layout of a F2013 SD16_A example.
> > > > >
> > > > > #include
> > > > > void main( void )
> > > > > {
> > > > > // Stop watchdog timer to prevent time out reset
> > > > > WDTCTL = WDTPW + WDTHOLD;
> > > > > // set up used and unused io pins
> > > > > // ...
> > > > > // set up all clocks if defalts are not applicable
> > > > > // ...
> > > > > // set up TA and WDT if used
> > > > > // ...
> > > > > // set up SD16_A controller
> > > > > // ...
> > > > > // set up interrupts and enable them if used
> > > > > // ...
> > > > > // set up and run in an endless loop, or go to LPM
> > > > > // ...
> > > > > }
> > > > > // add interrupt service routines if applicable
> > > > > // ...
> > > > >
> > > > > There are lots of examples. But examples are just
examples,
> > they
> > > > will
> > > > > not be exactly what you want. What is the voltage range
of
> the
> > > > input?
> > > > > What is the frequency range? How often do you want to
sample
> it?
> > > > >
> > > > > --- In m..., "ez430project"

> > wrote:
> > > > > >
> > > > > > Hi, I've already looked but they don't seem to provide
a
> > basic
> > > > layout
> > > > > > for measuring a simple voltage coming in - does anyone
have
> a
> > > > basic
> > > > > > layout code?
> > > > > >
> > > > > > --- In m..., "marek.gaik"
wrote:
> > > > > > >
> > > > > > > --- In m..., "ez430project"
> >
> > > > wrote:
> > > > > > > >
> > > > > > > > Hi, I'm trying to measure the voltage output from a
> > circuit,
> > > > and
> > > > > > > > convert this to digital using the SD16_A.
> > > > > > > >
> > > > > > > > Is there a sample code I could use for ADC
conversion
> > using
> > > > one
> > > > > > pin.
> > > > > > > >
> > > > > > > > Donald
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Donald,
> > > > > > > Have you looked at this examples:
> > > > > > > http://focus.ti.com/mcu/docs/mcuprodcodeexamples.tsp?
> > > > > > sectionId&tabId68
> > > > > > >
> > > > > > > I suggest to download them all. And just find code
> examples
> > > > with
> > > > > > SD16_A.
> > > > > > > As i noticed, slac077c.zip contains some example
codes,
> > wich
> > > > can be
> > > > > > > helpful for you.
> > > > > > >
> > > > > > > Regards,
> > > > > > > Mark
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
>

4V max you said? Use a 59K 1% and a 10K 1%.....that should give you about 580mV at the pin when the input is 4V.

I am not familiar with the board you have. On mine, if I suspected the part was damaged, I would change it out.

If your part is working, grounding the pin should result in 0x7FFF....or maybe 0x0000 depending on your set-up. It's been a while, I cannot remember the details.....

Nirosh
----- Original Message -----
From: ez430project
To: m...
Sent: Tuesday, November 25, 2008 2:37 PM
Subject: [msp430] Re: *** F2013's SD16_A ***
Hi,

I'm not sure if it's damaged or not (how can I check this?)

Also, I've used that sample code - my SD16MEM0 = 0.

Could you suggest a voltage value I can apply and a pin I can use
that you know works well (I'm using the small detachable board which
is always connected to the USB debugging interface).

Much appreciate your reply,

Thanks,

Donald

--- In m..., "Nirosh P. Wijayaratne"
wrote:
>
> Check your clock source. Sometimes that seems to decrease the
accuracy.
>
> Also, if you have already applied 4V to the pins, you may have
damaged the part. Try a new F2013 part in there. Use a resistor
divider for measuring voltages above 0.6V
>
> This is directly from the sample code zip file. I have used it and
I know it works. It's been a while though. You may have to make some
tweaks to suit your particular pin out etc:
>
> //******************************************************************
************
> // MSP430F20x3 Demo - SD16A, Sample A1+ Continuously, Set P1.0 if
> 0.3V
> //
> // Description: A continuous single-ended sample is made on A1+
using internal
> // VRef Unipolar output format used.
> // Inside of SD16 ISR, if A1 > 1/2VRef (0.3V), P1.0 set, else
reset.
> // ACLK = n/a, MCLK = SMCLK = SD16CLK = default DCO
> //
> // MSP430F20x3
> // ------------------
> // /|\| XIN|-
> // | | |
> // --|RST XOUT|-
> // | |
> // Vin+ -->|A1+ P1.2 |
> // |A1- = VSS P1.0|-->LED
> // | |
> //
> // M. Buccini / L. Westlund
> // Texas Instruments Inc.
> // October 2005
> // Built with CCE Version: 3.2.0 and IAR Embedded Workbench
Version: 3.40A
> //******************************************************************
************
> #include
>
> void main(void)
> {
> WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
> P1DIR |= 0x01; // Set P1.0 to output
direction
> SD16CTL = SD16REFON + SD16SSEL_1; // 1.2V ref, SMCLK
> SD16INCTL0 = SD16INCH_1; // A1+/-
> SD16CCTL0 = SD16UNI + SD16IE; // 256OSR, unipolar,
interrupt enable
> SD16AE = SD16AE2; // P1.1 A1+, A1- = VSS
> SD16CCTL0 |= SD16SC; // Set bit to start
conversion
>
> _BIS_SR(LPM0_bits + GIE);
> }
>
> #pragma vector = SD16_VECTOR
> __interrupt void SD16ISR(void)
> {
> if (SD16MEM0 < 0x7FFF) // SD16MEM0 > 0.3V?, clears
IFG
> P1OUT &= ~0x01;
> else
> P1OUT |= 0x01;
> }
>
>
> ----- Original Message -----
> From: ez430project
> To: m...
> Sent: Tuesday, November 25, 2008 7:58 AM
> Subject: [msp430] Re: *** F2013's SD16_A ***
>
>
> Hi, I'm really struggling here. Could anyone help me out - I've
> lowered my voltage input to 0.3V and am feeding this through Pin
6
> (P1.4).
>
> I'm getting different values for each reading.
>
> Could anyone provide a piece of code (that works) I could use to
get
> my program working - I would so appreciate it, beyond words.
>
> Donald
>
> --- In m..., "ez430project"
> wrote:
> >
> > I've tried feeding a constant 1.5V through Pin 6 (P1.4) using
the
> > sample code of sd16_a3.c, but still get a max of 2^16. As soon
as I
> > remove this voltage, there's still about 0.23V going through. I
> then
> > get numbers like 22, 365.
> >
> > Even though P1.0 (Pin 2) has no voltage going through, it still
> shows
> > a value. As does P1.2 (Pin 4).
> >
> > I'm confused as to why.
> >
> > --- In m..., "old_cow_yellow"

> > wrote:
> > >
> > > The input voltage has to be within the power rail. That is,
it
> has
> > to
> > > be above Vss (0.0V) and below Vcc (3.6V max). Otherwise, you
may
> > > damage the MSP430. Further more, the analog input has to be
below
> > > Vref. Otherwise, you always get the max digital reading.
> > >
> > > --- In m..., "ez430project"
> wrote:
> > > >
> > > > The voltage has a max. range of (currently) 4V. I want to
> sample
> > it
> > > > for every i = 50,000 delay. The voltage input does tend to
> change.
> > > >
> > > > Currently all I seem to be getting is 2^16 value regardless
of
> > the
> > > > input, even when it changes.
> > > >
> > > > --- In m..., "old_cow_yellow"
>
> > > > wrote:
> > > > >
> > > > > Here is a basic layout of a F2013 SD16_A example.
> > > > >
> > > > > #include
> > > > > void main( void )
> > > > > {
> > > > > // Stop watchdog timer to prevent time out reset
> > > > > WDTCTL = WDTPW + WDTHOLD;
> > > > > // set up used and unused io pins
> > > > > // ...
> > > > > // set up all clocks if defalts are not applicable
> > > > > // ...
> > > > > // set up TA and WDT if used
> > > > > // ...
> > > > > // set up SD16_A controller
> > > > > // ...
> > > > > // set up interrupts and enable them if used
> > > > > // ...
> > > > > // set up and run in an endless loop, or go to LPM
> > > > > // ...
> > > > > }
> > > > > // add interrupt service routines if applicable
> > > > > // ...
> > > > >
> > > > > There are lots of examples. But examples are just
examples,
> > they
> > > > will
> > > > > not be exactly what you want. What is the voltage range
of
> the
> > > > input?
> > > > > What is the frequency range? How often do you want to
sample
> it?
> > > > >
> > > > > --- In m..., "ez430project"

> > wrote:
> > > > > >
> > > > > > Hi, I've already looked but they don't seem to provide
a
> > basic
> > > > layout
> > > > > > for measuring a simple voltage coming in - does anyone
have
> a
> > > > basic
> > > > > > layout code?
> > > > > >
> > > > > > --- In m..., "marek.gaik"
wrote:
> > > > > > >
> > > > > > > --- In m..., "ez430project"
> >
> > > > wrote:
> > > > > > > >
> > > > > > > > Hi, I'm trying to measure the voltage output from a
> > circuit,
> > > > and
> > > > > > > > convert this to digital using the SD16_A.
> > > > > > > >
> > > > > > > > Is there a sample code I could use for ADC
conversion
> > using
> > > > one
> > > > > > pin.
> > > > > > > >
> > > > > > > > Donald
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi Donald,
> > > > > > > Have you looked at this examples:
> > > > > > > http://focus.ti.com/mcu/docs/mcuprodcodeexamples.tsp?
> > > > > > sectionId&tabId68
> > > > > > >
> > > > > > > I suggest to download them all. And just find code
> examples
> > > > with
> > > > > > SD16_A.
> > > > > > > As i noticed, slac077c.zip contains some example
codes,
> > wich
> > > > can be
> > > > > > > helpful for you.
> > > > > > >
> > > > > > > Regards,
> > > > > > > Mark
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
>
>
>
>
>


I think I should try a new one and compare results (this time feed a
really low value).

My USB/chip is the eZ430-F2013. I place one wire through Pin 14 (A-)
(that should be ground, I think) and one wire through another pin
(A+). But I always get 0.

Thanks for your feedback,

Donald

--- In m..., "Nirosh P. Wijayaratne"
wrote:
>
> 4V max you said? Use a 59K 1% and a 10K 1%.....that should give you
about 580mV at the pin when the input is 4V.
>
> I am not familiar with the board you have. On mine, if I suspected
the part was damaged, I would change it out.
>
> If your part is working, grounding the pin should result in
0x7FFF....or maybe 0x0000 depending on your set-up. It's been a
while, I cannot remember the details.....
>
> Nirosh
> ----- Original Message -----
> From: ez430project
> To: m...
> Sent: Tuesday, November 25, 2008 2:37 PM
> Subject: [msp430] Re: *** F2013's SD16_A ***
> Hi,
>
> I'm not sure if it's damaged or not (how can I check this?)
>
> Also, I've used that sample code - my SD16MEM0 = 0.
>
> Could you suggest a voltage value I can apply and a pin I can use
> that you know works well (I'm using the small detachable board
which
> is always connected to the USB debugging interface).
>
> Much appreciate your reply,
>
> Thanks,
>
> Donald
>
> --- In m..., "Nirosh P. Wijayaratne"

> wrote:
> >
> > Check your clock source. Sometimes that seems to decrease the
> accuracy.
> >
> > Also, if you have already applied 4V to the pins, you may have
> damaged the part. Try a new F2013 part in there. Use a resistor
> divider for measuring voltages above 0.6V
> >
> > This is directly from the sample code zip file. I have used it
and
> I know it works. It's been a while though. You may have to make
some
> tweaks to suit your particular pin out etc:
> >
>
> //******************************************************************
> ************
> > // MSP430F20x3 Demo - SD16A, Sample A1+ Continuously, Set P1.0
if
> > 0.3V
> > //
> > // Description: A continuous single-ended sample is made on A1+
> using internal
> > // VRef Unipolar output format used.
> > // Inside of SD16 ISR, if A1 > 1/2VRef (0.3V), P1.0 set, else
> reset.
> > // ACLK = n/a, MCLK = SMCLK = SD16CLK = default DCO
> > //
> > // MSP430F20x3
> > // ------------------
> > // /|\| XIN|-
> > // | | |
> > // --|RST XOUT|-
> > // | |
> > // Vin+ -->|A1+ P1.2 |
> > // |A1- = VSS P1.0|-->LED
> > // | |
> > //
> > // M. Buccini / L. Westlund
> > // Texas Instruments Inc.
> > // October 2005
> > // Built with CCE Version: 3.2.0 and IAR Embedded Workbench
> Version: 3.40A
>
> //******************************************************************
> ************
> > #include
> >
> > void main(void)
> > {
> > WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
> > P1DIR |= 0x01; // Set P1.0 to output
> direction
> > SD16CTL = SD16REFON + SD16SSEL_1; // 1.2V ref, SMCLK
> > SD16INCTL0 = SD16INCH_1; // A1+/-
> > SD16CCTL0 = SD16UNI + SD16IE; // 256OSR, unipolar,
> interrupt enable
> > SD16AE = SD16AE2; // P1.1 A1+, A1- = VSS
> > SD16CCTL0 |= SD16SC; // Set bit to start
> conversion
> >
> > _BIS_SR(LPM0_bits + GIE);
> > }
> >
> > #pragma vector = SD16_VECTOR
> > __interrupt void SD16ISR(void)
> > {
> > if (SD16MEM0 < 0x7FFF) // SD16MEM0 > 0.3V?, clears
> IFG
> > P1OUT &= ~0x01;
> > else
> > P1OUT |= 0x01;
> > }
> >
> >
> > ----- Original Message -----
> > From: ez430project
> > To: m...
> > Sent: Tuesday, November 25, 2008 7:58 AM
> > Subject: [msp430] Re: *** F2013's SD16_A ***
> >
> >
> > Hi, I'm really struggling here. Could anyone help me out - I've
> > lowered my voltage input to 0.3V and am feeding this through
Pin
> 6
> > (P1.4).
> >
> > I'm getting different values for each reading.
> >
> > Could anyone provide a piece of code (that works) I could use
to
> get
> > my program working - I would so appreciate it, beyond words.
> >
> > Donald
> >
> > --- In m..., "ez430project"
> > wrote:
> > >
> > > I've tried feeding a constant 1.5V through Pin 6 (P1.4) using
> the
> > > sample code of sd16_a3.c, but still get a max of 2^16. As
soon
> as I
> > > remove this voltage, there's still about 0.23V going through.
I
> > then
> > > get numbers like 22, 365.
> > >
> > > Even though P1.0 (Pin 2) has no voltage going through, it
still
> > shows
> > > a value. As does P1.2 (Pin 4).
> > >
> > > I'm confused as to why.
> > >
> > > --- In m..., "old_cow_yellow"
>
> > > wrote:
> > > >
> > > > The input voltage has to be within the power rail. That is,
> it
> > has
> > > to
> > > > be above Vss (0.0V) and below Vcc (3.6V max). Otherwise,
you
> may
> > > > damage the MSP430. Further more, the analog input has to be
> below
> > > > Vref. Otherwise, you always get the max digital reading.
> > > >
> > > > --- In m..., "ez430project"

> > wrote:
> > > > >
> > > > > The voltage has a max. range of (currently) 4V. I want to
> > sample
> > > it
> > > > > for every i = 50,000 delay. The voltage input does tend
to
> > change.
> > > > >
> > > > > Currently all I seem to be getting is 2^16 value
regardless
> of
> > > the
> > > > > input, even when it changes.
> > > > >
> > > > > --- In m..., "old_cow_yellow"
> >
> > > > > wrote:
> > > > > >
> > > > > > Here is a basic layout of a F2013 SD16_A example.
> > > > > >
> > > > > > #include
> > > > > > void main( void )
> > > > > > {
> > > > > > // Stop watchdog timer to prevent time out reset
> > > > > > WDTCTL = WDTPW + WDTHOLD;
> > > > > > // set up used and unused io pins
> > > > > > // ...
> > > > > > // set up all clocks if defalts are not applicable
> > > > > > // ...
> > > > > > // set up TA and WDT if used
> > > > > > // ...
> > > > > > // set up SD16_A controller
> > > > > > // ...
> > > > > > // set up interrupts and enable them if used
> > > > > > // ...
> > > > > > // set up and run in an endless loop, or go to LPM
> > > > > > // ...
> > > > > > }
> > > > > > // add interrupt service routines if applicable
> > > > > > // ...
> > > > > >
> > > > > > There are lots of examples. But examples are just
> examples,
> > > they
> > > > > will
> > > > > > not be exactly what you want. What is the voltage range
> of
> > the
> > > > > input?
> > > > > > What is the frequency range? How often do you want to
> sample
> > it?
> > > > > >
> > > > > > --- In m..., "ez430project"
>
> > > wrote:
> > > > > > >
> > > > > > > Hi, I've already looked but they don't seem to
provide
> a
> > > basic
> > > > > layout
> > > > > > > for measuring a simple voltage coming in - does
anyone
> have
> > a
> > > > > basic
> > > > > > > layout code?
> > > > > > >
> > > > > > > --- In m..., "marek.gaik"
> wrote:
> > > > > > > >
> > > > > > > > --- In m..., "ez430project"
> > >
> > > > > wrote:
> > > > > > > > >
> > > > > > > > > Hi, I'm trying to measure the voltage output from
a
> > > circuit,
> > > > > and
> > > > > > > > > convert this to digital using the SD16_A.
> > > > > > > > >
> > > > > > > > > Is there a sample code I could use for ADC
> conversion
> > > using
> > > > > one
> > > > > > > pin.
> > > > > > > > >
> > > > > > > > > Donald
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Hi Donald,
> > > > > > > > Have you looked at this examples:
> > > > > > > >
http://focus.ti.com/mcu/docs/mcuprodcodeexamples.tsp?
> > > > > > > sectionId&tabId68
> > > > > > > >
> > > > > > > > I suggest to download them all. And just find code
> > examples
> > > > > with
> > > > > > > SD16_A.
> > > > > > > > As i noticed, slac077c.zip contains some example
> codes,
> > > wich
> > > > > can be
> > > > > > > > helpful for you.
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > Mark
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> >
> >
> >
> >
>
>
>