Basic Stamp

ks,

ore

lve

as

d of

ight

o

Take

o

an easy

There is a design to output 24Hz pulses of a 1000Hz tone to tape. This is more intended as a marker for when the camera is running and when it is not, but I would imagine that it could be used to resolve the sound.

For my specific application. The 60Hz pulse can be used to drive an inverter to my fullcoat deck that runs from a sync motor. That is why I need it on the spot.

On the other hand, sampling the 24Hz at 1.44KHz

I was thinking of having an algorithm that measured the freq. every second and using that number to divide a high freq. reference. I am interested in your version.

Chris

Reply to
Chris
Loading thread data ...

Doable. There is a nice capability in the MSP430 to tweak it's internal clock around over quite a range. I've used this (and you need to do some sit-down time to work though the details, well) to synchronize the internal cpu clock rate to an external 60Hz zero-cross detector. It would lock quite well. The CPU rate might be operating at quite a high clock, by comparison -- say 6 to 8 MHz, but if you do this right that DCO will be very closely locked to your 24Hz signal and will track it extremely closely. You can anticipate when and calculate a phase value that is used to make small adjustments to the DCO so that it continues to predict extremely well and thus provides you with a very easily dividable high frequency clock source that is tied directly so that you know exactly how many counts there are between

24Hz events and can set your timers for precise relative phases. Which means an easy shot at generating 60Hz tied tightly to the 24Hz. They are cheap and small and do not need an external crystal for this, either. And will power off of almost nothing.

If you want, I'd be happy to program one up for you. I've already paid the price of learning how to make all this work pretty well and would just steal that code and make some mods. I'd probably take on of the small FET boards (they cost me about $3.50 each and include an LED, a processor,

2-wire programming interface, and some plated through holes for wiring to them, and you could use that as a test fixture to try out the idea.

Your call.

Jon

Reply to
Jon Kirwan

z

orks,

more

solve

was

end of

might

do

=A0Take

z

to

e an easy

a

Why bother? For example, a $2 PIC (Atmega32u2) can compare signals several hundred thousand times per second.. You can setup the internal timer interrupt at 60Hz and sync it up with the rising edge of the 24Hz signal. The whole program can be done in 1 or 2 pages of code. This PIC includes a USB bootloader for loading complied codes with WinAVR. The compiler is free and the programmer is free. I am a free loader.

Reply to
linnix

resources hungry.

Just write code to initialize and make an LED flash at a visible rate. The rest is easy...

Reply to
Spehro Pefhany

On a sunny day (Fri, 05 Mar 2010 13:12:55 -0800) it happened Tim Wescott wrote in :

As we play with electrons, and those are so small we cannot see them, we will always need some instrument. A digital voltmeter on a PIC output does give a nice voltage depending on the duty cycle though. If you play with the PLL in the audio range, you can get a lot of info by feeding it into an amp. Even for higher frequencies by AC coupling the error voltage into an audio amp... etc etc. All tricks I have used. A 4046 makes a great audio FM modulator and demodulator too.

Reply to
Jan Panteltje

s
,
e
e

of

ht

ke

easy

esources hungry.

Or something like this:

loop() { // sample 24Hz input now =3D ACSR & (1

Reply to
linnix

On a sunny day (Fri, 5 Mar 2010 13:30:26 -0800 (PST)) it happened Chris wrote in :

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 from 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 different dividers for in a data separator, Extremely stable over a wide range. Just a quick sketch too, not checked for errors.
Reply to
Jan Panteltje

re

ve

s

is centered

rom the 120 Hz.

ferent dividers

I am interested since I already have the parts. What do you think the lock time would be? 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 see that your design incorporates a debounce. I am interested, but I am having a little tough time reading the schematic. 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.

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

Reply to
Chris

@linnix

p.s.

One more thing. I am really interested in what you did for your debounce. I was planning on using a NE555 in monostable mode for 20ms pulse to clean up the debounce. I was also planning on using a NE555 in mono for 60ms to latch and stay on as long as there is input into the converter box, but shut the loop down when there is no input. I do not want pulses going to the tape deck when the movie camera is not running.

Regards,

and thanks a ton all of you guys, Chris Maness

Reply to
Chris

For debouncing, you can just wait a few msec after the loop, or just do some other processings.

Atmel's PIC (Programmable IC) with crystal is far more accurate than the 555.

So, limit the timer interrupt free-running counts.

Since you want a square output, use 120Hz timer interrupt.

Revised code:

loop() { // Analog comparator sample 24Hz input now =3D ACSR & (1

Reply to
linnix

resources hungry.

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.

Reply to
Bitrex

On a sunny day (Fri, 5 Mar 2010 19:55:12 -0800 (PST)) it happened Chris wrote in :

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.

I dunno. maybe you can use that other phase comparator in the 4046 as lock indicator?

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:-)

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.

Reply to
Jan Panteltje

ris

ks,

ore

lve

as

d of

ight

o

Take

o

an easy

resources hungry.

e
e

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 =3D input // PD3 =3D output // PD6 =3D locked

main() { PORTD =3D (1

Reply to
linnix

se =3D

z f=3D

dif=3D

lues are for 500 kHz.

=A0|

=A0|

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0+5V

R3 1M =A0 =A0 =A0 =A0 =A0 =A0 =A0 |

=A0| =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 R4 100 Ohm

| =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |

---------| +2.5V

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 R5 100 Ohm

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0///

ues need to be 20000x bigger,

voltage divider formed by R3 R4

un exactly at 120 Hz.

t opens the 4016 switch momentarily:

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 -- =A0=

+4.3V

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0|

=A0 =A0| | =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0| puls= e, length set by C3 R7

=A0 -- =A0 =A0--------------- -0.7V

=A0 =A0 | | =A0 =A0 =A0 =A0 | =A0 =A0 =A0 |

=A0 =A0 =A0 =A0 C3 =A0 =A0 =A0| =A0 =A0 =A0 |

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A0 =A0 |

=A0 =A0 =A0 =A0 =A0 =A0 =A0 --- =A0 =A0 =A0R7 10k

=A0 =A0 =A0 =A0 / \ =A0 =A0 =A0|

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0--- =A0 =A0 =A0|

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A0 =A0 |

=A0/// =A0 =A0 ///

5 counter 7490.
5V, and C1 will charge fast for a moment.

=A0(0V) and C1 will discharge fast.

t veer of to all the way to a low frequency,

ncy because of R3.

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 --------------

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 |

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 |

-------------------------------- 24 Hz from divide by 5

k indicator?

irection in series?

neural net (brain).

meras and post processing...

s temperature.

d any ways,

@ 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

Reply to
Chris

Look up PICAXE. Very similar thing. $5 to $20 per unit.

formatting link

Reply to
David Eather

=20

C,=20

So just perzactly what kit did you use? Requiring minds want to know.

Reply to
JosephKK

works,

more

resolve

was

friend of

might

do

=A0Take

to

an easy

a

Linnix, Chris is trying to build the point of recoordination, not defer = it further.

Reply to
JosephKK

rks,

more

olve

was

nd of

might

do

=A0Take

to

an easy

a

t 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

Reply to
Chris

rks,

more

olve

was

nd of

might

do

=A0Take

to

an easy

a

t 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 =3D output

#include

main() { PORTD =3D (1

Reply to
linnix

JosephKK wibbled on Sunday 07 March 2010 23:22

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.
Reply to
Tim Watts

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.