Sign in

username:

password:



Not a member?

Search msp430



Search tips

Subscribe to msp430





Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | MSP430 | ADC periodic sampling

The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.

ADC periodic sampling - embedded2k - Aug 4 1:17:39 2009

I'm new to development in MSP430 series microcontrollers.

I'm designing for MSP430F248. The task is to periodically sample the data using ADC for every 2ms. The input is given to P6.0. Input to ADC is SMCLK with 2MHZ frequency.

It might take a while to actually test it. So I thought to better get an opinion from here on my approach.

I'm planning to use pulse sampling mode for sampling with the sample time tsample close to 2ms. And by using sequence of channels mode, I'll sample the data every 2ms and store it in the conversion memory sequentially. By setting EOS in the memory control register for ADC12MEM15, I can copy the data on receiving the interrupt when ADC12IFG15 bit is set. I'll retrigger the sequence similarly for every 16 data. It is to be noted that though I'm using sequence of channels I'm sampling the same channel all the sixteen times.

The reason why I'm using this approach instead of using a timer to trigger sampling using single channel single conversion is to AVOID CPU intervention. I'll be doing other tasks while this is in progress.
So I'm interrupted only once in 32ms.

Please let me know for any gaps in my approach. Any help is appreciated.
------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )


Re: ADC periodic sampling - embedded2k - Aug 9 9:32:40 2009

Awaiting some reply....
------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: Re: ADC periodic sampling - OneStone - Aug 9 12:34:34 2009

Well I guess instead of waiting your 5 days or more might have been
better spent trying it yourself. This is how learning occurs. Personally
I didn't see your original post, so it might have helped to have quoted
it here. In an effort to help i did take the time to look for it, only
to find that, as is usually the case, the answers can be found in the
user guide or previous posts. however kudos for at least studying the
manual enough to understand that you can trigger from the timer, can use
sequence of channels on a single channel and can then just interrupt
when 16 samples have been collected. So intrinsically there is nothing
flawed in what you are doing, except that it is probably totally
unnecessary. For me sequence of channels is best used when collecting
samples at a much faster rate, as it can become more critical to limit
CPU intervention, 2msecs is a monstrous amount of time for a
microcontroller, even a comparatively slow one like the MSP430, it could
easily collect a sample in a simple streamlined ISR every 2 msecs. There
is a slight overhead in doing this, as the CALL and RETI is repeated
more than with the 16 sequence method, but I doubt very much if your
foreground program is that busy that it can't spare the time to pop into
a very short collection routine, if it is then it needs to be rethought
anyway. You don't have to handle the data in the ISR, just collect it.
In practice it is probably better to do this than to use the sequence
method since this will keep the processor in the ISR for MUCH longer
while all 16 channels are collected, and that can be a bigger liability
overall.

Cheers

Al

embedded2k wrote:
> Awaiting some reply....
> ------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: Re: ADC periodic sampling - Chen Li - Aug 9 21:46:29 2009

here, Code examples from TI,

http://focus.ti.com/mcu/docs/mcuflashtools.tsp?sectionId=3D95&tabId=3D1538&=
familyId=3D342
=A0
i=A0code and debug=A0your idea, it works fine.

--- On Sun, 8/9/09, embedded2k wrote:
From: embedded2k
Subject: [msp430] Re: ADC periodic sampling
To: m...@yahoogroups.com
Date: Sunday, August 9, 2009, 1:31 PM
=A0=20

Awaiting some reply....
=20=20=20=20=20=20

[Non-text portions of this message have been removed]

------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: ADC periodic sampling - embedded2k - Aug 12 0:46:43 2009

--- In m...@yahoogroups.com, OneStone wrote:
>
> Well I guess instead of waiting your 5 days or more might have been
> better spent trying it yourself. This is how learning occurs. Personally
> I didn't see your original post, so it might have helped to have quoted
> it here. In an effort to help i did take the time to look for it, only
> to find that, as is usually the case, the answers can be found in the
> user guide or previous posts. however kudos for at least studying the
> manual enough to understand that you can trigger from the timer, can use
> sequence of channels on a single channel and can then just interrupt
> when 16 samples have been collected. So intrinsically there is nothing
> flawed in what you are doing, except that it is probably totally
> unnecessary. For me sequence of channels is best used when collecting
> samples at a much faster rate, as it can become more critical to limit
> CPU intervention, 2msecs is a monstrous amount of time for a
> microcontroller, even a comparatively slow one like the MSP430, it could
> easily collect a sample in a simple streamlined ISR every 2 msecs. There
> is a slight overhead in doing this, as the CALL and RETI is repeated
> more than with the 16 sequence method, but I doubt very much if your
> foreground program is that busy that it can't spare the time to pop into
> a very short collection routine, if it is then it needs to be rethought
> anyway. You don't have to handle the data in the ISR, just collect it.
> In practice it is probably better to do this than to use the sequence
> method since this will keep the processor in the ISR for MUCH longer
> while all 16 channels are collected, and that can be a bigger liability
> overall.
>
> Cheers
>
> Al
>
> embedded2k wrote:
> > Awaiting some reply....
> >
> >
> >
> >
> > ------------------------------------
> >
> >
> >
> >

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: ADC periodic sampling - embedded2k - Aug 12 0:48:53 2009

--- In m...@yahoogroups.com, Chen Li wrote:
>
> here, Code examples from TI,
>=20
> http://focus.ti.com/mcu/docs/mcuflashtools.tsp?sectionId=3D95&tabId=3D153=
8&familyId=3D342
> =A0
> i=A0code and debug=A0your idea, it works fine.
>=20
> --- On Sun, 8/9/09, embedded2k wrote:
>=20
>=20
> From: embedded2k
> Subject: [msp430] Re: ADC periodic sampling
> To: m...@yahoogroups.com
> Date: Sunday, August 9, 2009, 1:31 PM
>=20
>=20
> =A0=20
>=20
>=20
>=20
> Awaiting some reply....
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20=20=20=20=20=20=20
>=20
> [Non-text portions of this message have been removed]
>

Thanks Chen! I had the source developed and was able to test it. It worked.

------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )