Though your intent was to speak to using an MCU to create a sweep generator, the greater extend of the material was a back-to-basic explanation of how to capture a sweep. And, that is e-x-a-c-t-l-y what I needed. I have been fighting a non-existent function generator problem, for a full day. You have provided the pointer required to get me going in the correct direction. So, thank you v-e-r-y much.
To reach the frequency limit of a given hardware a DDS implementation with phase accumulator has different ways to avoid harmonic distortions at low and at high frequencies. The signal is generated by adding a phase per time value (which is the current frequency that is increased over time) in a constant rate to a register called phase accumulator. From there the (modulo-) values are converted to the sine values and given to the output. In this way there is a high resolution at low frequencies which provides low distortion, maybe even with more than 4 bit which is already quite good. At higher frequencies only a few values are provided per period, this number is not restricted to integers and goes down towards the Shannon limit of 2. At these frequencies the signal has a high distortion but the harmonics at these frequencies are out of the regarded band and can be reduced by a fixed low pass filter.
You may be able to turn off the wifi and BLE on the board to help to eliminate some of the null areas by not having the interrupts servicing those peripherals. This might also be interesting to do on a GD32V based board.
Used to be called a wobulator , af and rf. Used to use rf wobulator to aligh receiver if' s . Af ideal also . Can also use a fast DC restorer to give a curve. Instead of an oscilating envolope.
I used ESP32 devices in several products I have designed, but never used the DAC for obvious reasons. For this type of application I'd look at the SAMD21 or the STM32F400 series devices. Also, if you are going to filter the output for a clean sine wave, why do you need more than two levels? And a related thought: I'd be using an internal counter to generate the square wave with the processor intervening from time to time to change the timer parameters.
Look forward to seeing the next step if you continue. BTW, different topic...just curious if the "toy store" you frequent is Excess Solutions? Marc over on "Curious Marc" says it's the last surplus outlet in Silicon Valley...if this is where you go you may have run into him (he has a great channel!).
I would use one of your DDS boards hooked up to an Arduino or similar and just step through the frequencies from start to end. I believe when you do that it is phase continuous but that should probably be checked.
Well, I dinked a bit tonight with that on my DIY AD9833 DDS. It's a start I guess or an early failure, not sure yet :) th-cam.com/video/gf8DMIpP_ZI/w-d-xo.html
I cannot post arduino code in the description due to certain special characters TH-cam will not allow. that means I have to put it on github and that was too much work for just a couple lines of code..
When it was released, the 33120A was considered a "low RF"/audio-frequency function generator similar in niche to the 33250A or the newer 33500/33600 stuff from Keysight - good for audio and high-quality message signals. If you wanted to sweep the broadcast spectrum, you bought an 8000-series signal generator that went to hundreds of megs or even a gig.
Though your intent was to speak to using an MCU to create a sweep generator, the greater extend of the material was a back-to-basic explanation of how to capture a sweep. And, that is e-x-a-c-t-l-y what I needed. I have been fighting a non-existent function generator problem, for a full day. You have provided the pointer required to get me going in the correct direction. So, thank you v-e-r-y much.
To reach the frequency limit of a given hardware a DDS implementation with phase accumulator has different ways to avoid harmonic distortions at low and at high frequencies.
The signal is generated by adding a phase per time value (which is the current frequency that is increased over time) in a constant rate to a register called phase accumulator. From there the (modulo-) values are converted to the sine values and given to the output.
In this way there is a high resolution at low frequencies which provides low distortion, maybe even with more than 4 bit which is already quite good. At higher frequencies only a few values are provided per period, this number is not restricted to integers and goes down towards the Shannon limit of 2. At these frequencies the signal has a high distortion but the harmonics at these frequencies are out of the regarded band and can be reduced by a fixed low pass filter.
You may be able to turn off the wifi and BLE on the board to help to eliminate some of the null areas by not having the interrupts servicing those peripherals. This might also be interesting to do on a GD32V based board.
Used to be called a wobulator , af and rf. Used to use rf wobulator to aligh receiver if' s . Af ideal also . Can also use a fast DC restorer to give a curve. Instead of an oscilating envolope.
I used ESP32 devices in several products I have designed, but never used the DAC for obvious reasons. For this type of application I'd look at the SAMD21 or the STM32F400 series devices. Also, if you are going to filter the output for a clean sine wave, why do you need more than two levels? And a related thought: I'd be using an internal counter to generate the square wave with the processor intervening from time to time to change the timer parameters.
Thanks for this information. I was wondering how to sweep with my Rigol 1054 and am learning more about it all the time. Carl
Look forward to seeing the next step if you continue. BTW, different topic...just curious if the "toy store" you frequent is Excess Solutions? Marc over on "Curious Marc" says it's the last surplus outlet in Silicon Valley...if this is where you go you may have run into him (he has a great channel!).
Yes the last one. It is very sad. I remember in the 80's, a friend and I would spend an entire Saturday visiting all the surplus stores.
I would use one of your DDS boards hooked up to an Arduino or similar and just step through the frequencies from start to end. I believe when you do that it is phase continuous but that should probably be checked.
Well, I dinked a bit tonight with that on my DIY AD9833 DDS. It's a start I guess or an early failure, not sure yet :) th-cam.com/video/gf8DMIpP_ZI/w-d-xo.html
Kewl investigation = thank you.
Great, thank you for educating us. Why not to post the Arduino Code here for users. BTW. I am as well a great fan of the ESP32 series.
I cannot post arduino code in the description due to certain special characters TH-cam will not allow. that means I have to put it on github and that was too much work for just a couple lines of code..
@@IMSAIGuy Pastebin it.
/*
DDS
sync pulse on pin 25
output on pin 26
#########################################################################
###### DON'T FORGET TO UPDATE THE User_Setup.h FILE IN THE LIBRARY ######
#########################################################################
*/
#include // Graphics and font library for ST7735 driver chip
#include
TFT_eSPI tft = TFT_eSPI(); // Invoke library, pins defined in User_Setup.h
#define button0 0
#define button1 35
#define ADC 2 // input pin for ADC
#define DAC1 25 // output DAC
#define DAC2 26 // output DAC
// 8 bit DAC so values 0 to 255
// offset so 0 is 127 +1 is 255 -1 is 0
int sinebits[] = {127, 176, 217, 244, 254, 244, 217, 176, 127, 78, 37, 10, 0, 10, 37, 78};
void setup(void) {
pinMode(button0, INPUT);
pinMode(button1, INPUT);
tft.init();
tft.setRotation(1); // rotate display every 90 degrees 1...3
tft.setTextColor(TFT_GREEN,TFT_BLACK);
tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0, 4); // size 4 font
tft.println("Ramp pin25");
tft.println("Sinewave pin26");
}
void loop() {
dacWrite(DAC1, 255); // high going edge for start sweep
for(int j=0; j
I can post it in a comment but not in the description.
This is why I watch. And now we know why HP made good instruments. BTW, the HP will only sweep to 15 meghertz. Not so good for fm?
When it was released, the 33120A was considered a "low RF"/audio-frequency function generator similar in niche to the 33250A or the newer 33500/33600 stuff from Keysight - good for audio and high-quality message signals. If you wanted to sweep the broadcast spectrum, you bought an 8000-series signal generator that went to hundreds of megs or even a gig.