Quick noob question. I am needing to run two instances of the function generator, different frequencies different pins. I assume I will have to run them in different cogs? From Spin how do I control the objects from the main process? I need to change frequency and level on the fly.
First of all I just want to say welcome to the forums OldFartRadioman!
I'm sorry that I'm not responding very fast these days, but I am not be very active in the Propeller community at the moment. I must say that I am little bit surprised that no one else has responded to your comment?!
You seem to have solved your issues without any help, so I guees everything is working out the way you want.(or?)
So what are you building with Prop? (I guess it has something to do with radio)
Thanks for the reply. Better in the long run to dig in figure it out on your own. Yes on the radio, this sequence of tones should key a base radio remotely and then wake up some firemen. Tried pointing both instances of pfg to the same output pins and it worked but sounded better mixing two pins external. Next project is to wrap a UI around it and put it in a little box to live in my tool bag. I am going to try to put a Tychon Forth wrapper around pfg to play with it interactively.
Hi Ahle2/Johannes,
thank you for posting your great generator. I need a generator, that can send out bursts 3...100 cycles of sine waves with f=20....20kHz. The switch on/off must be at zero-crossing.
I tried to understand your generator, but got completely lost. I can read asm a little bit. Would you mind to explain a little bit? How/When are the parameters read? What exactly do the two timers? I wanted to insert a few lines of code to switch on/off at zero-crossing depending on an additional parameter.
Christof
Sorry, the page you're attempting to access can no longer be found.
If you were attempting to reach a project located on the previous Propeller Object Exchange you will discover that your old links no longer function, and we apologize for any inconvenience this may have caused. We will create redirects for some of the more frequented project pages.
Please try out the new site to locate your projects, if you were the owner of the project then a link will appear in your user account, else use the categories to find objects of interest.
Sorry, the page you're attempting to access can no longer be found.
If you were attempting to reach a project located on the previous Propeller Object Exchange you will discover that your old links no longer function, and we apologize for any inconvenience this may have caused. We will create redirects for some of the more frequented project pages.
Please try out the new site to locate your projects, if you were the owner of the project then a link will appear in your user account, else use the categories to find objects of interest.
Publison - Thank you for the link to the old OBEX. I didn't know it was still around.
Perhaps Parallax should provide the link to the old OBEX in the new OBEX splash page while the objects are migrating(?)
Publison - Thank you for the link to the old OBEX. I didn't know it was still around.
Perhaps Parallax should provide the link to the old OBEX in the new OBEX splash page while the objects are migrating(?)
Propeller Signal Generator was a huge help in cranking something out in a hurry yesterday. Many thanks to Ahle2 for making it available. PSG does a great job of leveraging the capabilities of the Prop.
Sine wave output was applied to audio power amplifier. Amplifier output drove primary of line-output transformer. Output of transformer was applied to voltage multiplier stack.
I loved the ability to sweep frequency smoothly, without discontinuity. Also, the high sample rate made filtering easy and preserved amplitude stability.
I'd been looking at a variety of more expensive solutions when I realized this one was right in front of my face and could be arranged in a moment.
The code was wonderfully easy to use, but the simplicity belied the cleverness within. Took me a bit of time to understand how you managed the whole affair!
Cool! It's nice to hear that something I wrote can enable others to achieve good results with little efftort.
PASM coding is ALL about trickery. It's just too fun!
The Retronitus engine for an example, uses a lot of tricks to achieve high sample rate and a lot of features in just under 2k. Much development time went into trickery and magic. Actually, I was forced to use trickery because I often ran out of code space and/or the sample rate was not as high as I wanted.
This outputs the following square wave. Every other cycle the on or off period changes. Any ideas why its not 50% every cycle? This seems to happen regardless of the frequency.
At 100 kHz one period is just 12.5 samples. If you generate a frequency not a multiple of the 1.25 Mhz sample rate used by PSG you will have this issue. The higher the generated frequency is the bigger the aliasing error will be. Real signal generators operates at Ghz sample rates and therfore the aliasing issue is much less obvious.
It seems like you want to generate a pure square wave and nothing fancy. In your case I would use one of the other objects that use the counter in PLL mode to generate an aliasing free square wave.
I have 100 ohm resistors on the pins of the propeller chip from the Propeller Education Kit. I am using the Bit Scope Micro connected to a Raspberry Pi 2B+ to view the signal. I connected the ground from the Bit Scope Micro to the ground of the Education Kit. The sine wave is quite distorted. I am use to using Tektonix o'scopes to troubleshoot radios. This 1khz signal does not look like a beautiful clean 1khz signal directly from the AWG on the Bit Scope or the ones I have seen while troubleshooting radios. Any suggestions? My goal is to troubleshoot 2 broken DC to DC converters; the signals going into and out of the PWM IC.
Comments
I'm sorry that I'm not responding very fast these days, but I am not be very active in the Propeller community at the moment. I must say that I am little bit surprised that no one else has responded to your comment?!
You seem to have solved your issues without any help, so I guees everything is working out the way you want.(or?)
So what are you building with Prop? (I guess it has something to do with radio)
/Johannes
thank you for posting your great generator. I need a generator, that can send out bursts 3...100 cycles of sine waves with f=20....20kHz. The switch on/off must be at zero-crossing.
I tried to understand your generator, but got completely lost. I can read asm a little bit. Would you mind to explain a little bit? How/When are the parameters read? What exactly do the two timers? I wanted to insert a few lines of code to switch on/off at zero-crossing depending on an additional parameter.
Christof
One parameter is read every sample. That way adding more parameters will not eat extra cycles.
Psuedo
They are used as "duty DACs"; One for the normal signal and one for the inverted signal.
That is, of course, possible to do. It may be needed to make the code twice as big and half the sample rate. Is that acceptable?
http://obex.parallax.com/objects/872/
404 - Page Not Found
Sorry, the page you're attempting to access can no longer be found.
If you were attempting to reach a project located on the previous Propeller Object Exchange you will discover that your old links no longer function, and we apologize for any inconvenience this may have caused. We will create redirects for some of the more frequented project pages.
Please try out the new site to locate your projects, if you were the owner of the project then a link will appear in your user account, else use the categories to find objects of interest.
Use the old OBEX http://obexclassic.parallax.com/objects/872/. Looks like 1.2 is the latest version.
I'm finding a few objects are missing in the new OBEX.
Perhaps Parallax should provide the link to the old OBEX in the new OBEX splash page while the objects are migrating(?)
Perhaps Parallax should provide the link to the old OBEX in the new OBEX splash page while the objects are migrating(?)
May I ask what you used it for?
/Johannes
High voltage power supply.
Sine wave output was applied to audio power amplifier. Amplifier output drove primary of line-output transformer. Output of transformer was applied to voltage multiplier stack.
I loved the ability to sweep frequency smoothly, without discontinuity. Also, the high sample rate made filtering easy and preserved amplitude stability.
I'd been looking at a variety of more expensive solutions when I realized this one was right in front of my face and could be arranged in a moment.
The code was wonderfully easy to use, but the simplicity belied the cleverness within. Took me a bit of time to understand how you managed the whole affair!
PASM coding is ALL about trickery. It's just too fun!
The Retronitus engine for an example, uses a lot of tricks to achieve high sample rate and a lot of features in just under 2k. Much development time went into trickery and magic. Actually, I was forced to use trickery because I often ran out of code space and/or the sample rate was not as high as I wanted.
/Johannes
psg.setParameters(psg#SQUARE, 100000, 0, psg#PW50)
This outputs the following square wave. Every other cycle the on or off period changes. Any ideas why its not 50% every cycle? This seems to happen regardless of the frequency.
NewFile9.bmp
NewFile10.bmp
NewFile11.bmp
NewFile12.bmp
At 100 kHz one period is just 12.5 samples. If you generate a frequency not a multiple of the 1.25 Mhz sample rate used by PSG you will have this issue. The higher the generated frequency is the bigger the aliasing error will be. Real signal generators operates at Ghz sample rates and therfore the aliasing issue is much less obvious.
It seems like you want to generate a pure square wave and nothing fancy. In your case I would use one of the other objects that use the counter in PLL mode to generate an aliasing free square wave.
/Johannes
Great Object BTW.
Thank you