Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
How to measure 50Hz DC voltage with ATD - "matthias.hildebrand" - Mar 4 16:34:53 2008
Hi everybody,
I have a voltage of 50Hz and I want to measure it with the ATD. It is
oscilating between 0 and 5 Volts.
Is there any possiblity given to do this?
Regards
Matthias

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to measure 50Hz DC voltage with ATD - BobG...@aol.com - Mar 4 17:33:19 2008
This is 'digital signal processing'. Take samples at a rate greater then twice the freq of
interest for at least one period of freq of interest. Now compute arithmetic avg of all
samples.
-----Original Message-----
From: matthias.hildebrand
To: 6...@yahoogroups.com
Sent: Tue, 4 Mar 2008 4:27 pm
Subject: [68HC12] How to measure 50Hz DC voltage with ATD
Hi everybody,
I have a voltage of 50Hz and I want to measure it with the ATD. It is
oscilating between 0 and 5 Volts.
Is there any possiblity given to do this?
Regards
Matthias

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to measure 50Hz DC voltage with ATD - "matthias.hildebrand" - Mar 4 19:09:40 2008
Hi
refering to the ATD manual the lowest sample rate with a prescaler of
0000 is (1kHz/3)*0.5=166Hz
I dont know if this calculation is correct, but it should work like in
this manner.
What do you mean with "compute arithmetic avg of all samples"? How
this couls be provided?
Thank you for your help
Matthias
--- In 6...@yahoogroups.com, BobGardner@... wrote:
>
> This is 'digital signal processing'. Take samples at a rate greater
then twice the freq of interest for at least one period of freq of
interest. Now compute arithmetic avg of all samples.
> -----Original Message-----
> From: matthias.hildebrand
> To: 6...@yahoogroups.com
> Sent: Tue, 4 Mar 2008 4:27 pm
> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
>
> Hi everybody,
>
> I have a voltage of 50Hz and I want to measure it with the ATD. It is
> oscilating between 0 and 5 Volts.
> Is there any possiblity given to do this?
>
> Regards
> Matthias
>
>
>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: Re: How to measure 50Hz DC voltage with ATD - BobG...@aol.com - Mar 4 23:14:06 2008
Wait a minute... you ask how to solve a programming problem, and I give you
a mathematical algorithm to solve your problem. Now you want help with the
mathematical algorithm. If you dont know how to compute an average, surely you
could find out with a google search. Maybe you should change majors to some
field that doesn't use computers or math?
In a message dated 3/4/2008 6:57:03 P.M. Eastern Standard Time,
z...@yahoo.de writes:
Hi
refering to the ATD manual the lowest sample rate with a prescaler of
0000 is (1kHz/3)*0.5=166Hz
I dont know if this calculation is correct, but it should work like in
this manner.
What do you mean with "compute arithmetic avg of all samples"? How
this couls be provided?
Thank you for your help
Matthias
--- In 6...@yahoogroups.com, BobGardner@... wrote:
>
> This is 'digital signal processing'. Take samples at a rate greater
then twice the freq of interest for at least one period of freq of
interest. Now compute arithmetic avg of all samples.
>
>
> -----Original Message-----
> From: matthias.hildebrand
> To: 6...@yahoogroups.com
> Sent: Tue, 4 Mar 2008 4:27 pm
> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
>
> Hi everybody,
>
> I have a voltage of 50Hz and I want to measure it with the ATD. It is
> oscilating between 0 and 5 Volts.
> Is there any possiblity given to do this?
>
> Regards
> Matthias
>
>
>
>
>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to measure 50Hz DC voltage with ATD - Edward Karpicz - Mar 5 2:37:16 2008
BobGardner@a wrote:
> This is 'digital signal processing'. Take samples at a rate greater then
> twice the freq of interest for at least one period of freq of interest.
> Now compute arithmetic avg of all samples.
and get DC offset, isn't it :-) ?
Edward
> -----Original Message-----
> From: matthias.hildebrand
> To: 6...@yahoogroups.com
> Sent: Tue, 4 Mar 2008 4:27 pm
> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
>
> Hi everybody,
>
> I have a voltage of 50Hz and I want to measure it with the ATD. It is
> oscilating between 0 and 5 Volts.
> Is there any possiblity given to do this?
>
> Regards
> Matthias
>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: Re: How to measure 50Hz DC voltage with ATD - Edward Karpicz - Mar 5 3:02:11 2008
Matthias wrote:
> Hi
> refering to the ATD manual the lowest sample rate with a prescaler of
> 0000 is (1kHz/3)*0.5=166Hz
Where did you get it from and what is 0000?
You may trigger conversion manually or using ATD trigger as rarely as wish.
Rate of back to back conversions is a function of A/D clock. Min A/D clock
is 500kHz. Max conversion time is 28 A/D clock cycles. Max sample time is
56us.
Edward
> I dont know if this calculation is correct, but it should work like in
> this manner.
> What do you mean with "compute arithmetic avg of all samples"? How
> this couls be provided?
>
> Thank you for your help
> Matthias
>
> --- In 6...@yahoogroups.com, BobGardner@... wrote:
>>
>> This is 'digital signal processing'. Take samples at a rate greater
> then twice the freq of interest for at least one period of freq of
> interest. Now compute arithmetic avg of all samples.
>> -----Original Message-----
>> From: matthias.hildebrand
>> To: 6...@yahoogroups.com
>> Sent: Tue, 4 Mar 2008 4:27 pm
>> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
>>
>> Hi everybody,
>>
>> I have a voltage of 50Hz and I want to measure it with the ATD. It is
>> oscilating between 0 and 5 Volts.
>> Is there any possiblity given to do this?
>>
>> Regards
>> Matthias
>>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to measure 50Hz DC voltage with ATD - Petrescu - Mar 5 4:44:22 2008
Hi,
It is possible, but you must take into considerations the followings:
50 Hz is only a value, stability matters for precision of your
measurement.
Maybe is wise to measure one period and divide it by the number of samples
to be taken and then sample the voltage with the interval resulted, you
need that.
The number of samples is also important if you want precision for your
measurement. It is also important because the average value of all samples
taken in one period gives you the DC value - in theory the average value of
one period of a sinus wave is 0 - in your case by simple averaging you get
the offset of your sine wave. To "measure" you can compute the effective
value (rms) of samples, over one period. The number of samples matters again
Try 64 or 128 samples per period, for instance.
Hope this will help you .
Regards,
Ioan
matthias.hildebrand wrote:
>
> Hi everybody,
>
> I have a voltage of 50Hz and I want to measure it with the ATD. It is
> oscilating between 0 and 5 Volts.
> Is there any possiblity given to do this?
>
> Regards
> Matthias
>
>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to measure 50Hz DC voltage with ATD - "matthias.hildebrand" - Mar 5 5:57:50 2008
Hi
I ve got the information of the ATD_10B8C Block User Guide. In the ATD
Control Register 4 (ATDCTL4)you define the prescaler value and the
sample time. I ve chosen the presclaer value as 0000 and 2 A/D
conversion clock periods.
ATDclock=([BusClock]/[PRS + 1])*0.5=1MHz*0.5=500kHz
I built the average of the samples with the above mentioned
configuration. Youre right. My sample rate is 500kHz. I made a mistake
in the calculation.
Because there is always a maximum and a minimum Bus Clock I cant be
sure about the sample rate. Or am I wrong?
For the maximum Id have
ATDclock=([BusClock]/[PRS + 1])*0.5=4MHz*0.5=2MHz
its fourth the minimum value.
Do I hav e to calculate with the maximum to be shure to measure at
least one Period?
Thank you for your help!
Cheers
Matthias
--- In 6...@yahoogroups.com, "Edward Karpicz"
wrote:
>
> Matthias wrote:
>
> > Hi
> > refering to the ATD manual the lowest sample rate with a prescaler of
> > 0000 is (1kHz/3)*0.5=166Hz
>
> Where did you get it from and what is 0000?
> You may trigger conversion manually or using ATD trigger as rarely
as wish.
> Rate of back to back conversions is a function of A/D clock. Min A/D
clock
> is 500kHz. Max conversion time is 28 A/D clock cycles. Max sample
time is
> 56us.
>
> Edward
> > I dont know if this calculation is correct, but it should work like in
> > this manner.
> > What do you mean with "compute arithmetic avg of all samples"? How
> > this couls be provided?
> >
> > Thank you for your help
> > Matthias
> >
> >
> >
> >
> >
> > --- In 6...@yahoogroups.com, BobGardner@ wrote:
> >>
> >> This is 'digital signal processing'. Take samples at a rate greater
> > then twice the freq of interest for at least one period of freq of
> > interest. Now compute arithmetic avg of all samples.
> >>
> >>
> >> -----Original Message-----
> >> From: matthias.hildebrand
> >> To: 6...@yahoogroups.com
> >> Sent: Tue, 4 Mar 2008 4:27 pm
> >> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
> >>
> >>
> >>
> >> Hi everybody,
> >>
> >> I have a voltage of 50Hz and I want to measure it with the ATD. It is
> >> oscilating between 0 and 5 Volts.
> >> Is there any possiblity given to do this?
> >>
> >> Regards
> >> Matthias
> >>
> >>
> >>
> >>
> >>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to measure 50Hz DC voltage with ATD - Edward Karpicz - Mar 5 7:51:53 2008
yeah, but I guess he doesn't want DC level but something better to
characterise his "voltage of 50Hz". Of course there's nothing wrong with
your answers.
Regards
Edward
BobGardner@a wrote:
> Well, Ed, he says his AC varies between 0 and 5V and he wants the DC
> level.... I'd call it 2.5V wouldn't you?
> ------------------------------------------------------------------------------
> --------------------------------------------------------------------------
>
> In a message dated 3/5/2008 2:34:10 A.M. Eastern Standard Time,
> k...@ar.fi.lt writes:
>
> BobGardner@a wrote:
>
>> This is 'digital signal processing'. Take samples at a rate greater then
>> twice the freq of interest for at least one period of freq of interest.
>> Now compute arithmetic avg of all samples.
>
> and get DC offset, isn't it :-) ?
>
> Edward
>> -----Original Message-----
>> From: matthias.hildebrand
>> To: 6...@yahoogroups.com
>> Sent: Tue, 4 Mar 2008 4:27 pm
>> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
>>
>> Hi everybody,
>>
>> I have a voltage of 50Hz and I want to measure it with the ATD. It is
>> oscilating between 0 and 5 Volts.
>> Is there any possiblity given to do this?
>>
>> Regards
>> Matthias
>> Yahoo! Groups Links
>> [Non-text portions of this message have been removed]
>> Yahoo! Groups Links
> Yahoo! Groups Links
> **************It's Tax Time! Get tips, forms, and advice on AOL Money &
> Finance. (http://money.aol.com/tax?NCID=aolprf00030000000001)
> [Non-text portions of this message have been removed]
>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to measure 50Hz DC voltage with ATD - BobG...@aol.com - Mar 5 7:51:57 2008
Well, Ed, he says his AC varies between 0 and 5V and he wants the DC
level.... I'd call it 2.5V wouldn't you?
------------------------------------------------------------------------------
--------------------------------------------------------------------------
In a message dated 3/5/2008 2:34:10 A.M. Eastern Standard Time,
k...@ar.fi.lt writes:
BobGardner@a wrote:
> This is 'digital signal processing'. Take samples at a rate greater then
> twice the freq of interest for at least one period of freq of interest.
> Now compute arithmetic avg of all samples.
and get DC offset, isn't it :-) ?
Edward
> -----Original Message-----
> From: matthias.hildebrand
> To: 6...@yahoogroups.com
> Sent: Tue, 4 Mar 2008 4:27 pm
> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
>
> Hi everybody,
>
> I have a voltage of 50Hz and I want to measure it with the ATD. It is
> oscilating between 0 and 5 Volts.
> Is there any possiblity given to do this?
>
> Regards
> Matthias
> Yahoo! Groups Links
> [Non-text portions of this message have been removed]
> Yahoo! Groups Links
Yahoo! Groups Links
**************It's Tax Time! Get tips, forms, and advice on AOL Money &
Finance. (http://money.aol.com/tax?NCID=aolprf00030000000001)
[Non-text portions of this message have been removed]

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: Re: How to measure 50Hz DC voltage with ATD - Edward Karpicz - Mar 5 7:52:38 2008
Normally you choose A/D prescaler so that you don't violate A/D specs for
min and max A/D clock frequency.
Suppose you are using PLL and get 25MHz bus clock. You have to divide it by
12.5 - 50 times to stay whithin the specs. You choose any of 14,16,18, ...
,48,50 prescalers. PRS=7,8,..25
A/D conversion time is the sum of 1) 2 A/D clocks + 2) sample time +3)
conversion time. Conversion time is 8 A/D clocks in 8bit mode and 10 A/D
clocks in 10bit mode. Sample time is specified by SMP bits in ATDCTL4. So in
10 bit mode you have 4 conversion time options: 14, 16, 20 and 28 A/D
clocks. If not clear then 14=2+2+10, 16=2+4+10, 20=2+8+10,28=2+16+10.
Edward
----- Original Message -----
From: "matthias.hildebrand"
To: <6...@yahoogroups.com>
Sent: Wednesday, March 05, 2008 12:45 PM
Subject: [68HC12] Re: How to measure 50Hz DC voltage with ATD
> Hi
>
> I ve got the information of the ATD_10B8C Block User Guide. In the ATD
> Control Register 4 (ATDCTL4)you define the prescaler value and the
> sample time. I ve chosen the presclaer value as 0000 and 2 A/D
> conversion clock periods.
> ATDclock=([BusClock]/[PRS + 1])*0.5=1MHz*0.5=500kHz
> I built the average of the samples with the above mentioned
> configuration. Youre right. My sample rate is 500kHz. I made a mistake
> in the calculation.
>
> Because there is always a maximum and a minimum Bus Clock I cant be
> sure about the sample rate. Or am I wrong?
> For the maximum Id have
> ATDclock=([BusClock]/[PRS + 1])*0.5=4MHz*0.5=2MHz
> its fourth the minimum value.
> Do I hav e to calculate with the maximum to be shure to measure at
> least one Period?
>
> Thank you for your help!
>
> Cheers
> Matthias
>
> --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
>>
>> Matthias wrote:
>>
>> > Hi
>> > refering to the ATD manual the lowest sample rate with a prescaler of
>> > 0000 is (1kHz/3)*0.5=166Hz
>>
>> Where did you get it from and what is 0000?
>> You may trigger conversion manually or using ATD trigger as rarely
> as wish.
>> Rate of back to back conversions is a function of A/D clock. Min A/D
> clock
>> is 500kHz. Max conversion time is 28 A/D clock cycles. Max sample
> time is
>> 56us.
>>
>> Edward
>> > I dont know if this calculation is correct, but it should work like in
>> > this manner.
>> > What do you mean with "compute arithmetic avg of all samples"? How
>> > this couls be provided?
>> >
>> > Thank you for your help
>> > Matthias
>> >
>> >
>> >
>> >
>> >
>> > --- In 6...@yahoogroups.com, BobGardner@ wrote:
>> >>
>> >> This is 'digital signal processing'. Take samples at a rate greater
>> > then twice the freq of interest for at least one period of freq of
>> > interest. Now compute arithmetic avg of all samples.
>> >>
>> >>
>> >> -----Original Message-----
>> >> From: matthias.hildebrand
>> >> To: 6...@yahoogroups.com
>> >> Sent: Tue, 4 Mar 2008 4:27 pm
>> >> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
>> >>
>> >>
>> >>
>> >> Hi everybody,
>> >>
>> >> I have a voltage of 50Hz and I want to measure it with the ATD. It is
>> >> oscilating between 0 and 5 Volts.
>> >> Is there any possiblity given to do this?
>> >>
>> >> Regards
>> >> Matthias
>> >>
>> >>
>> >>
>> >>
>> >>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to measure 50Hz DC voltage with ATD - "matthias.hildebrand" - Mar 5 11:05:43 2008
You are right. Sorry for beeing unprecise.
I have a oscillating DC signal between 0 and 5V. Amplitude and DC
offset are varying. The frequency is always about 50Hz.
No I would like to measure the mean.
Tomorrow i will have the possiblity to check if it works like I am
thinking now and than give you a feedback.
Thanks for help
Matthias
--- In 6...@yahoogroups.com, "Anders Friberg"
wrote:
> > -----Original Message-----
> > From: 6...@yahoogroups.com [mailto:6...@yahoogroups.com]
> > On Behalf Of matthias.hildebrand
> > Sent: Tuesday, March 04, 2008 10:28 PM
>
> >
> > I have a voltage of 50Hz and I want to measure it with the ATD. It is
> > oscilating between 0 and 5 Volts.
> > Is there any possiblity given to do this?
> > It is not clear what you need to do. The question is put in a way
that it
> can mean:
>
> "I want to:
> - measure the AC voltage in my sinusoidal signal with p-p max 0-5V
(value or
> P-P or DC offset value)
> - measure the PWM value of my binary 50 Hz signal
> - just verify that there is a signal
> - measure the exact frequency of my nominal 50 Hz input signal"
>
> The last is because you say "I have a signal that I know is 0-5V and a
> frequency that I know is 50 Hz and I want to measure it". One has to
guess
> what you mean.
>
> Regards,
> Anders
>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )RE: How to measure 50Hz DC voltage with ATD - Anders Friberg - Mar 5 11:57:12 2008
> -----Original Message-----
> From: 6...@yahoogroups.com [mailto:6...@yahoogroups.com]
> On Behalf Of matthias.hildebrand
> Sent: Tuesday, March 04, 2008 10:28 PM
>
> I have a voltage of 50Hz and I want to measure it with the ATD. It is
> oscilating between 0 and 5 Volts.
> Is there any possiblity given to do this?
>
It is not clear what you need to do. The question is put in a way that it
can mean:
"I want to:
- measure the AC voltage in my sinusoidal signal with p-p max 0-5V (value or
P-P or DC offset value)
- measure the PWM value of my binary 50 Hz signal
- just verify that there is a signal
- measure the exact frequency of my nominal 50 Hz input signal"
The last is because you say "I have a signal that I know is 0-5V and a
frequency that I know is 50 Hz and I want to measure it". One has to guess
what you mean.
Regards,
Anders

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: How to measure 50Hz DC voltage with ATD - "matthias.hildebrand" - Mar 5 15:21:14 2008
Thank you for your explanation.
Now I understand the calculation of the ATDclock. The thing I still
dont understand is how to know about the Bus Clock. You guessed a Bus
Clock of 25MHz. How do I know the Bus Clock in my case?
Is it possible to assure that a constant ATD Clock of 500kHz is used??
Thanks a lot
Matthias
--- In 6...@yahoogroups.com, "Edward Karpicz"
wrote:
>
> Normally you choose A/D prescaler so that you don't violate A/D
specs for
> min and max A/D clock frequency.
>
> Suppose you are using PLL and get 25MHz bus clock. You have to
divide it by
> 12.5 - 50 times to stay whithin the specs. You choose any of
14,16,18, ...
> ,48,50 prescalers. PRS=7,8,..25
>
> A/D conversion time is the sum of 1) 2 A/D clocks + 2) sample time +3)
> conversion time. Conversion time is 8 A/D clocks in 8bit mode and 10
A/D
> clocks in 10bit mode. Sample time is specified by SMP bits in
ATDCTL4. So in
> 10 bit mode you have 4 conversion time options: 14, 16, 20 and 28 A/D
> clocks. If not clear then 14=2+2+10, 16=2+4+10, 20=2+8+10,28=2+16+10.
>
> Edward
>
> ----- Original Message -----
> From: "matthias.hildebrand"
> To: <6...@yahoogroups.com>
> Sent: Wednesday, March 05, 2008 12:45 PM
> Subject: [68HC12] Re: How to measure 50Hz DC voltage with ATD
> > Hi
> >
> > I ve got the information of the ATD_10B8C Block User Guide. In the ATD
> > Control Register 4 (ATDCTL4)you define the prescaler value and the
> > sample time. I ve chosen the presclaer value as 0000 and 2 A/D
> > conversion clock periods.
> > ATDclock=([BusClock]/[PRS + 1])*0.5=1MHz*0.5=500kHz
> > I built the average of the samples with the above mentioned
> > configuration. Youre right. My sample rate is 500kHz. I made a mistake
> > in the calculation.
> >
> > Because there is always a maximum and a minimum Bus Clock I cant be
> > sure about the sample rate. Or am I wrong?
> > For the maximum Id have
> > ATDclock=([BusClock]/[PRS + 1])*0.5=4MHz*0.5=2MHz
> > its fourth the minimum value.
> > Do I hav e to calculate with the maximum to be shure to measure at
> > least one Period?
> >
> > Thank you for your help!
> >
> > Cheers
> > Matthias
> >
> >
> >
> >
> >
> > --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
> >>
> >> Matthias wrote:
> >>
> >> > Hi
> >> > refering to the ATD manual the lowest sample rate with a
prescaler of
> >> > 0000 is (1kHz/3)*0.5=166Hz
> >>
> >> Where did you get it from and what is 0000?
> >> You may trigger conversion manually or using ATD trigger as rarely
> > as wish.
> >> Rate of back to back conversions is a function of A/D clock. Min A/D
> > clock
> >> is 500kHz. Max conversion time is 28 A/D clock cycles. Max sample
> > time is
> >> 56us.
> >>
> >> Edward
> >>
> >>
> >> > I dont know if this calculation is correct, but it should work
like in
> >> > this manner.
> >> > What do you mean with "compute arithmetic avg of all samples"? How
> >> > this couls be provided?
> >> >
> >> > Thank you for your help
> >> > Matthias
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --- In 6...@yahoogroups.com, BobGardner@ wrote:
> >> >>
> >> >> This is 'digital signal processing'. Take samples at a rate
greater
> >> > then twice the freq of interest for at least one period of freq of
> >> > interest. Now compute arithmetic avg of all samples.
> >> >>
> >> >>
> >> >> -----Original Message-----
> >> >> From: matthias.hildebrand
> >> >> To: 6...@yahoogroups.com
> >> >> Sent: Tue, 4 Mar 2008 4:27 pm
> >> >> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
> >> >>
> >> >>
> >> >>
> >> >> Hi everybody,
> >> >>
> >> >> I have a voltage of 50Hz and I want to measure it with the
ATD. It is
> >> >> oscilating between 0 and 5 Volts.
> >> >> Is there any possiblity given to do this?
> >> >>
> >> >> Regards
> >> >> Matthias
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: Re: How to measure 50Hz DC voltage with ATD - Edward Karpicz - Mar 5 15:31:36 2008
If you didn't touch PLL registers, then bus clock is oscilator clock /2 .
Oscilator clock is what's written on crystal or oscilator.
Edward
----- Original Message -----
From: "matthias.hildebrand"
To: <6...@yahoogroups.com>
Sent: Wednesday, March 05, 2008 10:07 PM
Subject: [68HC12] Re: How to measure 50Hz DC voltage with ATD
> Thank you for your explanation.
> Now I understand the calculation of the ATDclock. The thing I still
> dont understand is how to know about the Bus Clock. You guessed a Bus
> Clock of 25MHz. How do I know the Bus Clock in my case?
> Is it possible to assure that a constant ATD Clock of 500kHz is used??
>
> Thanks a lot
> Matthias
>
> --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
>>
>> Normally you choose A/D prescaler so that you don't violate A/D
> specs for
>> min and max A/D clock frequency.
>>
>> Suppose you are using PLL and get 25MHz bus clock. You have to
> divide it by
>> 12.5 - 50 times to stay whithin the specs. You choose any of
> 14,16,18, ...
>> ,48,50 prescalers. PRS=7,8,..25
>>
>> A/D conversion time is the sum of 1) 2 A/D clocks + 2) sample time +3)
>> conversion time. Conversion time is 8 A/D clocks in 8bit mode and 10
> A/D
>> clocks in 10bit mode. Sample time is specified by SMP bits in
> ATDCTL4. So in
>> 10 bit mode you have 4 conversion time options: 14, 16, 20 and 28 A/D
>> clocks. If not clear then 14=2+2+10, 16=2+4+10, 20=2+8+10,28=2+16+10.
>>
>> Edward
>>
>> ----- Original Message -----
>> From: "matthias.hildebrand"
>> To: <6...@yahoogroups.com>
>> Sent: Wednesday, March 05, 2008 12:45 PM
>> Subject: [68HC12] Re: How to measure 50Hz DC voltage with ATD
>> > Hi
>> >
>> > I ve got the information of the ATD_10B8C Block User Guide. In the ATD
>> > Control Register 4 (ATDCTL4)you define the prescaler value and the
>> > sample time. I ve chosen the presclaer value as 0000 and 2 A/D
>> > conversion clock periods.
>> > ATDclock=([BusClock]/[PRS + 1])*0.5=1MHz*0.5=500kHz
>> > I built the average of the samples with the above mentioned
>> > configuration. Youre right. My sample rate is 500kHz. I made a mistake
>> > in the calculation.
>> >
>> > Because there is always a maximum and a minimum Bus Clock I cant be
>> > sure about the sample rate. Or am I wrong?
>> > For the maximum Id have
>> > ATDclock=([BusClock]/[PRS + 1])*0.5=4MHz*0.5=2MHz
>> > its fourth the minimum value.
>> > Do I hav e to calculate with the maximum to be shure to measure at
>> > least one Period?
>> >
>> > Thank you for your help!
>> >
>> > Cheers
>> > Matthias
>> >
>> >
>> >
>> >
>> >
>> > --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
>> >>
>> >> Matthias wrote:
>> >>
>> >> > Hi
>> >> > refering to the ATD manual the lowest sample rate with a
> prescaler of
>> >> > 0000 is (1kHz/3)*0.5=166Hz
>> >>
>> >> Where did you get it from and what is 0000?
>> >> You may trigger conversion manually or using ATD trigger as rarely
>> > as wish.
>> >> Rate of back to back conversions is a function of A/D clock. Min A/D
>> > clock
>> >> is 500kHz. Max conversion time is 28 A/D clock cycles. Max sample
>> > time is
>> >> 56us.
>> >>
>> >> Edward
>> >>
>> >>
>> >> > I dont know if this calculation is correct, but it should work
> like in
>> >> > this manner.
>> >> > What do you mean with "compute arithmetic avg of all samples"? How
>> >> > this couls be provided?
>> >> >
>> >> > Thank you for your help
>> >> > Matthias
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --- In 6...@yahoogroups.com, BobGardner@ wrote:
>> >> >>
>> >> >> This is 'digital signal processing'. Take samples at a rate
> greater
>> >> > then twice the freq of interest for at least one period of freq of
>> >> > interest. Now compute arithmetic avg of all samples.
>> >> >>
>> >> >>
>> >> >> -----Original Message-----
>> >> >> From: matthias.hildebrand
>> >> >> To: 6...@yahoogroups.com
>> >> >> Sent: Tue, 4 Mar 2008 4:27 pm
>> >> >> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
>> >> >>
>> >> >>
>> >> >>
>> >> >> Hi everybody,
>> >> >>
>> >> >> I have a voltage of 50Hz and I want to measure it with the
> ATD. It is
>> >> >> oscilating between 0 and 5 Volts.
>> >> >> Is there any possiblity given to do this?
>> >> >>
>> >> >> Regards
>> >> >> Matthias
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to measure 50Hz DC voltage with ATD - "matthias.hildebrand" - Mar 6 6:03:23 2008
Thank you very much! I think (hope?) that now everything is clear.
Cheers
Matthias
--- In 6...@yahoogroups.com, "Edward Karpicz"
wrote:
>
> If you didn't touch PLL registers, then bus clock is oscilator clock
/2 .
> Oscilator clock is what's written on crystal or oscilator.
>
> Edward
>
> ----- Original Message -----
> From: "matthias.hildebrand"
> To: <6...@yahoogroups.com>
> Sent: Wednesday, March 05, 2008 10:07 PM
> Subject: [68HC12] Re: How to measure 50Hz DC voltage with ATD
> > Thank you for your explanation.
> > Now I understand the calculation of the ATDclock. The thing I still
> > dont understand is how to know about the Bus Clock. You guessed a Bus
> > Clock of 25MHz. How do I know the Bus Clock in my case?
> > Is it possible to assure that a constant ATD Clock of 500kHz is used??
> >
> > Thanks a lot
> > Matthias
> >
> >
> >
> > --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
> >>
> >> Normally you choose A/D prescaler so that you don't violate A/D
> > specs for
> >> min and max A/D clock frequency.
> >>
> >> Suppose you are using PLL and get 25MHz bus clock. You have to
> > divide it by
> >> 12.5 - 50 times to stay whithin the specs. You choose any of
> > 14,16,18, ...
> >> ,48,50 prescalers. PRS=7,8,..25
> >>
> >> A/D conversion time is the sum of 1) 2 A/D clocks + 2) sample
time +3)
> >> conversion time. Conversion time is 8 A/D clocks in 8bit mode and 10
> > A/D
> >> clocks in 10bit mode. Sample time is specified by SMP bits in
> > ATDCTL4. So in
> >> 10 bit mode you have 4 conversion time options: 14, 16, 20 and 28 A/D
> >> clocks. If not clear then 14=2+2+10, 16=2+4+10, 20=2+8+10,28=2+16+10.
> >>
> >> Edward
> >>
> >> ----- Original Message -----
> >> From: "matthias.hildebrand"
> >> To: <6...@yahoogroups.com>
> >> Sent: Wednesday, March 05, 2008 12:45 PM
> >> Subject: [68HC12] Re: How to measure 50Hz DC voltage with ATD
> >>
> >>
> >> > Hi
> >> >
> >> > I ve got the information of the ATD_10B8C Block User Guide. In
the ATD
> >> > Control Register 4 (ATDCTL4)you define the prescaler value and the
> >> > sample time. I ve chosen the presclaer value as 0000 and 2 A/D
> >> > conversion clock periods.
> >> > ATDclock=([BusClock]/[PRS + 1])*0.5=1MHz*0.5=500kHz
> >> > I built the average of the samples with the above mentioned
> >> > configuration. Youre right. My sample rate is 500kHz. I made a
mistake
> >> > in the calculation.
> >> >
> >> > Because there is always a maximum and a minimum Bus Clock I cant be
> >> > sure about the sample rate. Or am I wrong?
> >> > For the maximum Id have
> >> > ATDclock=([BusClock]/[PRS + 1])*0.5=4MHz*0.5=2MHz
> >> > its fourth the minimum value.
> >> > Do I hav e to calculate with the maximum to be shure to measure at
> >> > least one Period?
> >> >
> >> > Thank you for your help!
> >> >
> >> > Cheers
> >> > Matthias
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
> >> >>
> >> >> Matthias wrote:
> >> >>
> >> >> > Hi
> >> >> > refering to the ATD manual the lowest sample rate with a
> > prescaler of
> >> >> > 0000 is (1kHz/3)*0.5=166Hz
> >> >>
> >> >> Where did you get it from and what is 0000?
> >> >> You may trigger conversion manually or using ATD trigger as rarely
> >> > as wish.
> >> >> Rate of back to back conversions is a function of A/D clock.
Min A/D
> >> > clock
> >> >> is 500kHz. Max conversion time is 28 A/D clock cycles. Max sample
> >> > time is
> >> >> 56us.
> >> >>
> >> >> Edward
> >> >>
> >> >>
> >> >> > I dont know if this calculation is correct, but it should work
> > like in
> >> >> > this manner.
> >> >> > What do you mean with "compute arithmetic avg of all
samples"? How
> >> >> > this couls be provided?
> >> >> >
> >> >> > Thank you for your help
> >> >> > Matthias
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > --- In 6...@yahoogroups.com, BobGardner@ wrote:
> >> >> >>
> >> >> >> This is 'digital signal processing'. Take samples at a rate
> > greater
> >> >> > then twice the freq of interest for at least one period of
freq of
> >> >> > interest. Now compute arithmetic avg of all samples.
> >> >> >>
> >> >> >>
> >> >> >> -----Original Message-----
> >> >> >> From: matthias.hildebrand
> >> >> >> To: 6...@yahoogroups.com
> >> >> >> Sent: Tue, 4 Mar 2008 4:27 pm
> >> >> >> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> Hi everybody,
> >> >> >>
> >> >> >> I have a voltage of 50Hz and I want to measure it with the
> > ATD. It is
> >> >> >> oscilating between 0 and 5 Volts.
> >> >> >> Is there any possiblity given to do this?
> >> >> >>
> >> >> >> Regards
> >> >> >> Matthias
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to measure 50Hz DC voltage with ATD - "matthias.hildebrand" - Mar 6 10:36:48 2008
Today I tested the programm. It works very well. Thanks a lot for all
your help! Its just a little bit slow, but I think that I have to live
with this little problem.
Cheer
Matthias
--- In 6...@yahoogroups.com, "matthias.hildebrand"
wrote:
>
> Thank you very much! I think (hope?) that now everything is clear.
>
> Cheers
> Matthias
>
> --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
> >
> > If you didn't touch PLL registers, then bus clock is oscilator clock
> /2 .
> > Oscilator clock is what's written on crystal or oscilator.
> >
> > Edward
> >
> > ----- Original Message -----
> > From: "matthias.hildebrand"
> > To: <6...@yahoogroups.com>
> > Sent: Wednesday, March 05, 2008 10:07 PM
> > Subject: [68HC12] Re: How to measure 50Hz DC voltage with ATD
> >
> >
> > > Thank you for your explanation.
> > > Now I understand the calculation of the ATDclock. The thing I still
> > > dont understand is how to know about the Bus Clock. You guessed
a Bus
> > > Clock of 25MHz. How do I know the Bus Clock in my case?
> > > Is it possible to assure that a constant ATD Clock of 500kHz is
used??
> > >
> > > Thanks a lot
> > > Matthias
> > >
> > >
> > >
> > > --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
> > >>
> > >> Normally you choose A/D prescaler so that you don't violate A/D
> > > specs for
> > >> min and max A/D clock frequency.
> > >>
> > >> Suppose you are using PLL and get 25MHz bus clock. You have to
> > > divide it by
> > >> 12.5 - 50 times to stay whithin the specs. You choose any of
> > > 14,16,18, ...
> > >> ,48,50 prescalers. PRS=7,8,..25
> > >>
> > >> A/D conversion time is the sum of 1) 2 A/D clocks + 2) sample
> time +3)
> > >> conversion time. Conversion time is 8 A/D clocks in 8bit mode
and 10
> > > A/D
> > >> clocks in 10bit mode. Sample time is specified by SMP bits in
> > > ATDCTL4. So in
> > >> 10 bit mode you have 4 conversion time options: 14, 16, 20 and
28 A/D
> > >> clocks. If not clear then 14=2+2+10, 16=2+4+10,
20=2+8+10,28=2+16+10.
> > >>
> > >> Edward
> > >>
> > >> ----- Original Message -----
> > >> From: "matthias.hildebrand"
> > >> To: <6...@yahoogroups.com>
> > >> Sent: Wednesday, March 05, 2008 12:45 PM
> > >> Subject: [68HC12] Re: How to measure 50Hz DC voltage with ATD
> > >>
> > >>
> > >> > Hi
> > >> >
> > >> > I ve got the information of the ATD_10B8C Block User Guide. In
> the ATD
> > >> > Control Register 4 (ATDCTL4)you define the prescaler value
and the
> > >> > sample time. I ve chosen the presclaer value as 0000 and 2 A/D
> > >> > conversion clock periods.
> > >> > ATDclock=([BusClock]/[PRS + 1])*0.5=1MHz*0.5=500kHz
> > >> > I built the average of the samples with the above mentioned
> > >> > configuration. Youre right. My sample rate is 500kHz. I made a
> mistake
> > >> > in the calculation.
> > >> >
> > >> > Because there is always a maximum and a minimum Bus Clock I
cant be
> > >> > sure about the sample rate. Or am I wrong?
> > >> > For the maximum Id have
> > >> > ATDclock=([BusClock]/[PRS + 1])*0.5=4MHz*0.5=2MHz
> > >> > its fourth the minimum value.
> > >> > Do I hav e to calculate with the maximum to be shure to
measure at
> > >> > least one Period?
> > >> >
> > >> > Thank you for your help!
> > >> >
> > >> > Cheers
> > >> > Matthias
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
> > >> >>
> > >> >> Matthias wrote:
> > >> >>
> > >> >> > Hi
> > >> >> > refering to the ATD manual the lowest sample rate with a
> > > prescaler of
> > >> >> > 0000 is (1kHz/3)*0.5=166Hz
> > >> >>
> > >> >> Where did you get it from and what is 0000?
> > >> >> You may trigger conversion manually or using ATD trigger as
rarely
> > >> > as wish.
> > >> >> Rate of back to back conversions is a function of A/D clock.
> Min A/D
> > >> > clock
> > >> >> is 500kHz. Max conversion time is 28 A/D clock cycles. Max
sample
> > >> > time is
> > >> >> 56us.
> > >> >>
> > >> >> Edward
> > >> >>
> > >> >>
> > >> >> > I dont know if this calculation is correct, but it should work
> > > like in
> > >> >> > this manner.
> > >> >> > What do you mean with "compute arithmetic avg of all
> samples"? How
> > >> >> > this couls be provided?
> > >> >> >
> > >> >> > Thank you for your help
> > >> >> > Matthias
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> > --- In 6...@yahoogroups.com, BobGardner@ wrote:
> > >> >> >>
> > >> >> >> This is 'digital signal processing'. Take samples at a rate
> > > greater
> > >> >> > then twice the freq of interest for at least one period of
> freq of
> > >> >> > interest. Now compute arithmetic avg of all samples.
> > >> >> >>
> > >> >> >>
> > >> >> >> -----Original Message-----
> > >> >> >> From: matthias.hildebrand
> > >> >> >> To: 6...@yahoogroups.com
> > >> >> >> Sent: Tue, 4 Mar 2008 4:27 pm
> > >> >> >> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
> > >> >> >>
> > >> >> >>
> > >> >> >>
> > >> >> >> Hi everybody,
> > >> >> >>
> > >> >> >> I have a voltage of 50Hz and I want to measure it with the
> > > ATD. It is
> > >> >> >> oscilating between 0 and 5 Volts.
> > >> >> >> Is there any possiblity given to do this?
> > >> >> >>
> > >> >> >> Regards
> > >> >> >> Matthias
> > >> >> >>
> > >> >> >>
> > >> >> >>
> > >> >> >>
> > >> >> >>

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: How to measure 50Hz DC voltage with ATD - "matthias.hildebrand" - Mar 25 17:33:46 2008
Made a mistake. The oscillator clock has 8MHz , the prescaler is 1 and
thus the ATD clock 2MHz
--- In 6...@yahoogroups.com, "matthias.hildebrand"
wrote:
>
> Hi,
>
> again I have got another question. I am measuring 2 samples by setting
> the "multi" bit to 1. How does conversion time increase?? I think the
> it wont just be twice the single conversion time.
> My oscillaterclock has 8MHz, the total conversion time 4 cycles and
> the resolution 10 bit.
> what would it be for two channels?? Is the total conversion time
> processed twice, or once?
>
> 8MHz/(4+10+10) - once
> or 8MHz (4+10+4+10)- twice
>
> Cheers
> Matthias
>
> --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
> >
> > Normally you choose A/D prescaler so that you don't violate A/D
> specs for
> > min and max A/D clock frequency.
> >
> > Suppose you are using PLL and get 25MHz bus clock. You have to
> divide it by
> > 12.5 - 50 times to stay whithin the specs. You choose any of
> 14,16,18, ...
> > ,48,50 prescalers. PRS=7,8,..25
> >
> > A/D conversion time is the sum of 1) 2 A/D clocks + 2) sample
time +3)
> > conversion time. Conversion time is 8 A/D clocks in 8bit mode and 10
> A/D
> > clocks in 10bit mode. Sample time is specified by SMP bits in
> ATDCTL4. So in
> > 10 bit mode you have 4 conversion time options: 14, 16, 20 and 28 A/D
> > clocks. If not clear then 14=2+2+10, 16=2+4+10, 20=2+8+10,28=2+16+10.
> >
> > Edward
> >
> > ----- Original Message -----
> > From: "matthias.hildebrand"
> > To: <6...@yahoogroups.com>
> > Sent: Wednesday, March 05, 2008 12:45 PM
> > Subject: [68HC12] Re: How to measure 50Hz DC voltage with ATD
> >
> >
> > > Hi
> > >
> > > I ve got the information of the ATD_10B8C Block User Guide. In
the ATD
> > > Control Register 4 (ATDCTL4)you define the prescaler value and the
> > > sample time. I ve chosen the presclaer value as 0000 and 2 A/D
> > > conversion clock periods.
> > > ATDclock=([BusClock]/[PRS + 1])*0.5=1MHz*0.5=500kHz
> > > I built the average of the samples with the above mentioned
> > > configuration. Youre right. My sample rate is 500kHz. I made a
mistake
> > > in the calculation.
> > >
> > > Because there is always a maximum and a minimum Bus Clock I cant be
> > > sure about the sample rate. Or am I wrong?
> > > For the maximum Id have
> > > ATDclock=([BusClock]/[PRS + 1])*0.5=4MHz*0.5=2MHz
> > > its fourth the minimum value.
> > > Do I hav e to calculate with the maximum to be shure to measure at
> > > least one Period?
> > >
> > > Thank you for your help!
> > >
> > > Cheers
> > > Matthias
> > >
> > >
> > >
> > >
> > >
> > > --- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
> > >>
> > >> Matthias wrote:
> > >>
> > >> > Hi
> > >> > refering to the ATD manual the lowest sample rate with a
> prescaler of
> > >> > 0000 is (1kHz/3)*0.5=166Hz
> > >>
> > >> Where did you get it from and what is 0000?
> > >> You may trigger conversion manually or using ATD trigger as rarely
> > > as wish.
> > >> Rate of back to back conversions is a function of A/D clock.
Min A/D
> > > clock
> > >> is 500kHz. Max conversion time is 28 A/D clock cycles. Max sample
> > > time is
> > >> 56us.
> > >>
> > >> Edward
> > >>
> > >>
> > >> > I dont know if this calculation is correct, but it should work
> like in
> > >> > this manner.
> > >> > What do you mean with "compute arithmetic avg of all
samples"? How
> > >> > this couls be provided?
> > >> >
> > >> > Thank you for your help
> > >> > Matthias
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > --- In 6...@yahoogroups.com, BobGardner@ wrote:
> > >> >>
> > >> >> This is 'digital signal processing'. Take samples at a rate
> greater
> > >> > then twice the freq of interest for at least one period of
freq of
> > >> > interest. Now compute arithmetic avg of all samples.
> > >> >>
> > >> >>
> > >> >> -----Original Message-----
> > >> >> From: matthias.hildebrand
> > >> >> To: 6...@yahoogroups.com
> > >> >> Sent: Tue, 4 Mar 2008 4:27 pm
> > >> >> Subject: [68HC12] How to measure 50Hz DC voltage with ATD
> > >> >>
> > >> >>
> > >> >>
> > >> >> Hi everybody,
> > >> >>
> > >> >> I have a voltage of 50Hz and I want to measure it with the
> ATD. It is
> > >> >> oscilating between 0 and 5 Volts.
> > >> >> Is there any possiblity given to do this?
> > >> >>
> > >> >> Regards
> > >> >> Matthias
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >>

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