Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #371873 > unrolled thread

Microcontroller phase locked loop, ping Tim Wescott et. al.

Started bybitrex <bitrex@de.lete.earthlink.net>
First post2015-08-06 13:12 -0400
Last post2015-08-06 15:10 -0400
Articles 8 on this page of 28 — 9 participants

Back to article view | Back to sci.electronics.design


Contents

  Microcontroller phase locked loop, ping Tim Wescott et. al. bitrex <bitrex@de.lete.earthlink.net> - 2015-08-06 13:12 -0400
    Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2015-08-06 13:57 -0400
      Re: Microcontroller phase locked loop, ping Tim Wescott et. al. bitrex <bitrex@de.lete.earthlink.net> - 2015-08-06 14:19 -0400
        Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Phil Hobbs <hobbs@electrooptical.net> - 2015-08-06 14:25 -0400
          Re: Microcontroller phase locked loop, ping Tim Wescott et. al. bitrex <bitrex@de.lete.earthlink.net> - 2015-08-06 15:09 -0400
            Re: Microcontroller phase locked loop, ping Tim Wescott et. al. upsidedown@downunder.com - 2015-08-06 22:38 +0300
            Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2015-08-06 16:34 -0400
              Re: Microcontroller phase locked loop, ping Tim Wescott et. al. bitrex <bitrex@de.lete.earthlink.net> - 2015-08-06 18:20 -0400
            Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Tim Wescott <seemywebsite@myfooter.really> - 2015-08-06 15:48 -0500
        Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Tim Wescott <seemywebsite@myfooter.really> - 2015-08-06 14:02 -0500
          Re: Microcontroller phase locked loop, ping Tim Wescott et. al. bitrex <bitrex@de.lete.earthlink.net> - 2015-08-06 15:15 -0400
            Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Tim Wescott <tim@seemywebsite.com> - 2015-08-06 15:04 -0500
        Re: Microcontroller phase locked loop, ping Tim Wescott et. al. piglet <erichpwagner@hotmail.com> - 2015-08-06 20:23 +0100
          Re: Microcontroller phase locked loop, ping Tim Wescott et. al. bitrex <bitrex@de.lete.earthlink.net> - 2015-08-06 16:04 -0400
          Re: Microcontroller phase locked loop, ping Tim Wescott et. al. bitrex <bitrex@de.lete.earthlink.net> - 2015-08-06 16:06 -0400
      Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2015-08-06 11:19 -0700
        Re: Microcontroller phase locked loop, ping Tim Wescott et. al. DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2015-08-06 14:22 -0400
        Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Phil Hobbs <hobbs@electrooptical.net> - 2015-08-06 14:26 -0400
        Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Tim Wescott <seemywebsite@myfooter.really> - 2015-08-06 14:04 -0500
          Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Phil Hobbs <hobbs@electrooptical.net> - 2015-08-06 16:13 -0400
        Re: Microcontroller phase locked loop, ping Tim Wescott et. al. upsidedown@downunder.com - 2015-08-06 22:48 +0300
          Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Phil Hobbs <hobbs@electrooptical.net> - 2015-08-06 16:14 -0400
            Re: Microcontroller phase locked loop, ping Tim Wescott et. al. upsidedown@downunder.com - 2015-08-06 23:58 +0300
              Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2015-08-06 17:13 -0400
                Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Tim Wescott <seemywebsite@myfooter.really> - 2015-08-06 17:40 -0500
                  Re: Microcontroller phase locked loop, ping Tim Wescott et. al. upsidedown@downunder.com - 2015-08-09 12:18 +0300
    Re: Microcontroller phase locked loop, ping Tim Wescott et. al. Tim Wescott <seemywebsite@myfooter.really> - 2015-08-06 13:30 -0500
      Re: Microcontroller phase locked loop, ping Tim Wescott et. al. bitrex <bitrex@de.lete.earthlink.net> - 2015-08-06 15:10 -0400

Page 2 of 2 — ← Prev page 1 [2]


