help with frequency tracker and generator
Anubisbot
Posts: 112
Hi, i am working on a solid state tesla coil what should run at 4Mhz .
I want to use the propeller to generate the differential 4 Mhz pulse to drive 2 BC 546 to beaf it up to drive 2 bigger mosfets in push pull mode.
And i want it to be self tuned, so i need to track the resonance frequency of the secondary coil with a antenna..
Would be spin good to use , or is it to slow to change the PLL frequency on the fly?
And if i have to us e PASM, could some one help me with the code since i never wrote any PSAM [noparse]:([/noparse]
Any help or ideas are welcome and would help big times......
Post Edited (Anubisbot) : 9/6/2008 6:32:39 PM GMT
I want to use the propeller to generate the differential 4 Mhz pulse to drive 2 BC 546 to beaf it up to drive 2 bigger mosfets in push pull mode.
And i want it to be self tuned, so i need to track the resonance frequency of the secondary coil with a antenna..
Would be spin good to use , or is it to slow to change the PLL frequency on the fly?
And if i have to us e PASM, could some one help me with the code since i never wrote any PSAM [noparse]:([/noparse]
Any help or ideas are welcome and would help big times......
Post Edited (Anubisbot) : 9/6/2008 6:32:39 PM GMT
Comments
If you want to determine the resonant frequency of the secondary coil, you don't detect a frequency, you normally detect the power output (or output voltage) which goes up near resonance. Typically, you have a detector coil or nearby antenna followed by a diode and capacitor so you have a simple half-wave rectifier and you measure the voltage across the capacitor, then you tune for peak voltage.
The Propeller can measure voltages easily using one of the cog counters all in Spin. Read the Application Note (AN001) on the use of the cog counters. Download the ADC (analog to digital converter) object from the Object Exchange and read the comments and documentation.
yes i want to use the NOC PWM for the pushpull of the 4MHz , and thank for the tip with the ADC and the voltage peak to mesure.
But what i still dont get is how to set the two pins for the differential output.
I know i have to set mode bits to %00101 but i still dont get how to set the the 2 pins??
would this %00101_000_00000000_011111_000_100000 be the right ctra for differential mode with pin 15 and 16 ??
Best regards
Anubisbot
The BPIN and APIN fields contain the B and A pin numbers with values from %000000 to %011111 for I/O pins 0 to 31.
Please post pictures of your final project or work in progress, I would love to see them.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I will post some pictures later, as soon i have my basic test circuit set up.
But i think i may use the mode %00011 PLL differential , but i still dont get how to calculate the frequency with the PLLDIV
?? Since i am still so new to the propeller i dont get it ??
Do u have a example on how to set the PLL differential mode to 4MHz on pin 15 and 16 ??
And may be a little more simple explanation on how to calculate and set the Frequency??
Best regards Anubisbot
this should give me on pin 15 and 16 a 100.5Khz freq.
And it does it but only on pin 15 (or 16 when i swap 16 and 16 in the dira brackets )
What do i do wrong????
Update :
I found the problem , it was :=1 for the dira
So now i have the generator for my push pull frequency
Next i have to set up the ADC and them i will make a first test run with 12V input and then later with 32V.
I will update the post as soon i have some more news and pictures...
Post Edited (Anubisbot) : 9/6/2008 11:47:13 PM GMT
After all night up, i have figured it out how it works in asm.
So far so good. No i have a stupid question, is it possible to start 2 new cogs with Pasm from the same spin file??? If so how does it work in the the dat section.
If it would be possible i could use the frequency tracker in easy to set the new freq to the parameter variable.???
Or is there another way to link 2 PASM Cogs with each other with a common variable ??
Like always all ideas are welcome, and do help...
Best regards
Anubisbot
Just differentiate each assembly program with an org, and a label that you can use to pass the entry point to the cognew command.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net