Beginner questions

5 views
Skip to first unread message

Bill

unread,
Aug 2, 2010, 11:36:21 AM8/2/10
to TI Launchpad
Another thread [ https://groups.google.com/group/ti-launchpad/browse_thread/thread/ebd11949354ce2a5
] got off topic on discussions of things that people cant quite figure
out from the docs and/or Beginner questions.

To stop hijacking the thread I am starting this new one.

So far questions include:

"the stuff about the low power states seems a little incomplete, some
docs mention 4 power states some 5 and I have not found anything that
explicitly answers the question of if you need to re-issue the low
power command at the end of your interrupt handle code."

(it seems you do not have to re-issue the sleep command)



"how much do those tiny leds on the board draw?"

(NJC has a good suggestion for figuring this out with the right tools
in the original thread)



"I don't use an external crystal for my project; from what I
understand that seriously limits me as to which low power modes I can
use"

the last question lead to these posts:


-----------------------------------------------------------------------------------------------------------
I thought I just ran into the limitation you were mentioning about not
having an external crystal while trying to build the temp project I
had mentioned. it seems that SMCLK is the only clock that works
without the debugger and ACLK is the one you want for long durations,
but some poking about and I found the command to change ACLK to not
rely on an external reference "BCSCTL3 |= LFXT1S_2" and it seems to
work without the emulator connection.

what is the limitation you were referring to, just that it is less
accurate timing?

anyway, I took a stab at the blinky thermometer idea I mentioned
earlier. you can see the code here :

http://bill-landers.blogspot.com/2010/08/msp430-launchpad-low-power-thermometer.html

most likely I have done some things poorly, but it seems to work
correctly...



From: NJC MSP430 LaunchPad Blog <nicholasjc...@gmail.com>
Date: Mon, 2 Aug 2010 01:23:13 -0700 (PDT)

Bill,
http://mspsci.blogspot.com/2010/07/tutorial-08-beating-heart-bcs-part-i.html

I would recommend taking a look at beretta's post above on clocks if
you haven't already. If you want some extra help on understanding the
clocks better, post on either this group or the 43oh.com/forum/ . Make
new threads, help start the community. :-) I'll also comment on any
post you make about the limitations I mentioned in my last message.

BCSCTL3 |= LFXT1S_2;

As far as the line of code above, this sets the source for the clock
as the LVOCLK. I will not discuss more about this here, or your code
here, since this is a link thread :-P. i would recommend posting your
code on either this group, or the 43oh.com/forum/ and hopefully some
people will be able to discuss your code with you. :-) I will be
watching both places so I will help out a bit when I have time.
-----------------------------------------------------------------------------------------------------------

Bill

unread,
Aug 2, 2010, 11:52:30 AM8/2/10
to TI Launchpad
NJC,

Beretta's article makes a bit more sense to me after having done some
of this stuff hands on then re-reading it. the fact that the emulator
acts as an external source was really getting me confused.

I am still curious what limitations there are using internal timer
sources other than accuracy and why the ADC has to be read with the
cpu disabled.