#371894

Fromupsidedown@downunder.com
Date2015-08-06 22:48 +0300
Message-ID<86e7sals26g209bj9rehe105b0uj5lrglk@4ax.com>
In reply to#371877
On Thu, 06 Aug 2015 11:19:55 -0700, Jim Thompson
<To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:

>On Thu, 06 Aug 2015 13:57:03 -0400, Phil Hobbs
><pcdhSpamMeSenseless@electrooptical.net> wrote:
>
>>On 8/6/2015 1:12 PM, bitrex wrote:
>>> Has anyone successfully implemented a phase locked loop on a
>>> microcontroller?
>>>
>>> The frequency of interest would be somewhere in the 200kHz range, and
>>> the objective of the PLL would be FM demodulation.  So I'd have an input
>>> for the FM modulated frequency, and an external VCO in that range that
>>> the uC would hopefully control via filtered PWM.  Other than that, this
>>> is mostly hypothetical for now.
>>>
>>> Does this seem possible?  I have the following reference:
>>>
>>> http://liquidsdr.org/blog/pll-howto/
>>>
>>> I'd be hoping to use something like an ATTiny.  All code would be
>>> adjusted to use fixed-point math, I'd imagine.
>>
>>For a given resolution, you might as well just use a counter input.
>>
>>It's not going to be a very good demodulator...what modulation frequency 
>>and modulation index are you looking to accommodate?
>>
>>Cheers
>>
>>Phil Hobbs
>
>Awwwh, shucks, Phil, Don't you know that the solution for all analog
>problems is a uP ?>:-}
>		
>                                        ...Jim Thompson

Get away with the VCOs and do it with NCOs and you can do FM, PM and
AM quite easily. No need for PLLs or phase detectors. Of course the uP
must handle about 500 kHz interrupt rate :-).

[toc] | [prev] | [next] | [standalone]


#371900

FromPhil Hobbs <hobbs@electrooptical.net>
Date2015-08-06 16:14 -0400
Message-ID<55C3C040.50707@electrooptical.net>
In reply to#371894
On 8/6/2015 3:48 PM, upsidedown@downunder.com wrote:
> On Thu, 06 Aug 2015 11:19:55 -0700, Jim Thompson
> <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:
>
>> On Thu, 06 Aug 2015 13:57:03 -0400, Phil Hobbs
>> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>>
>>> On 8/6/2015 1:12 PM, bitrex wrote:
>>>> Has anyone successfully implemented a phase locked loop on a
>>>> microcontroller?
>>>>
>>>> The frequency of interest would be somewhere in the 200kHz range, and
>>>> the objective of the PLL would be FM demodulation.  So I'd have an input
>>>> for the FM modulated frequency, and an external VCO in that range that
>>>> the uC would hopefully control via filtered PWM.  Other than that, this
>>>> is mostly hypothetical for now.
>>>>
>>>> Does this seem possible?  I have the following reference:
>>>>
>>>> http://liquidsdr.org/blog/pll-howto/
>>>>
>>>> I'd be hoping to use something like an ATTiny.  All code would be
>>>> adjusted to use fixed-point math, I'd imagine.
>>>
>>> For a given resolution, you might as well just use a counter input.
>>>
>>> It's not going to be a very good demodulator...what modulation frequency
>>> and modulation index are you looking to accommodate?
>>>
>>> Cheers
>>>
>>> Phil Hobbs
>>
>> Awwwh, shucks, Phil, Don't you know that the solution for all analog
>> problems is a uP ?>:-}
>> 		
>>                                         ...Jim Thompson
>
> Get away with the VCOs and do it with NCOs and you can do FM, PM and
> AM quite easily. No need for PLLs or phase detectors. Of course the uP
> must handle about 500 kHz interrupt rate :-).
>

Pretty slow PLL if you can do it at that rate.  Of course not every 
application needs good performance--if all you care about is not losing 
count, digital is great.

Cheers

Phil Hobbs

