Goto page Previous 1, 2, 3, 4 Next
Bitrex
Guest
Sat Mar 06, 2010 2:01 pm
linnix wrote:
Quote:
On Mar 5, 2:29 pm, Spehro Pefhany <speffS...@interlogDOTyou.knowwhat
wrote:
On Fri, 5 Mar 2010 12:32:47 -0800 (PST), Chris
christopher.man...@gmail.com> wrote:
On Mar 5, 11:59 am, Jan Panteltje <pNaonStpealm...@yahoo.com> wrote:
On a sunny day (Fri, 5 Mar 2010 11:11:38 -0800 (PST)) it happened Chris
christopher.man...@gmail.com> wrote in
29529065-09fc-4636-9a29-c618cbc16...@x1g2000prb.googlegroups.com>:
I have posted several threads about converting 24Hz pulses to 60Hz
basically a 5/2 ratio. I tried a phase locked loop, it sorta works,
but my chip count is getting high, and I am thinking about making more
of these and selling them if I can write a computer program to resolve
wave sound files.
Therefore, since I am not very familiar with micro controllers, I was
not planning on using one. However, I remember an engineer friend of
mine mentioning the BASIC stamp. I have dabbled in BASIC so, I might
approach the problem with this as a solution, especially if I can do
it with one or two chips.
I would think that I could sample the 24Hz side for one second. Take
that number and use it to divide a much higher frequency quartz
reference by some large value of N so that I can get it back down to
60Hz. Therefore my lock time would be one second. I can have an easy
lock indication and a fairly fast response to any changes in
frequency.
What do you guys/gals think?
Regards,
Chris Maness
Years ago I posted a PIC 50 Hz PLL asm code here.
Or maybe it was 25 Hz.
I would not bother with BASIC, likely way too slow, and way too much resources hungry.
A 1$50 12 pin PIC should do...
What are some models that would be good for that application. I see
some 8 pin models that are only $2. The only problem is that I have
NO clue how to start programming them.
Regards,
Chris
Just write code to initialize and make an LED flash at a visible rate.
The rest is easy...
Or something like this:
loop()
{
// sample 24Hz input
now = ACSR & (1<<INPUT_BIT_NUMBER); // Analog comparator
if(now && !before) // rising edge
{
// reload 60Hz timer
TCCR1B = 3; // prescale by 64
n = 2083; // 8,000,000 / 64 / 60
TCNT1H = (n<<

&0xff;
TCNT1L = (n)&0xff;
}
before = now;
}
On_Timer1_Interrupt()
{
// pulse 60Hz output
}
That looks like avr-gcc, not PIC code!

That's one of the things that
sold me on AVR microcontrollers over the PIC - if you want to program
anything less than an 18 series PIC you have to either use assembly or
buy a 3rd party C compiler.
Jan Panteltje
Guest
Sat Mar 06, 2010 2:02 pm
On a sunny day (Fri, 5 Mar 2010 19:55:12 -0800 (PST)) it happened Chris
<christopher.maness_at_gmail.com> wrote in
<33f8f59c-4242-428f-8226-d0c6866cefbd_at_a10g2000pri.googlegroups.com>:
Quote:
Something like this will be less then 300$:
ftp://panteltje.com/pub/24_to_60Hz_PLL_img_1847.jpg
the way this is supposed to work is:
the camera contact produces a short pulse that opens the 4015 6swicth.
That samples the 24 Hz and the system will stabilise so the camara pulse =
is centered
around an edge of that 24 Hz waveform.
The 4046 runs at 120 Hz, set for exactly 120 Hz with no camera active.
The 7490 has a divide by 2 and a divide by 5, and makes 24 Hz and 60 Hz f=
rom the 120 Hz.
Note the loop filter values.
This is not your normal PLL system, but my own invention.
Before you invest years in learning to program PICs,
maybe you could try this first:-)
I have not tried it for this, but at a slightly higher frequency with dif=
ferent dividers
for in a data separator,
Extremely stable over a wide range.
Just a quick sketch too, not checked for errors.
I am interested since I already have the parts. What do you think the
lock time would be?
Some remarks to that diagram, I forgot a resistor, and the loop filter values are for 500 kHz.
\
------0 \------ R1 10k ----------------- pin9 4046
4016 | |
=== C1 |
| |
------ | +5V
| | R3 1M |
===C2 R2 | R4 100 Ohm
| | | |
----------------------------------| +2.5V
|
R5 100 Ohm
|
///
R1 is 10k
R2 is 2 k
So, looking at the loop filter, for 24 Hz (say 25) versus 500 kHz the values need to be 20000x bigger,
so that makes
C1 20000 x 10 nF = 200 uF
C2 20000 x 1nF = 20 uF
When the circuit starts up, without the camera running, or connected, the voltage divider formed by R3 R4
will cause the VCO input of the 4046 to be at 2.5 V, and it should then run exactly at 120 Hz.
The circuit that you call 'debounce', is not that.
It is a one shot pulse generator, it generates a small positive pulse that opens the 4016 switch momentarily:
+5V
| -- +4.3V
R6 1k | |
| | | | | pulse, length set by C3 R7
------------------0--------------------| |-------------------- -- --------------- -0.7V
| | | | |
| C3 | |
0 | |
\ --- R7 10k
|camera switch / \ |
| --- |
| | |
------------------0--------- /// ///
|
///
This 4016 switch connects C1 to the 24 Hz square wave from the divide by 5 counter 7490.
If the oscillator is slow, it will connect mostly during the high part, +5V, and C1 will charge fast for a moment.
If the oscillator is too fast, it will connect mostly during the low part (0V) and C1 will discharge fast.
This assures very fast lock time (10k in 200 uF).
This system *also* assures that when pulses are 'missing' the PLL does not veer of to all the way to a low frequency,
but stays at the last frequency, slowly moving to its free-running frequency because of R3.
One in lock the phase relationship is like this:
-----
| |
| |
------------- ------- sample pulse to 4016 switch
--------------- --------------
| |
| |
------------------------------------------------------------------------- 24 Hz from divide by 5
-
| |
.............| | ........ 0 charge current in R1 to C1
| |
| |
--
It is an exact phase lock.
Quote:
My design is very similar but I need to re design
the loop filter. I have a large C and small R, but I have seen
another design that has a a large R and small C. The lock takes
several seconds tho with the large RC constant. All the wile precious
film is burning through the camera. If I use a smaller RC constant
then the jitter becomes unacceptable.
Another big problem is the loop is locking on the wrong frequency on
the camera. It works fine when I simulate the camera with a
multivibe, but is locking strangely with the camera. I tried a low
pass to filter bounces, it changed the lock frequency, but still not
correct.
The design requires a lock indication so that the operator will know
when the pilot tone is up to pitch so that the movie can be slated.
My fullcoat deck takes about 6 or 7 seconds for the fly wheel to get
up to speed. The pitch is fine on this, but there is bad flutter
until the flywheel is at speed.
I dunno. maybe you can use that other phase comparator in the 4046 as lock indicator?
Quote:
I see that your design incorporates a debounce. I am interested, but
I am having a little tough time reading the schematic.
Hope the above helps.
In the diagram the C1 can become negative, maybe use 2 caps in opposite direction in series?
None of the components are critical, and I just calculated them using my neural net (brain).
It is a small market, I think, especially these days, with all digital cameras and post processing...
else I could make some for 300$ a piece:-)
Quote:
Also, I might
suggest I higher frequency for the VCO, I found that it was more
stable at a higher frequency, and no big deal to divide down. Divide
by 80 in the loop, and divide by 32 on the output.
You can try
The frequency cap is smaller, and probably has less tolerance, also versus temperature.
But my experienced with the original 4046 and the 74HC4046 are really good any ways,
I always keep some in stock for projects.
Although these day PICs make big inroads
But it is hard to beat an analog PLL in some applications.
Quote:
I am friends with a guy that deals with a lot of pros that shoot small
gauge film, and I might be able to incorporate this with some software
and a PCM recorder. Right now, I am just trying to get my camera to
play with my full coat deck.
Chris
linnix
Guest
Sat Mar 06, 2010 5:32 pm
On Mar 6, 5:01 am, Bitrex <bit...@de.lete.earthlink.net> wrote:
Quote:
linnix wrote:
On Mar 5, 2:29 pm, Spehro Pefhany <speffS...@interlogDOTyou.knowwhat
wrote:
On Fri, 5 Mar 2010 12:32:47 -0800 (PST), Chris
christopher.man...@gmail.com> wrote:
On Mar 5, 11:59 am, Jan Panteltje <pNaonStpealm...@yahoo.com> wrote:
On a sunny day (Fri, 5 Mar 2010 11:11:38 -0800 (PST)) it happened Chris
christopher.man...@gmail.com> wrote in
29529065-09fc-4636-9a29-c618cbc16...@x1g2000prb.googlegroups.com>:
I have posted several threads about converting 24Hz pulses to 60Hz
basically a 5/2 ratio. I tried a phase locked loop, it sorta works,
but my chip count is getting high, and I am thinking about making more
of these and selling them if I can write a computer program to resolve
wave sound files.
Therefore, since I am not very familiar with micro controllers, I was
not planning on using one. However, I remember an engineer friend of
mine mentioning the BASIC stamp. I have dabbled in BASIC so, I might
approach the problem with this as a solution, especially if I can do
it with one or two chips.
I would think that I could sample the 24Hz side for one second. Take
that number and use it to divide a much higher frequency quartz
reference by some large value of N so that I can get it back down to
60Hz. Therefore my lock time would be one second. I can have an easy
lock indication and a fairly fast response to any changes in
frequency.
What do you guys/gals think?
Regards,
Chris Maness
Years ago I posted a PIC 50 Hz PLL asm code here.
Or maybe it was 25 Hz.
I would not bother with BASIC, likely way too slow, and way too much resources hungry.
A 1$50 12 pin PIC should do...
What are some models that would be good for that application. I see
some 8 pin models that are only $2. The only problem is that I have
NO clue how to start programming them.
Regards,
Chris
Just write code to initialize and make an LED flash at a visible rate.
The rest is easy...
Or something like this:
...
That looks like avr-gcc, not PIC code!