On Aug 2, 11:36 am, Bill <landers.b...@gmail.com> wrote:
> Another thread [https://groups.google.com/group/ti-launchpad/browse_thread/thread/ebd...
> http://bill-landers.blogspot.com/2010/08/msp430-launchpad-low-power-t...
>
> most likely I have done some things poorly, but it seems to work
> correctly...
>
> From: NJC MSP430 LaunchPad Blog <nicholasjc...@gmail.com>
> Date: Mon, 2 Aug 2010 01:23:13 -0700 (PDT)
>
> Bill,http://mspsci.blogspot.com/2010/07/tutorial-08-beating-heart-bcs-part...

Beretta

unread,
Aug 2, 2010, 11:41:22 PM8/2/10
to TI Launchpad
I wish I could pause time for a couple weeks and get a few more
tutorial posts written up... unfortunately I have other obligations,
so it may be a while before I really get into the LPM's. Maybe NJC or
someone else will be able to get something done in that regard a
little sooner. For now, let me address the 'limit on useable lpm's
without the crystal'. It's true that you can't turn a crystal
oscillator off if you don't have a crystal. But then, without a
crystal you're not drawing power that way anyway. The LPM's do differ
in how much gets turned off, but putting in a crystal does not
necessarily mean you can operate with lower power. It would be
interesting to compare the power draw of the VLO to a crystal; I'm
really not sure which would be 'lower power'.

Also, I don't believe the CPU has to be disabled in order to use the
ADC. In fact, I'm almost certain of it, because I think one project
I've been working on doesn't use LPM's at all, just runs full power
constantly, and it reads four analog channels in the ADC. That's what
I'm remembering anyway, but I coded that up a while ago and I don't
have it right in front of me right now. I think you usually see an
LPM used when sampling ADCs because it's typical practice in the
MSP430 to minimize power consumption. (IE. when the ADC isn't
running, the uC isn't doing anything, so why not cut the power in the
mean time?)

NJC MSP430 LaunchPad Blog

unread,
Aug 3, 2010, 7:27:15 AM8/3/10
to TI Launchpad
Beretta is correct about the ADC, you do not need to have the CPU off
to read the value. Being able to read the ADC while the CPU is off is
a good thing to do if you can considering the CPU will take up power,
it is better to set the device into a low power mode than just
infinitely looping in main waiting for something to happen.

As far as the emulator acting as a clock source, I never really like
to do fool around in the emulator too much when I am debugging timing;
this might be difficult to do though if you do not have a logic
analyzer. I generally use the debugger to make sure certain values are
set correctly, to make sure the correct parts of the program are being
executed and to make sure my program is not stuck in a weird loop
somewhere. Breakpoints are your friend, I don't remember the last time
I had to step through code one line at a time.

I will generally be staying away from LPM discussions because I do not
want to provide information to anyone that I don't consider myself an
expert on (I use the term expert lightly). One thing you can count on
though, is that anything I post in my blog I understand completely. If
my project requires that I learn more about LPM and I understand them
well enough to write up a post about them, I will. Also it is hard to
really play with low power modes in a hands on fashion without a way
to measure microamps accurately, and I currently do not have a way to
do this.

Best luck with the low power modes. If you are looking for some
information on them I really recommend reading some of TI's
documentation on the topic. They do a real great job of providing
concise information on their hardware. Check the User Guides, the chip
datasheets, and I am sure they have an app note or two on the topic.

Hope that helped a bit. :-)

-NJC
________________________________
http://msp430launchpad.blogspot.com

Bill

unread,
Aug 7, 2010, 1:46:14 PM8/7/10
to TI Launchpad
@NJC

I don't have a whole lot of nice tools for this sort of work so I end
up having rely a fair bit on the debugger, but lesson learned all the
same.



@Beretta & @NJC

More reading and I understand what you are saying now and I can easily
leave the cpu on and loop when I bis_sr_register to wait for the ADC10
interrupt, so I guess my question should have been, why do you have to
wait for an interrupt to read the value? it seems if you do not wait
you always get 0 as a result, or have I missed something?



On Aug 3, 7:27 am, NJC MSP430 LaunchPad Blog <nicholasjc...@gmail.com>
wrote:
> ________________________________http://msp430launchpad.blogspot.com

Bill

unread,
Aug 7, 2010, 6:53:38 PM8/7/10
to TI Launchpad
Had some more time to look at this today, some more reading and
watching things in the debugger and I might have answered my own
question:

is the reason because the update of ADC10MEM is triggered by:

ADC10CTL0 |= ENC + ADC10SC

and is not instant, or the act of the ADC doing something is not, so
the value is not there until ADC10IFG = 1

so the interrupt is a convenience to avoid looping to wait for
ADC10IFG?

Beretta

unread,
Aug 7, 2010, 7:56:47 PM8/7/10
to TI Launchpad
I think that's essentially right-- the ADC10SC stands for "ADC10 Start
Conversions", so the ADC is by nature interrupt driven. There are
different ways to configure how the ADC converts: single values,
sequence of channels, etc. and the ADC10SC starts the process.
Reply all
Reply to author
Forward
0 new messages