-- 
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510

hobbs at electrooptical dot net
http://electrooptical.net

[toc] | [prev] | [next] | [standalone]


#371907

Fromupsidedown@downunder.com
Date2015-08-06 23:58 +0300
Message-ID<kgi7sah7l8v0eo0n15us7jlt9msr8ldqoi@4ax.com>
In reply to#371900
On Thu, 06 Aug 2015 16:14:56 -0400, Phil Hobbs
<hobbs@electrooptical.net> wrote:

>On 8/6/2015 3:48 PM, upsidedown@downunder.com wrote:
>> On Thu, 06 Aug 2015 11:19:55 -0700, Jim Thompson
>> <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:
>>
>>> On Thu, 06 Aug 2015 13:57:03 -0400, Phil Hobbs
>>> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>>>
>>>> On 8/6/2015 1:12 PM, bitrex wrote:
>>>>> Has anyone successfully implemented a phase locked loop on a
>>>>> microcontroller?
>>>>>
>>>>> The frequency of interest would be somewhere in the 200kHz range, and
>>>>> the objective of the PLL would be FM demodulation.  So I'd have an input
>>>>> for the FM modulated frequency, and an external VCO in that range that
>>>>> the uC would hopefully control via filtered PWM.  Other than that, this
>>>>> is mostly hypothetical for now.
>>>>>
>>>>> Does this seem possible?  I have the following reference:
>>>>>
>>>>> http://liquidsdr.org/blog/pll-howto/
>>>>>
>>>>> I'd be hoping to use something like an ATTiny.  All code would be
>>>>> adjusted to use fixed-point math, I'd imagine.
>>>>
>>>> For a given resolution, you might as well just use a counter input.
>>>>
>>>> It's not going to be a very good demodulator...what modulation frequency
>>>> and modulation index are you looking to accommodate?
>>>>
>>>> Cheers
>>>>
>>>> Phil Hobbs
>>>
>>> Awwwh, shucks, Phil, Don't you know that the solution for all analog
>>> problems is a uP ?>:-}
>>> 		
>>>                                         ...Jim Thompson
>>
>> Get away with the VCOs and do it with NCOs and you can do FM, PM and
>> AM quite easily. No need for PLLs or phase detectors. Of course the uP
>> must handle about 500 kHz interrupt rate :-).
>>
>
>Pretty slow PLL if you can do it at that rate.  Of course not every 
>application needs good performance--if all you care about is not losing 
>count, digital is great.
>
>Cheers
>
>Phil Hobbs

I understood that the required frequency was in the 200 kHz range, so
a 500 kHz NCO update rate should be sufficient.

[toc] | [prev] | [next] | [standalone]


#371909