That's one of the things that
sold me on AVR microcontrollers over the PIC - if you want to program
anything less than an 18 series PIC you have to either use assembly or
buy a 3rd party C compiler.
You missed the point. It's Atmel's Programmable Integrated Circuit
(Atmega8u2) using the Programmable Investigative Gadget (PIG). I am
going to try it out with 3 PIGs. PIG1 generates a 24Hz square wave.
PIG2 up-converts 24Hz to 60Hz. PIG3 monitors both outputs and sends
them to the PC virtual com.
Let's see if they fly.
This is PIG2 with 8 bits timer to pulse the LED and 16 bits timer to
do the 60Hz.
// 8 MHz clock
// Timer 0 - LED on timer
// Timer 1 - 60 Hz output timer
// Interface header
// PD0 PD2 VCC PB0 PB6
// PD1 PD3 GND PD6 PB5
// PD1 = input
// PD3 = output
// PD6 = locked
main()
{
PORTD = (1<<3)|(1<<6);
ACMUX = 0; // Select AIN1
ACSR = (1<<ACBG); // Select bandgap AIN0
while(1)
{
loop();
}
}
wait(int msec)
{
// Timer 0 - 78 counts per msec
TCCR0B = 5; // prescale 1024
TCNT0 = 0
OCR0A = 78 * msec;
while(!(TIFR0 & (1<<OCF0A))// wait
;
}
loop()
{
// Analog comparator sample 24Hz input
now = ACSR & (1<<ACO);
if(now && !before) // rising edge
{
// reload 120Hz timer
TCCR1B = 3; // prescale by 64
n = 1541; // 8,000,000 / 64 / 120
TCNT1H = (0)&0xff;
TCNT1L = (0)&0xff;
OCR1AH = (n<<

&0xff;
OCR1AL = (n)&0xff;
run = 0;
// enable timer1 interrupt
TIMSK1 = (1<<OCIE1A);
PORTD |= (1<<6); // LED on
wait(5); // 5 msec
PORTD &= ~(1<<6); // LED off
}
before = now;
}
On_Timer1_Interrupt()
{
// toggle 60Hz output bit
PORTD ^= (1<<3);
if(++run < 3)
{
TCNT1H = (0)&0xff;
TCNT1L = (0)&0xff;
OCR1AH = (n<<

&0xff;
OCR1AL = (n)&0xff;
//re-enable timer1 interrupt
TIMSK1 = (1<<OCIE1A);
}
}
Chris
Guest
Sun Mar 07, 2010 1:57 am
On Mar 6, 5:02 am, Jan Panteltje <pNaonStpealm...@yahoo.com> wrote:
Quote:
On a sunny day (Fri, 5 Mar 2010 19:55:12 -0800 (PST)) it happened Chris
christopher.man...@gmail.com> wrote in
33f8f59c-4242-428f-8226-d0c6866ce...@a10g2000pri.googlegroups.com>:
Something like this will be less then 300$:
ftp://panteltje.com/pub/24_to_60Hz_PLL_img_1847.jpg
the way this is supposed to work is:
the camera contact produces a short pulse that opens the 4015 6swicth.
That samples the 24 Hz and the system will stabilise so the camara pulse > >is centered
around an edge of that 24 Hz waveform.
The 4046 runs at 120 Hz, set for exactly 120 Hz with no camera active.
The 7490 has a divide by 2 and a divide by 5, and makes 24 Hz and 60 Hz f> >rom the 120 Hz.
Note the loop filter values.
This is not your normal PLL system, but my own invention.
Before you invest years in learning to program PICs,
maybe you could try this first:-)
I have not tried it for this, but at a slightly higher frequency with dif> >ferent dividers
for in a data separator,
Extremely stable over a wide range.
Just a quick sketch too, not checked for errors.
I am interested since I already have the parts. What do you think the
lock time would be?
Some remarks to that diagram, I forgot a resistor, and the loop filter values are for 500 kHz.
\
------0 \------ R1 10k ----------------- pin9 4046
4016 | |
=== C1 |
| |
------ | +5V
| | R3 1M |
===C2 R2 | R4 100 Ohm
| | | |
----------------------------------| +2.5V
|
R5 100 Ohm
|
///
R1 is 10k
R2 is 2 k
So, looking at the loop filter, for 24 Hz (say 25) versus 500 kHz the values need to be 20000x bigger,
so that makes
C1 20000 x 10 nF = 200 uF
C2 20000 x 1nF = 20 uF
When the circuit starts up, without the camera running, or connected, the voltage divider formed by R3 R4
will cause the VCO input of the 4046 to be at 2.5 V, and it should then run exactly at 120 Hz.
The circuit that you call 'debounce', is not that.
It is a one shot pulse generator, it generates a small positive pulse that opens the 4016 switch momentarily:
+5V
| -- +4.3V
R6 1k | |
| | | | | pulse, length set by C3 R7
------------------0--------------------| |-------------------- -- --------------- -0.7V
| | | | |
| C3 | |
0 | |
\ --- R7 10k
|camera switch / \ |
| --- |
| | |
------------------0--------- /// ///
|
///
This 4016 switch connects C1 to the 24 Hz square wave from the divide by 5 counter 7490.
If the oscillator is slow, it will connect mostly during the high part, +5V, and C1 will charge fast for a moment.
If the oscillator is too fast, it will connect mostly during the low part (0V) and C1 will discharge fast.
This assures very fast lock time (10k in 200 uF).
This system *also* assures that when pulses are 'missing' the PLL does not veer of to all the way to a low frequency,
but stays at the last frequency, slowly moving to its free-running frequency because of R3.
One in lock the phase relationship is like this:
-----
| |
| |
------------- ------- sample pulse to 4016 switch
--------------- --------------
| |
| |
------------------------------------------------------------------------- 24 Hz from divide by 5
-
| |
............| | ........ 0 charge current in R1 to C1
| |
| |
--
It is an exact phase lock.
My design is very similar but I need to re design
the loop filter. I have a large C and small R, but I have seen
another design that has a a large R and small C. The lock takes
several seconds tho with the large RC constant. All the wile precious
film is burning through the camera. If I use a smaller RC constant
then the jitter becomes unacceptable.
Another big problem is the loop is locking on the wrong frequency on
the camera. It works fine when I simulate the camera with a
multivibe, but is locking strangely with the camera. I tried a low
pass to filter bounces, it changed the lock frequency, but still not
correct.
The design requires a lock indication so that the operator will know
when the pilot tone is up to pitch so that the movie can be slated.
My fullcoat deck takes about 6 or 7 seconds for the fly wheel to get
up to speed. The pitch is fine on this, but there is bad flutter
until the flywheel is at speed.
I dunno. maybe you can use that other phase comparator in the 4046 as lock indicator?
I see that your design incorporates a debounce. I am interested, but
I am having a little tough time reading the schematic.
Hope the above helps.
In the diagram the C1 can become negative, maybe use 2 caps in opposite direction in series?
None of the components are critical, and I just calculated them using my neural net (brain).
It is a small market, I think, especially these days, with all digital cameras and post processing...
else I could make some for 300$ a piece:-)
Also, I might
suggest I higher frequency for the VCO, I found that it was more
stable at a higher frequency, and no big deal to divide down. Divide
by 80 in the loop, and divide by 32 on the output.
You can try
The frequency cap is smaller, and probably has less tolerance, also versus temperature.
But my experienced with the original 4046 and the 74HC4046 are really good any ways,
I always keep some in stock for projects.
Although these day PICs make big inroads
But it is hard to beat an analog PLL in some applications.
I am friends with a guy that deals with a lot of pros that shoot small
gauge film, and I might be able to incorporate this with some software
and a PCM recorder. Right now, I am just trying to get my camera to
play with my full coat deck.
Chris
@ Jan
I have company today, but I like your design. I have company today,
so I can't ask any questions today. Can you email me directly? My
email on here is good. I tried yours, but it just bounced.
Regards,
Chris Maness
David Eather
Guest
Sun Mar 07, 2010 4:54 am
On 6/03/2010 5:39 AM, Chris wrote:
Quote:
On Mar 5, 11:11 am, Chris<christopher.man...@gmail.com> wrote:
I have posted several threads about converting 24Hz pulses to 60Hz
basically a 5/2 ratio. I tried a phase locked loop, it sorta works,
but my chip count is getting high, and I am thinking about making more
of these and selling them if I can write a computer program to resolve
wave sound files.
Therefore, since I am not very familiar with micro controllers, I was
not planning on using one. However, I remember an engineer friend of
mine mentioning the BASIC stamp. I have dabbled in BASIC so, I might
approach the problem with this as a solution, especially if I can do
it with one or two chips.
I would think that I could sample the 24Hz side for one second. Take
that number and use it to divide a much higher frequency quartz
reference by some large value of N so that I can get it back down to
60Hz. Therefore my lock time would be one second. I can have an easy
lock indication and a fairly fast response to any changes in
frequency.
What do you guys/gals think?
Regards,
Chris Maness
Holy crap, I did not realize that these things are $80 for a one off.
Chris
Look up PICAXE. Very similar thing. $5 to $20 per unit.
www.picaxe.co.uk
JosephKK
Guest
Mon Mar 08, 2010 12:22 am
On Fri, 05 Mar 2010 20:30:33 +0000, Tim Watts <tw_at_dionic.net> wrote:
Quote:
Chris <christopher.maness_at_gmail.com
wibbled on Friday 05 March 2010 19:11
I have posted several threads about converting 24Hz pulses to 60Hz
basically a 5/2 ratio. I tried a phase locked loop, it sorta works,
but my chip count is getting high, and I am thinking about making more
of these and selling them if I can write a computer program to resolve
wave sound files.
Therefore, since I am not very familiar with micro controllers, I was
not planning on using one. However, I remember an engineer friend of
mine mentioning the BASIC stamp. I have dabbled in BASIC so, I might
approach the problem with this as a solution, especially if I can do
it with one or two chips.
I would think that I could sample the 24Hz side for one second. Take
that number and use it to divide a much higher frequency quartz
reference by some large value of N so that I can get it back down to
60Hz. Therefore my lock time would be one second. I can have an easy
lock indication and a fairly fast response to any changes in
frequency.
What do you guys/gals think?
Regards,
Chris Maness
Look at the Atmel AVRs (Tiny for smallness or Mega for more
pins/features/Memory). Cheap, programmable in C or ASM from a variety of
platforms.
I'm an embedded newbie and I have *no* trouble getting them to dance (in C,
with which I am familiar), so I reckon anyone could ;-
So just perzactly what kit did you use? Requiring minds want to know.
JosephKK
Guest
Mon Mar 08, 2010 12:31 am
On Fri, 5 Mar 2010 13:46:47 -0800 (PST), linnix <me_at_linnix.info-for.us> wrote:
Quote:
On Mar 5, 1:30 pm, Chris <christopher.man...@gmail.com> wrote:
On Mar 5, 12:55 pm, linnix <m...@linnix.info-for.us> wrote:
On Mar 5, 11:11 am, Chris <christopher.man...@gmail.com> wrote:
I have posted several threads about converting 24Hz pulses to 60Hz
basically a 5/2 ratio. I tried a phase locked loop, it sorta works,
but my chip count is getting high, and I am thinking about making more
of these and selling them if I can write a computer program to resolve
wave sound files.
Therefore, since I am not very familiar with micro controllers, I was
not planning on using one. However, I remember an engineer friend of
mine mentioning the BASIC stamp. I have dabbled in BASIC so, I might
approach the problem with this as a solution, especially if I can do
it with one or two chips.
I would think that I could sample the 24Hz side for one second. Take
that number and use it to divide a much higher frequency quartz
reference by some large value of N so that I can get it back down to
60Hz. Therefore my lock time would be one second. I can have an easy
lock indication and a fairly fast response to any changes in
frequency.
If your signal is 24Hz, where is the changes in frequency coming
from? We need to know more about the spec first.
What do you guys/gals think?
Regards,
Chris Maness
It comes from the flash contact from a small gauge movie camera.
These cameras have very low precision speed control. Ideally they
would run at exactly at 24Hz. The design is to record the error on a
second track and use a fullcoat deck or a computer to resolve later.
The design would do something similar to:
http://www.webtfg.com/sync11.htm
Regards,
Chris
OK, why can't you record the 24Hz and a stable 60Hz together and
resolve them later. On the other hand, sampling the 24Hz at 1.44KHz
rate and recreate a 60Hz is doable with a micro.
Linnix, Chris is trying to build the point of recoordination, not defer it further.
Chris
Guest
Mon Mar 08, 2010 2:14 am
On Mar 7, 3:31 pm, "JosephKK"<quiettechb...@yahoo.com> wrote:
Quote:
On Fri, 5 Mar 2010 13:46:47 -0800 (PST), linnix <m...@linnix.info-for.us> wrote:
On Mar 5, 1:30 pm, Chris <christopher.man...@gmail.com> wrote:
On Mar 5, 12:55 pm, linnix <m...@linnix.info-for.us> wrote:
On Mar 5, 11:11 am, Chris <christopher.man...@gmail.com> wrote:
I have posted several threads about converting 24Hz pulses to 60Hz
basically a 5/2 ratio. I tried a phase locked loop, it sorta works,
but my chip count is getting high, and I am thinking about making more
of these and selling them if I can write a computer program to resolve
wave sound files.
Therefore, since I am not very familiar with micro controllers, I was
not planning on using one. However, I remember an engineer friend of
mine mentioning the BASIC stamp. I have dabbled in BASIC so, I might
approach the problem with this as a solution, especially if I can do
it with one or two chips.
I would think that I could sample the 24Hz side for one second. Take
that number and use it to divide a much higher frequency quartz
reference by some large value of N so that I can get it back down to
60Hz. Therefore my lock time would be one second. I can have an easy
lock indication and a fairly fast response to any changes in
frequency.
If your signal is 24Hz, where is the changes in frequency coming
from? We need to know more about the spec first.
What do you guys/gals think?
Regards,
Chris Maness
It comes from the flash contact from a small gauge movie camera.
These cameras have very low precision speed control. Ideally they
would run at exactly at 24Hz. The design is to record the error on a
second track and use a fullcoat deck or a computer to resolve later.
The design would do something similar to:
http://www.webtfg.com/sync11.htm
Regards,
Chris
OK, why can't you record the 24Hz and a stable 60Hz together and
resolve them later. On the other hand, sampling the 24Hz at 1.44KHz
rate and recreate a 60Hz is doable with a micro.
Linnix, Chris is trying to build the point of recoordination, not defer it further.
Jan has a circuit very similar to the one I have designed. We changed
the cutoff frequency of the loop filter to his design. I will proto
it, and see if the changes will make the lock time acceptable. If not
I will be going to a micro controller solution.
Regards,
Chris
linnix
Guest
Mon Mar 08, 2010 2:23 am
On Mar 7, 3:31 pm, "JosephKK"<quiettechb...@yahoo.com> wrote:
Quote:
On Fri, 5 Mar 2010 13:46:47 -0800 (PST), linnix <m...@linnix.info-for.us> wrote:
On Mar 5, 1:30 pm, Chris <christopher.man...@gmail.com> wrote:
On Mar 5, 12:55 pm, linnix <m...@linnix.info-for.us> wrote:
On Mar 5, 11:11 am, Chris <christopher.man...@gmail.com> wrote:
I have posted several threads about converting 24Hz pulses to 60Hz
basically a 5/2 ratio. I tried a phase locked loop, it sorta works,
but my chip count is getting high, and I am thinking about making more
of these and selling them if I can write a computer program to resolve
wave sound files.
Therefore, since I am not very familiar with micro controllers, I was
not planning on using one. However, I remember an engineer friend of
mine mentioning the BASIC stamp. I have dabbled in BASIC so, I might
approach the problem with this as a solution, especially if I can do
it with one or two chips.
I would think that I could sample the 24Hz side for one second. Take
that number and use it to divide a much higher frequency quartz
reference by some large value of N so that I can get it back down to
60Hz. Therefore my lock time would be one second. I can have an easy
lock indication and a fairly fast response to any changes in
frequency.
If your signal is 24Hz, where is the changes in frequency coming
from? We need to know more about the spec first.
What do you guys/gals think?
Regards,
Chris Maness
It comes from the flash contact from a small gauge movie camera.
These cameras have very low precision speed control. Ideally they
would run at exactly at 24Hz. The design is to record the error on a
second track and use a fullcoat deck or a computer to resolve later.
The design would do something similar to:
http://www.webtfg.com/sync11.htm
Regards,
Chris
OK, why can't you record the 24Hz and a stable 60Hz together and
resolve them later. On the other hand, sampling the 24Hz at 1.44KHz
rate and recreate a 60Hz is doable with a micro.
Linnix, Chris is trying to build the point of recoordination, not defer it further.
Yes, I understand it now, after reading more about it. It can be done
with simple interrupt timers. See example below.
----- PIG1.c -----
// 8 MHz clock
// Timer 1 - 60 Hz output timer
// PD3 = output
#include <avr/io.h>
main()
{
PORTD = (1<<3);
// load 48Hz timer
TCCR1B = 3; // prescale by 64
n = 2604; // 8,000,000 / 64 / 48
TCNT1H = (0)&0xff;
TCNT1L = (0)&0xff;
OCR1AH = (n<<

&0xff;
OCR1AL = (n)&0xff;
}
On_Timer1_Interrupt()
{
TIMSK1 = 0;
// toggle output bit
PORTD ^= (1<<3);
//re-enable timer1 interrupt
TIMSK1 = (1<<OCIE1A);
}
----- PIG2.c -----
// 8 MHz clock
// Timer 0 - LED on timer
// Timer 1 - 60 Hz output timer
// PD1 = input
// PD3 = output
// PD6 = locked
#include <avr/io.h>
int n, run, now, before;
main()
{
PORTD = (1<<3)|(1<<6);
ACMUX = 0; // Select AIN1
ACSR = (1<<ACBG); // Select bandgap AIN0
while(1)
{
// Analog comparator sample 24Hz input
now = ACSR & (1<<ACO);
if(now && !before) // rising edge
{
// reload 120Hz timer
TCCR1B = 3; // prescale by 64
n = 1541; // 8,000,000 / 64 / 120
TCNT1H = (0)&0xff;
TCNT1L = (0)&0xff;
OCR1AH = (n<<

&0xff;
OCR1AL = (n)&0xff;
run = 0;
// enable timer1 interrupt
TIMSK1 = (1<<OCIE1A);
PORTD |= (1<<6); // LED on
wait(5); // 5 msec
PORTD &= ~(1<<6); // LED off
}
before = now;
}
}
wait(int msec)
{
// Timer 0 - 78 counts per msec
TCCR0B = 5; // prescale 1024
TCNT0 = 0;
OCR0A = 78 * msec;
while(!(TIFR0 & (1<<OCF0A)))
;
}
On_Timer1_Interrupt()
{
TIMSK1 =0;
// toggle 60Hz output bit
PORTD ^= (1<<3);
if(++run < 3)
{
//re-enable timer1 interrupt
TIMSK1 = (1<<OCIE1A);
}
}
Tim Watts
Guest
Mon Mar 08, 2010 9:07 am
JosephKK <quiettechblue_at_yahoo.com>
wibbled on Sunday 07 March 2010 23:22
Quote:
Look at the Atmel AVRs (Tiny for smallness or Mega for more
pins/features/Memory). Cheap, programmable in C or ASM from a variety of
platforms.
I'm an embedded newbie and I have *no* trouble getting them to dance (in
C, with which I am familiar), so I reckon anyone could ;-
So just perzactly what kit did you use? Requiring minds want to know.
STK500 for around 80 quid as I foresaw a lasting relationship between me and
the DIP versions.
But it can be done for less - there are lots of ISP to USB programmers
available too that emulate the STK500 protocol.
HTH
Tim
--
Tim Watts
Managers, politicians and environmentalists: Nature's carbon buffer.
JosephKK
Guest
Tue Mar 09, 2010 5:52 am
On Mon, 08 Mar 2010 08:07:37 +0000, Tim Watts <tw_at_dionic.net> wrote:
Quote:
JosephKK <quiettechblue_at_yahoo.com
wibbled on Sunday 07 March 2010 23:22
Look at the Atmel AVRs (Tiny for smallness or Mega for more
pins/features/Memory). Cheap, programmable in C or ASM from a variety of
platforms.
I'm an embedded newbie and I have *no* trouble getting them to dance (in
C, with which I am familiar), so I reckon anyone could ;-
So just perzactly what kit did you use? Requiring minds want to know.
STK500 for around 80 quid as I foresaw a lasting relationship between me and
the DIP versions.
But it can be done for less - there are lots of ISP to USB programmers
available too that emulate the STK500 protocol.
HTH
Tim
My time experimenting instead of building standard stuff is easily worth
the purchase price indicated.
Tim Watts
Guest
Tue Mar 09, 2010 8:01 am
JosephKK <quiettechblue_at_yahoo.com>
wibbled on Tuesday 09 March 2010 04:52
Quote:
On Mon, 08 Mar 2010 08:07:37 +0000, Tim Watts <tw_at_dionic.net> wrote:
JosephKK <quiettechblue_at_yahoo.com
wibbled on Sunday 07 March 2010 23:22
Look at the Atmel AVRs (Tiny for smallness or Mega for more
pins/features/Memory). Cheap, programmable in C or ASM from a variety of
platforms.
I'm an embedded newbie and I have *no* trouble getting them to dance (in
C, with which I am familiar), so I reckon anyone could ;-
So just perzactly what kit did you use? Requiring minds want to know.
STK500 for around 80 quid as I foresaw a lasting relationship between me
and the DIP versions.
But it can be done for less - there are lots of ISP to USB programmers
available too that emulate the STK500 protocol.
HTH
Tim
My time experimenting instead of building standard stuff is easily worth
the purchase price indicated.
The STK500 is solid. Only cons are it can't do ICE and a few of the newer
chips aren't supported directly at the sockets, but a) it will still ISP
program them over a wire to a breadboard and b) you can get adaptor sockets
to make them fit the STK500 directly - it's only a pin mapping issue, not a
software one.
--
Tim Watts
Managers, politicians and environmentalists: Nature's carbon buffer.
Chris
Guest
Wed Mar 10, 2010 2:07 am
On Mar 6, 5:02 am, Jan Panteltje <pNaonStpealm...@yahoo.com> wrote:
Quote:
On a sunny day (Fri, 5 Mar 2010 19:55:12 -0800 (PST)) it happened Chris
christopher.man...@gmail.com> wrote in
33f8f59c-4242-428f-8226-d0c6866ce...@a10g2000pri.googlegroups.com>:
Something like this will be less then 300$:
ftp://panteltje.com/pub/24_to_60Hz_PLL_img_1847.jpg
the way this is supposed to work is:
the camera contact produces a short pulse that opens the 4015 6swicth.
That samples the 24 Hz and the system will stabilise so the camara pulse > >is centered
around an edge of that 24 Hz waveform.
The 4046 runs at 120 Hz, set for exactly 120 Hz with no camera active.
The 7490 has a divide by 2 and a divide by 5, and makes 24 Hz and 60 Hz f> >rom the 120 Hz.
Note the loop filter values.
This is not your normal PLL system, but my own invention.
Before you invest years in learning to program PICs,
maybe you could try this first:-)
I have not tried it for this, but at a slightly higher frequency with dif> >ferent dividers
for in a data separator,
Extremely stable over a wide range.
Just a quick sketch too, not checked for errors.
I am interested since I already have the parts. What do you think the
lock time would be?
Some remarks to that diagram, I forgot a resistor, and the loop filter values are for 500 kHz.
\
------0 \------ R1 10k ----------------- pin9 4046
4016 | |
=== C1 |
| |
------ | +5V
| | R3 1M |
===C2 R2 | R4 100 Ohm
| | | |
----------------------------------| +2.5V
|
R5 100 Ohm
|
///
R1 is 10k
R2 is 2 k
So, looking at the loop filter, for 24 Hz (say 25) versus 500 kHz the values need to be 20000x bigger,
so that makes
C1 20000 x 10 nF = 200 uF
C2 20000 x 1nF = 20 uF
When the circuit starts up, without the camera running, or connected, the voltage divider formed by R3 R4
will cause the VCO input of the 4046 to be at 2.5 V, and it should then run exactly at 120 Hz.
The circuit that you call 'debounce', is not that.
It is a one shot pulse generator, it generates a small positive pulse that opens the 4016 switch momentarily:
+5V
| -- +4.3V
R6 1k | |
| | | | | pulse, length set by C3 R7
------------------0--------------------| |-------------------- -- --------------- -0.7V
| | | | |
| C3 | |
0 | |
\ --- R7 10k
|camera switch / \ |
| --- |
| | |
------------------0--------- /// ///
|
///
This 4016 switch connects C1 to the 24 Hz square wave from the divide by 5 counter 7490.
If the oscillator is slow, it will connect mostly during the high part, +5V, and C1 will charge fast for a moment.
If the oscillator is too fast, it will connect mostly during the low part (0V) and C1 will discharge fast.
This assures very fast lock time (10k in 200 uF).
This system *also* assures that when pulses are 'missing' the PLL does not veer of to all the way to a low frequency,
but stays at the last frequency, slowly moving to its free-running frequency because of R3.
One in lock the phase relationship is like this:
-----
| |
| |
------------- ------- sample pulse to 4016 switch
--------------- --------------
| |
| |
------------------------------------------------------------------------- 24 Hz from divide by 5
-
| |
............| | ........ 0 charge current in R1 to C1
| |
| |
--
It is an exact phase lock.
My design is very similar but I need to re design
the loop filter. I have a large C and small R, but I have seen
another design that has a a large R and small C. The lock takes
several seconds tho with the large RC constant. All the wile precious
film is burning through the camera. If I use a smaller RC constant
then the jitter becomes unacceptable.
Another big problem is the loop is locking on the wrong frequency on
the camera. It works fine when I simulate the camera with a
multivibe, but is locking strangely with the camera. I tried a low
pass to filter bounces, it changed the lock frequency, but still not
correct.
The design requires a lock indication so that the operator will know
when the pilot tone is up to pitch so that the movie can be slated.
My fullcoat deck takes about 6 or 7 seconds for the fly wheel to get
up to speed. The pitch is fine on this, but there is bad flutter
until the flywheel is at speed.
I dunno. maybe you can use that other phase comparator in the 4046 as lock indicator?
I see that your design incorporates a debounce. I am interested, but
I am having a little tough time reading the schematic.
Hope the above helps.
In the diagram the C1 can become negative, maybe use 2 caps in opposite direction in series?
None of the components are critical, and I just calculated them using my neural net (brain).
It is a small market, I think, especially these days, with all digital cameras and post processing...
else I could make some for 300$ a piece:-)
Also, I might
suggest I higher frequency for the VCO, I found that it was more
stable at a higher frequency, and no big deal to divide down. Divide
by 80 in the loop, and divide by 32 on the output.
You can try
The frequency cap is smaller, and probably has less tolerance, also versus temperature.
But my experienced with the original 4046 and the 74HC4046 are really good any ways,
I always keep some in stock for projects.
Although these day PICs make big inroads
But it is hard to beat an analog PLL in some applications.
I am friends with a guy that deals with a lot of pros that shoot small
gauge film, and I might be able to incorporate this with some software
and a PCM recorder. Right now, I am just trying to get my camera to
play with my full coat deck.
Chris
@ Jan
I have the schematic taken from your drawing with the corrections that
you indicate. I cannot read the ascii drawings my newsgroup reader
does not use a fixed width font, so they are mangled on this end.
Here is a link to my copy of your schematic. I am missing a couple of
component values.
http://chrismaness.com/backend/spice_simulation/IMG_3009.jpg
Thanks,
Chris Maness
Chris
Guest
Wed Mar 10, 2010 2:07 am
On Mar 6, 5:02 am, Jan Panteltje <pNaonStpealm...@yahoo.com> wrote:
Quote:
On a sunny day (Fri, 5 Mar 2010 19:55:12 -0800 (PST)) it happened Chris
christopher.man...@gmail.com> wrote in
33f8f59c-4242-428f-8226-d0c6866ce...@a10g2000pri.googlegroups.com>:
Something like this will be less then 300$:
ftp://panteltje.com/pub/24_to_60Hz_PLL_img_1847.jpg
the way this is supposed to work is:
the camera contact produces a short pulse that opens the 4015 6swicth.
That samples the 24 Hz and the system will stabilise so the camara pulse > >is centered
around an edge of that 24 Hz waveform.
The 4046 runs at 120 Hz, set for exactly 120 Hz with no camera active.
The 7490 has a divide by 2 and a divide by 5, and makes 24 Hz and 60 Hz f> >rom the 120 Hz.
Note the loop filter values.
This is not your normal PLL system, but my own invention.
Before you invest years in learning to program PICs,
maybe you could try this first:-)
I have not tried it for this, but at a slightly higher frequency with dif> >ferent dividers
for in a data separator,
Extremely stable over a wide range.
Just a quick sketch too, not checked for errors.
I am interested since I already have the parts. What do you think the
lock time would be?
Some remarks to that diagram, I forgot a resistor, and the loop filter values are for 500 kHz.
\
------0 \------ R1 10k ----------------- pin9 4046
4016 | |
=== C1 |
| |
------ | +5V
| | R3 1M |
===C2 R2 | R4 100 Ohm
| | | |
----------------------------------| +2.5V
|
R5 100 Ohm
|
///
R1 is 10k
R2 is 2 k
So, looking at the loop filter, for 24 Hz (say 25) versus 500 kHz the values need to be 20000x bigger,
so that makes
C1 20000 x 10 nF = 200 uF
C2 20000 x 1nF = 20 uF
When the circuit starts up, without the camera running, or connected, the voltage divider formed by R3 R4
will cause the VCO input of the 4046 to be at 2.5 V, and it should then run exactly at 120 Hz.
The circuit that you call 'debounce', is not that.
It is a one shot pulse generator, it generates a small positive pulse that opens the 4016 switch momentarily:
+5V
| -- +4.3V
R6 1k | |
| | | | | pulse, length set by C3 R7
------------------0--------------------| |-------------------- -- --------------- -0.7V
| | | | |
| C3 | |
0 | |
\ --- R7 10k
|camera switch / \ |
| --- |
| | |
------------------0--------- /// ///
|
///
This 4016 switch connects C1 to the 24 Hz square wave from the divide by 5 counter 7490.
If the oscillator is slow, it will connect mostly during the high part, +5V, and C1 will charge fast for a moment.
If the oscillator is too fast, it will connect mostly during the low part (0V) and C1 will discharge fast.
This assures very fast lock time (10k in 200 uF).
This system *also* assures that when pulses are 'missing' the PLL does not veer of to all the way to a low frequency,
but stays at the last frequency, slowly moving to its free-running frequency because of R3.
One in lock the phase relationship is like this:
-----
| |
| |
------------- ------- sample pulse to 4016 switch
--------------- --------------
| |
| |
------------------------------------------------------------------------- 24 Hz from divide by 5
-
| |
............| | ........ 0 charge current in R1 to C1
| |
| |
--
It is an exact phase lock.
My design is very similar but I need to re design
the loop filter. I have a large C and small R, but I have seen
another design that has a a large R and small C. The lock takes
several seconds tho with the large RC constant. All the wile precious
film is burning through the camera. If I use a smaller RC constant
then the jitter becomes unacceptable.
Another big problem is the loop is locking on the wrong frequency on
the camera. It works fine when I simulate the camera with a
multivibe, but is locking strangely with the camera. I tried a low
pass to filter bounces, it changed the lock frequency, but still not
correct.
The design requires a lock indication so that the operator will know
when the pilot tone is up to pitch so that the movie can be slated.
My fullcoat deck takes about 6 or 7 seconds for the fly wheel to get
up to speed. The pitch is fine on this, but there is bad flutter
until the flywheel is at speed.
I dunno. maybe you can use that other phase comparator in the 4046 as lock indicator?
I see that your design incorporates a debounce. I am interested, but
I am having a little tough time reading the schematic.
Hope the above helps.
In the diagram the C1 can become negative, maybe use 2 caps in opposite direction in series?
None of the components are critical, and I just calculated them using my neural net (brain).
It is a small market, I think, especially these days, with all digital cameras and post processing...
else I could make some for 300$ a piece:-)
Also, I might
suggest I higher frequency for the VCO, I found that it was more
stable at a higher frequency, and no big deal to divide down. Divide
by 80 in the loop, and divide by 32 on the output.
You can try
The frequency cap is smaller, and probably has less tolerance, also versus temperature.
But my experienced with the original 4046 and the 74HC4046 are really good any ways,
I always keep some in stock for projects.
Although these day PICs make big inroads
But it is hard to beat an analog PLL in some applications.
I am friends with a guy that deals with a lot of pros that shoot small
gauge film, and I might be able to incorporate this with some software
and a PCM recorder. Right now, I am just trying to get my camera to
play with my full coat deck.
Chris
@ Jan
I have the schematic taken from your drawing with the corrections that
you indicate. I cannot read the ascii drawings my newsgroup reader
does not use a fixed width font, so they are mangled on this end.
Here is a link to my copy of your schematic. I am missing a couple of
component values.
http://chrismaness.com/backend/spice_simulation/IMG_3009.jpg
Thanks,
Chris Maness
JosephKK
Guest
Wed Mar 10, 2010 6:19 am
On Tue, 9 Mar 2010 16:07:57 -0800 (PST), Chris <christopher.maness_at_gmail.com> wrote:
Quote:
On Mar 6, 5:02 am, Jan Panteltje <pNaonStpealm...@yahoo.com> wrote:
On a sunny day (Fri, 5 Mar 2010 19:55:12 -0800 (PST)) it happened Chris
christopher.man...@gmail.com> wrote in
33f8f59c-4242-428f-8226-d0c6866ce...@a10g2000pri.googlegroups.com>:
Something like this will be less then 300$:
ftp://panteltje.com/pub/24_to_60Hz_PLL_img_1847.jpg
the way this is supposed to work is:
the camera contact produces a short pulse that opens the 4015 6swicth.
That samples the 24 Hz and the system will stabilise so the camara pulse >> >is centered
around an edge of that 24 Hz waveform.
The 4046 runs at 120 Hz, set for exactly 120 Hz with no camera active.
The 7490 has a divide by 2 and a divide by 5, and makes 24 Hz and 60 Hz f>> >rom the 120 Hz.
Note the loop filter values.
This is not your normal PLL system, but my own invention.
Before you invest years in learning to program PICs,
maybe you could try this first:-)
I have not tried it for this, but at a slightly higher frequency with dif>> >ferent dividers
for in a data separator,
Extremely stable over a wide range.
Just a quick sketch too, not checked for errors.
I am interested since I already have the parts. What do you think the
lock time would be?
Some remarks to that diagram, I forgot a resistor, and the loop filter values are for 500 kHz.
\
------0 \------ R1 10k ----------------- pin9 4046
4016 | |
=== C1 |
| |
------ | +5V
| | R3 1M |
===C2 R2 | R4 100 Ohm
| | | |
----------------------------------| +2.5V
|
R5 100 Ohm
|
///
R1 is 10k
R2 is 2 k
So, looking at the loop filter, for 24 Hz (say 25) versus 500 kHz the values need to be 20000x bigger,
so that makes
C1 20000 x 10 nF = 200 uF
C2 20000 x 1nF = 20 uF
When the circuit starts up, without the camera running, or connected, the voltage divider formed by R3 R4
will cause the VCO input of the 4046 to be at 2.5 V, and it should then run exactly at 120 Hz.
The circuit that you call 'debounce', is not that.
It is a one shot pulse generator, it generates a small positive pulse that opens the 4016 switch momentarily:
+5V
| -- +4.3V
R6 1k | |
| | | | | pulse, length set by C3 R7
------------------0--------------------| |-------------------- -- --------------- -0.7V
| | | | |
| C3 | |
0 | |
\ --- R7 10k
|camera switch / \ |
| --- |
| | |
------------------0--------- /// ///
|
///
This 4016 switch connects C1 to the 24 Hz square wave from the divide by 5 counter 7490.
If the oscillator is slow, it will connect mostly during the high part, +5V, and C1 will charge fast for a moment.
If the oscillator is too fast, it will connect mostly during the low part (0V) and C1 will discharge fast.
This assures very fast lock time (10k in 200 uF).
This system *also* assures that when pulses are 'missing' the PLL does not veer of to all the way to a low frequency,
but stays at the last frequency, slowly moving to its free-running frequency because of R3.
One in lock the phase relationship is like this:
-----
| |
| |
------------- ------- sample pulse to 4016 switch
--------------- --------------
| |
| |
------------------------------------------------------------------------- 24 Hz from divide by 5
-
| |
............| | ........ 0 charge current in R1 to C1
| |
| |
--
It is an exact phase lock.
My design is very similar but I need to re design
the loop filter. I have a large C and small R, but I have seen
another design that has a a large R and small C. The lock takes
several seconds tho with the large RC constant. All the wile precious
film is burning through the camera. If I use a smaller RC constant
then the jitter becomes unacceptable.
Another big problem is the loop is locking on the wrong frequency on
the camera. It works fine when I simulate the camera with a
multivibe, but is locking strangely with the camera. I tried a low
pass to filter bounces, it changed the lock frequency, but still not
correct.
The design requires a lock indication so that the operator will know
when the pilot tone is up to pitch so that the movie can be slated.
My fullcoat deck takes about 6 or 7 seconds for the fly wheel to get
up to speed. The pitch is fine on this, but there is bad flutter
until the flywheel is at speed.
I dunno. maybe you can use that other phase comparator in the 4046 as lock indicator?
I see that your design incorporates a debounce. I am interested, but
I am having a little tough time reading the schematic.
Hope the above helps.
In the diagram the C1 can become negative, maybe use 2 caps in opposite direction in series?
None of the components are critical, and I just calculated them using my neural net (brain).
It is a small market, I think, especially these days, with all digital cameras and post processing...
else I could make some for 300$ a piece:-)
Also, I might
suggest I higher frequency for the VCO, I found that it was more
stable at a higher frequency, and no big deal to divide down. Divide
by 80 in the loop, and divide by 32 on the output.
You can try
The frequency cap is smaller, and probably has less tolerance, also versus temperature.
But my experienced with the original 4046 and the 74HC4046 are really good any ways,
I always keep some in stock for projects.
Although these day PICs make big inroads
But it is hard to beat an analog PLL in some applications.
I am friends with a guy that deals with a lot of pros that shoot small
gauge film, and I might be able to incorporate this with some software
and a PCM recorder. Right now, I am just trying to get my camera to
play with my full coat deck.
Chris
@ Jan
I have the schematic taken from your drawing with the corrections that
you indicate. I cannot read the ascii drawings my newsgroup reader
does not use a fixed width font, so they are mangled on this end.
Here is a link to my copy of your schematic. I am missing a couple of
component values.
http://chrismaness.com/backend/spice_simulation/IMG_3009.jpg
Thanks,
Chris Maness
It is not fun and it has to be done each time, but Google groups can be made to behave.
Goto page Previous 1, 2, 3, 4 Next