FromPhil Hobbs <pcdhSpamMeSenseless@electrooptical.net>
Date2015-08-06 17:13 -0400
Message-ID<55C3CE02.6060903@electrooptical.net>
In reply to#371907
On 8/6/2015 4:58 PM, upsidedown@downunder.com wrote:
> On Thu, 06 Aug 2015 16:14:56 -0400, Phil Hobbs
> <hobbs@electrooptical.net> wrote:
>
>> On 8/6/2015 3:48 PM, upsidedown@downunder.com wrote:
>>> On Thu, 06 Aug 2015 11:19:55 -0700, Jim Thompson
>>> <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:
>>>
>>>> On Thu, 06 Aug 2015 13:57:03 -0400, Phil Hobbs
>>>> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>>>>
>>>>> On 8/6/2015 1:12 PM, bitrex wrote:
>>>>>> Has anyone successfully implemented a phase locked loop on a
>>>>>> microcontroller?
>>>>>>
>>>>>> The frequency of interest would be somewhere in the 200kHz range, and
>>>>>> the objective of the PLL would be FM demodulation.  So I'd have an input
>>>>>> for the FM modulated frequency, and an external VCO in that range that
>>>>>> the uC would hopefully control via filtered PWM.  Other than that, this
>>>>>> is mostly hypothetical for now.
>>>>>>
>>>>>> Does this seem possible?  I have the following reference:
>>>>>>
>>>>>> http://liquidsdr.org/blog/pll-howto/
>>>>>>
>>>>>> I'd be hoping to use something like an ATTiny.  All code would be
>>>>>> adjusted to use fixed-point math, I'd imagine.
>>>>>
>>>>> For a given resolution, you might as well just use a counter input.
>>>>>
>>>>> It's not going to be a very good demodulator...what modulation frequency
>>>>> and modulation index are you looking to accommodate?
>>>>>
>>>>> Cheers
>>>>>
>>>>> Phil Hobbs
>>>>
>>>> Awwwh, shucks, Phil, Don't you know that the solution for all analog
>>>> problems is a uP ?>:-}
>>>> 		
>>>>                                          ...Jim Thompson
>>>
>>> Get away with the VCOs and do it with NCOs and you can do FM, PM and
>>> AM quite easily. No need for PLLs or phase detectors. Of course the uP
>>> must handle about 500 kHz interrupt rate :-).
>>>
>>
>> Pretty slow PLL if you can do it at that rate.  Of course not every
>> application needs good performance--if all you care about is not losing
>> count, digital is great.
>>
>> Cheers
>>
>> Phil Hobbs
>
> I understood that the required frequency was in the 200 kHz range, so
> a 500 kHz NCO update rate should be sufficient.
>

Unless you want good phase control.  Nyquist is not the whole story in 
frequency control, by a lot.

Cheers

Phil Hobbs

-- 
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510

hobbs at electrooptical dot net
http://electrooptical.net

[toc] | [prev] | [next] | [standalone]


#371922

FromTim Wescott <seemywebsite@myfooter.really>
Date2015-08-06 17:40 -0500
Message-ID<kcKdnY67_5bcf17InZ2dnUVZ5h6dnZ2d@giganews.com>
In reply to#371909
On Thu, 06 Aug 2015 17:13:38 -0400, Phil Hobbs wrote:

> On 8/6/2015 4:58 PM, upsidedown@downunder.com wrote:
>> On Thu, 06 Aug 2015 16:14:56 -0400, Phil Hobbs
>> <hobbs@electrooptical.net> wrote:
>>
>>> On 8/6/2015 3:48 PM, upsidedown@downunder.com wrote:
>>>> On Thu, 06 Aug 2015 11:19:55 -0700, Jim Thompson
>>>> <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:
>>>>
>>>>> On Thu, 06 Aug 2015 13:57:03 -0400, Phil Hobbs
>>>>> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>>>>>
>>>>>> On 8/6/2015 1:12 PM, bitrex wrote:
>>>>>>> Has anyone successfully implemented a phase locked loop on a
>>>>>>> microcontroller?
>>>>>>>
>>>>>>> The frequency of interest would be somewhere in the 200kHz range,
>>>>>>> and the objective of the PLL would be FM demodulation.  So I'd
>>>>>>> have an input for the FM modulated frequency, and an external VCO
>>>>>>> in that range that the uC would hopefully control via filtered
>>>>>>> PWM.  Other than that, this is mostly hypothetical for now.
>>>>>>>
>>>>>>> Does this seem possible?  I have the following reference:
>>>>>>>
>>>>>>> http://liquidsdr.org/blog/pll-howto/
>>>>>>>
>>>>>>> I'd be hoping to use something like an ATTiny.  All code would be
>>>>>>> adjusted to use fixed-point math, I'd imagine.
>>>>>>
>>>>>> For a given resolution, you might as well just use a counter input.
>>>>>>
>>>>>> It's not going to be a very good demodulator...what modulation
>>>>>> frequency and modulation index are you looking to accommodate?
>>>>>>
>>>>>> Cheers
>>>>>>
>>>>>> Phil Hobbs
>>>>>
>>>>> Awwwh, shucks, Phil, Don't you know that the solution for all analog
>>>>> problems is a uP ?>:-}
>>>>> 		
>>>>>                                          ...Jim Thompson
>>>>
>>>> Get away with the VCOs and do it with NCOs and you can do FM, PM and
>>>> AM quite easily. No need for PLLs or phase detectors. Of course the
>>>> uP must handle about 500 kHz interrupt rate :-).
>>>>
>>>>
>>> Pretty slow PLL if you can do it at that rate.  Of course not every
>>> application needs good performance--if all you care about is not
>>> losing count, digital is great.
>>>
>>> Cheers
>>>
>>> Phil Hobbs
>>
>> I understood that the required frequency was in the 200 kHz range, so a
>> 500 kHz NCO update rate should be sufficient.
>>
>>
> Unless you want good phase control.  Nyquist is not the whole story in
> frequency control, by a lot.

+1.  I wanted to say that, but couldn't figure out how to do it in less 
than 100 words.

-- 

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

[toc] | [prev] | [next] | [standalone]


#372156

Fromupsidedown@downunder.com
Date2015-08-09 12:18 +0300
Message-ID<tu4esa9qiq25fpr3l7eq47salv82ftisp4@4ax.com>
In reply to#371922
On Thu, 06 Aug 2015 17:40:01 -0500, Tim Wescott
<seemywebsite@myfooter.really> wrote:

>On Thu, 06 Aug 2015 17:13:38 -0400, Phil Hobbs wrote:
>
>> On 8/6/2015 4:58 PM, upsidedown@downunder.com wrote:
>>> On Thu, 06 Aug 2015 16:14:56 -0400, Phil Hobbs
>>> <hobbs@electrooptical.net> wrote:
>>>
>>>> On 8/6/2015 3:48 PM, upsidedown@downunder.com wrote:
>>>>> On Thu, 06 Aug 2015 11:19:55 -0700, Jim Thompson
>>>>> <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> wrote:
>>>>>
>>>>>> On Thu, 06 Aug 2015 13:57:03 -0400, Phil Hobbs
>>>>>> <pcdhSpamMeSenseless@electrooptical.net> wrote:
>>>>>>
>>>>>>> On 8/6/2015 1:12 PM, bitrex wrote:
>>>>>>>> Has anyone successfully implemented a phase locked loop on a
>>>>>>>> microcontroller?
>>>>>>>>
>>>>>>>> The frequency of interest would be somewhere in the 200kHz range,
>>>>>>>> and the objective of the PLL would be FM demodulation.  So I'd
>>>>>>>> have an input for the FM modulated frequency, and an external VCO
>>>>>>>> in that range that the uC would hopefully control via filtered
>>>>>>>> PWM.  Other than that, this is mostly hypothetical for now.
>>>>>>>>
>>>>>>>> Does this seem possible?  I have the following reference:
>>>>>>>>
>>>>>>>> http://liquidsdr.org/blog/pll-howto/
>>>>>>>>
>>>>>>>> I'd be hoping to use something like an ATTiny.  All code would be
>>>>>>>> adjusted to use fixed-point math, I'd imagine.
>>>>>>>
>>>>>>> For a given resolution, you might as well just use a counter input.
>>>>>>>
>>>>>>> It's not going to be a very good demodulator...what modulation
>>>>>>> frequency and modulation index are you looking to accommodate?
>>>>>>>
>>>>>>> Cheers
>>>>>>>
>>>>>>> Phil Hobbs
>>>>>>
>>>>>> Awwwh, shucks, Phil, Don't you know that the solution for all analog
>>>>>> problems is a uP ?>:-}
>>>>>> 		
>>>>>>                                          ...Jim Thompson
>>>>>
>>>>> Get away with the VCOs and do it with NCOs and you can do FM, PM and
>>>>> AM quite easily. No need for PLLs or phase detectors. Of course the
>>>>> uP must handle about 500 kHz interrupt rate :-).
>>>>>
>>>>>
>>>> Pretty slow PLL if you can do it at that rate.  Of course not every
>>>> application needs good performance--if all you care about is not
>>>> losing count, digital is great.
>>>>
>>>> Cheers
>>>>
>>>> Phil Hobbs
>>>
>>> I understood that the required frequency was in the 200 kHz range, so a
>>> 500 kHz NCO update rate should be sufficient.
>>>
>>>
>> Unless you want good phase control.  Nyquist is not the whole story in
>> frequency control, by a lot.
>
>+1.  I wanted to say that, but couldn't figure out how to do it in less 
>than 100 words.

I assume that you must be talking about using the phase accumulator
MSB directly, which of course would generate a lot of phase jitter.

Apparently the OP intended to use multiple VCOs, so the final signal
would be analog sine wave. The alternate method would be to use a NCO
with sine lookup, DAC and LPF (anti-alias reconstruction filter). This
should solve the phase jitter problem quite nicely (at least when
avoid any pathological case such as 1/2, 1/3 etc. fOut/fClk ratios). 

If your phase error claim would be true, then a band limited audio
signal below 20 kHz could not be properly processed with only 44.1 kHz
sampling rate and the audiophools would be correct :-). Unfortunately
they forget the effect of the reconstruction filter.

About using a processor as an NCO, the simplest would be to perform
all operations (phase accumulator update, sine look-up and DAC
loading) during the sample clock interrupt. 

However, since the interrupt service overhead (including cache
reloads) is quite large and if the waveform is known a few
milliseconds in advance, the sample values for  all NCOs could be
calculated in advance and insert them into FIFOs. The ISR just picks
the next value from the FIFO and loads into a DAC. 

Even better, if the FIFO is in hardware with the DAC, multiple sample
values could be loaded in a fast memory to memory copy, without a need
for frequent interrupts as in sound cards.

[toc] | [prev] | [next] | [standalone]


#371882

FromTim Wescott <seemywebsite@myfooter.really>
Date2015-08-06 13:30 -0500
Message-ID<kcKdnZO7_5Y3Ol7InZ2dnUVZ5h6dnZ2d@giganews.com>
In reply to#371873
On Thu, 06 Aug 2015 13:12:35 -0400, bitrex wrote:

> Has anyone successfully implemented a phase locked loop on a
> microcontroller?
> 
> The frequency of interest would be somewhere in the 200kHz range, and
> the objective of the PLL would be FM demodulation.  So I'd have an input
> for the FM modulated frequency, and an external VCO in that range that
> the uC would hopefully control via filtered PWM.  Other than that, this
> is mostly hypothetical for now.
> 
> Does this seem possible?  I have the following reference:
> 
> http://liquidsdr.org/blog/pll-howto/
> 
> I'd be hoping to use something like an ATTiny.  All code would be
> adjusted to use fixed-point math, I'd imagine.

Tim who?

Uhh your answers are: yes, yes, my how interesting, and maybe not with 
that processor.  Would you like me to unpack?

Yes:

Yes, I have successfully implemented a PLL on a microcontroller.  Your 
choice of wording was very appropriate -- one doesn't so much implement a 
PLL _in software_ as one implements it on a (particular) microcontroller.

Yes:

Yes, this seems possible.  I'm not sure how practical, but it's in the 
realm of the possible.

my how interesting:

I only skimmed the link, but don't dive into the DSP literature and 
implement a direct-form-anything filter for your loop filter.  Read this 
page: http://wescottdesign.com/articles/zTransform/z-transforms.html, and 
implement a real PLL controller.

Maybe not that processor:

I'd have to do lots of analysis and math.  If your goal is to mix the 
output of an FM IF strip down to 200kHz or whatever, run it into a pin on 
a microprocessor, and extract broadcast-quality stereo from that, I'm not 
sure that you'll get there from here with an ATTiny, or for that matter, 
an AT-anything.  I'm pretty sure that it can be done digitally, but 
whether it can be done with anything short of an FPGA -- I dunno.

You'll have a huge tradeoff between the inherent accuracy of measuring 
the edge time (which means you need a high clock rate) and the 
processor's ability to keep up (which I think is what will rule out an 
ATTiny).

You MAY be able to mix your IF down to baseband using an I/Q demodulator, 
filter, and ADC it into the processor -- but at that point you have 
sufficient information to do you demodulation without needing any 
external PLL hardware, and you're still burdened with needing a high 
sampling rate.  I'm guessing, but I think you'd need to sample at 100kHz 
at a minimum, and 500kHz sounds more likely -- you just can't do much 
arithmetic on an AT core in 2us.

-- 

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

[toc] | [prev] | [next] | [standalone]


#371889

Frombitrex <bitrex@de.lete.earthlink.net>
Date2015-08-06 15:10 -0400
Message-ID<55c3b136$0$1754$4c5ecfc7@frugalusenet.com>
In reply to#371882
On 8/6/2015 2:30 PM, Tim Wescott wrote:
> On Thu, 06 Aug 2015 13:12:35 -0400, bitrex wrote:
>
>> Has anyone successfully implemented a phase locked loop on a
>> microcontroller?
>>
>> The frequency of interest would be somewhere in the 200kHz range, and
>> the objective of the PLL would be FM demodulation.  So I'd have an input
>> for the FM modulated frequency, and an external VCO in that range that
>> the uC would hopefully control via filtered PWM.  Other than that, this
>> is mostly hypothetical for now.
>>
>> Does this seem possible?  I have the following reference:
>>
>> http://liquidsdr.org/blog/pll-howto/
>>
>> I'd be hoping to use something like an ATTiny.  All code would be
>> adjusted to use fixed-point math, I'd imagine.
>
> Tim who?
>
> Uhh your answers are: yes, yes, my how interesting, and maybe not with
> that processor.  Would you like me to unpack?
>
> Yes:
>
> Yes, I have successfully implemented a PLL on a microcontroller.  Your
> choice of wording was very appropriate -- one doesn't so much implement a
> PLL _in software_ as one implements it on a (particular) microcontroller.
>
> Yes:
>
> Yes, this seems possible.  I'm not sure how practical, but it's in the
> realm of the possible.
>
> my how interesting:
>
> I only skimmed the link, but don't dive into the DSP literature and
> implement a direct-form-anything filter for your loop filter.  Read this
> page: http://wescottdesign.com/articles/zTransform/z-transforms.html, and
> implement a real PLL controller.
>
> Maybe not that processor:
>
> I'd have to do lots of analysis and math.  If your goal is to mix the
> output of an FM IF strip down to 200kHz or whatever, run it into a pin on
> a microprocessor, and extract broadcast-quality stereo from that, I'm not
> sure that you'll get there from here with an ATTiny, or for that matter,
> an AT-anything.  I'm pretty sure that it can be done digitally, but
> whether it can be done with anything short of an FPGA -- I dunno.
>
> You'll have a huge tradeoff between the inherent accuracy of measuring
> the edge time (which means you need a high clock rate) and the
> processor's ability to keep up (which I think is what will rule out an
> ATTiny).
>
> You MAY be able to mix your IF down to baseband using an I/Q demodulator,
> filter, and ADC it into the processor -- but at that point you have
> sufficient information to do you demodulation without needing any
> external PLL hardware, and you're still burdened with needing a high
> sampling rate.  I'm guessing, but I think you'd need to sample at 100kHz
> at a minimum, and 500kHz sounds more likely -- you just can't do much
> arithmetic on an AT core in 2us.
>

I'm sorry to change requirements on you, but I'm going to change 
requirements on you, haha.  For the project I'm thinking about, I 
believe I'm going to do the FM demodulation with a legit hardware PLL.

I was thinking about using the uC based PLL to sync a bunch of VCOs in 
that range to a crystal controlled reference frequency, and then allow 
them to vary about that base frequency.

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | sci.electronics.design


csiph-web