I need a recommendation on where to start - Page 1
Forum section: electronics / general

author: Amish_Fighter_Pilot
author_rank: Regular Contributor
timestamp: May 31, 2025, 10:42:13 am
content: Hello. I am considering microcontrollers for the purpose of simplifying my hardware and improving my options. I currently have a radio of sorts that uses two function generators, two mixer boards, a transmitter amp, and a headphone amp. Oh and there's a pocket oscilloscope in there too.I need a microcontroller that is capable of outputting signals up to at least 300KHz, and that can do a variety of waveforms. I'm not sure about replacing the mixers or the amps, but the scope and the function generators would be great to replace. I want something I can set up with a little touch screen and super basic controls and run a couple of programs. Maybe a stripped down Linux of some kind...What would be a good microcontroller type to learn for this purpose?

author: jpanhalt
author_rank: Super Contributor
timestamp: May 31, 2025, 10:47:38 am
content: Have you considered an arbitrary waveform generator?

author: brucehoult
author_rank: Super Contributor
timestamp: May 31, 2025, 11:41:00 am
content: Microcontrollers don't run Linux. Things running Linux are not suitable for things needing precise timing e.g. 300 KHz analogue waveform generation.There are some chips available with one or more Linux cores and also a microcontroller core e.g. the CV1800B/SG2000 in the Milk-V Duo family which have a 1 GHz 64 bit Linux core and a 700 MHz 64 bit microcontroller.Microcontrollers don't generally have analogue outputs, but just PWM with adjustable mark:space ratio. Most don't operate above maybe 50-100 KHzThe STM32F3/G4/H7 with HRTIM can do maybe 10 MHz PWM with ~100 duty cycle steps. Even if you adjust the mark:space ratio on every cycle that's still going to make a far from perfect 300 KHz waveform, even with heavy filtering.

author: Amish_Fighter_Pilot
author_rank: Regular Contributor
timestamp: May 31, 2025, 11:51:17 am
content: Thanks. I was worried about that. Is there some sort of computer a step above microcontroller?

author: Amish_Fighter_Pilot
author_rank: Regular Contributor
timestamp: May 31, 2025, 12:05:40 pm
content: Quote from: jpanhalt on May 31, 2025, 10:47:38 amI have a Chinese FG-200 and love it, but it's kind of large and it isn't computer-controlled. I guess if there was a way to hack it to control it that would be great, but that's probably above my experience level.

author: MarkF
author_rank: Super Contributor
timestamp: May 31, 2025, 12:37:47 pm
content: Quote from: Amish_Fighter_Pilot on May 31, 2025, 12:05:40 pmWhat is you experience/background?Would you be able to build something and program a microcontroller?Here's a link to my function generator I built using a PIC microcontroller and a AD9834 DDS chip:But you could modify it to use an Arduino and build a PCB hat to plug onto it.Re: Looking for <$50 function generatorThe schematic is also there followed by sample waveforms. I limited the output to 1Hz - 10MHz and sine/triangle/freq sweep. A square wave is available but has jitter and is NOT buffered. PWM is also available but is generated by the PIC.

author: jpanhalt
author_rank: Super Contributor
timestamp: May 31, 2025, 12:49:16 pm
content: Re: Small computerThere's a recent thread here on choosing an SBC (single-board computer) that mentions Linux.https://www.eevblog.com/forum/programming/choosing-my-sbc-hardware/That is well beyond anything thing I have done. The alternative mentioned by MarkF sounds attractive and may include code. (I didn't dig into the link.)

author: Amish_Fighter_Pilot
author_rank: Regular Contributor
timestamp: May 31, 2025, 08:09:11 pm
content: Quote from: MarkF on May 31, 2025, 12:37:47 pmMy experience is largely with audio equipment and most of the soldering I have done is of cables for public address systems. I learn fast, but I have extremely limited equipment. I have spent nearly two decades running a cat sanctuary and now that we have less of them around I am trying to repurpose some space so I can finally work on my list of inventions that has been piling up. I have a new type of electric motor I need to build a control circuit for: so I think I'll need to learn the skills needed for a project like this...

author: Amish_Fighter_Pilot
author_rank: Regular Contributor
timestamp: May 31, 2025, 08:12:02 pm
content: Quote from: jpanhalt on May 31, 2025, 12:49:16 pmI see where I was going wrong! I didn't know that SBCs don't fall under the microcontrollers category... Yeah it does sound like what I need is a very low power draw SBC. I don't need a GPU or a lot of CPU power anyway.

author: pcprogrammer
author_rank: Super Contributor
timestamp: May 31, 2025, 09:10:47 pm
content: You can also look into FPGA's to make things happen. You can make a signal generator with them and include the microprocessor for the control if you get one with lots of resources. Something like the Tang Primer 20K for instance.I did a project with an Anlogic FPGA to create a DDS, which can easily be modified to be used on other FPGA's. Seehttps://www.eevblog.com/forum/fpga/why-does-this-dds-code-fail/msg4066636/#msg4066636

author: Amish_Fighter_Pilot
author_rank: Regular Contributor
timestamp: May 31, 2025, 11:22:08 pm
content: FPGA does look like a valid route, but it's definitely outside of my areas of experience. I didn't appreciate how much work it is to replace the FG-200(which can do 750 million different combinations of frequency and waveform). I wonder if I could somehow hack the FG-200 to run it via a SBC or microcontroller. I am scared to crack it open because I am very poor and can't easily replace it right now.

author: MarkF
author_rank: Super Contributor
timestamp: May 31, 2025, 11:23:27 pm
content: Quote from: Amish_Fighter_Pilot on May 31, 2025, 08:09:11 pmSo . . .No programming experience at all?I'm not a big lover of the Arduino lifestyle and normally would not recommend it.However for a total programming noob, an Arduino Uno might be the easiest way to get started. And you would not have to purchase a programmer for loading your firmware. It's intended for beginners and kids and their libraries make things easier. So you don't need to know the internal workings of a microcontroller.Probably the best place to start would be theArduino Uno. Also take a look at some of the Arduino shields (only to understand what a shield is). You could easily build your own PCB shield to plug into it with something like my function generator linked earlier. Although the firmware I wrote is not complex, it would probably be challenging for a beginner.

author: Amish_Fighter_Pilot
author_rank: Regular Contributor
timestamp: June 01, 2025, 12:30:15 am
content: The last programming I did that I would call serious was more than 20 years ago and in college. I think a lot has changed since then. I know the SBCs weren't much of a thing outside of concepts back then!I will do a deep dive into the Uno. I already found a DDS function generator project with it after just a moment of searching. I've seen a couple of SBCs that have a microcontroller on the same board. I wonder if that would be my easiest way to set up a simple touch-screen system that lets me control all different parts from one interface.I suppose it would help if I try to list the exact functions I want it to do at minimum:* - DDS function generator with at least two discrete outputs that can operate simultaneously. I want it to do everything the FG-200 does, but also have programmable sweep functions and most importantly I would like to be able to change through frequencies without stopping the output.* - Control on/off power to all the connected devices and control their power levels* - Replace my Fnirsi DSO510 oscilloscope or provide an interface that allows me to control it* - Waveform analysis and machine learning(I know that's going to be more complicated)* - Programmable high and low pass filtering(not a high priority)I think that's all I need it to do. I guess I'd also replace the AD831 mixers if it can do that too, but I'm not sure how it would.

author: pcprogrammer
author_rank: Super Contributor
timestamp: June 01, 2025, 06:47:08 am
content: The FG-200 uses an ATMEGA16A MCU, at least according to the silk screen, and a R-2R network to generate the signal. Can easily be hacked, but getting the source code might be a problem. Always possible to write your own of course, but the question is also if it is possible to save the original binary.See this video for a tear down.https://youtu.be/wvGFOW2V9Qo?t=1211

author: Amish_Fighter_Pilot
author_rank: Regular Contributor
timestamp: June 01, 2025, 08:39:58 am
content: I checked that out and it's really interesting. I have a newer version of this unit, but mine only has a single output instead of the two channels. It seems like they got a lot of grief for problems with the FG-100(there's a guy on YouTube modding one to make it better), but maybe the FG-200 didn't sell as well because of the reputation of the first unit. So far it has done everything I have asked of it, but they really did not put a very good barrel plug connector on it(it doesn't even fully seat). Maybe I should open it up and film it since it seems like nobody has a video of it yet.Here is a picture of it. I can only speculate that it's a newer version of that FG-100's chipset(ATmega48V). Maybe it's just the same one with the amp problem from the first generation fixed.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 01, 2025, 12:11:15 pm
content: Apologies for the long wall of text! Feel free to skip.Beneath, I describe how I –– just another hobbyist –– would approach this as a do-it-yourself project with a high likelihood of acceptable results based on my experience thus far.One of my hobbies is to use microcontrollers with native USB to add features to Linux-based appliances.For arbitrary signal generation at up to 300 kHz, I'd probably use one of myTeensy 4.0boards, adding suitable digital-to-analog converter using SPI, plus an amplifier (since the DAC voltage range is limited to 0–3.3V or 0–5V and not much current) based on a suitable op-amp.Using the default USB serial without any tricks, it can easily maintain over 20 MBytes/sec in one direction from a program running on the computer (that the Teensy is connected to via USB), because of the native USB 2.0 High Speed port; i.e. theoretical maximum is 480 Mbit/s.(I've done something similar, because I also like to use my microcontrollers as ad-hoc tools: when I need something special or odd, I cobble together one from my microcontrollers and other parts, use it to achieve the task, then take (the expensive parts) apart for reuse in later projects.)As Teensy has a 1 MByte of RAM (yes, several orders of magnitude more than typical Arduinos), it is trivial to create a 16-bit waveform buffer with up to 250,000 samples or so total, or about a quarter of a second long at 1 Msamples/second. As long as the DAC is good enough, Teensy has no problem DMA'ing data from such waveform buffers at up to 100 MHz SPI clock rates, although you do need to make a simple carrier board as at such fast rates, the wiring matters a lot, and just jumper wires on a breadboard may not work. I suppose something like 3 Msamples/second should suffice for 300kHz signals, and typical SPI DACs can maintain that at 48 MHz SPI clock. If you don't mind a bit of latency, then combining the two means you can provide arbitrary length waveforms, only limited by your disk space, at up to say 3 Msamples/second (using about 6 MBytes/second). The files are typically just raw 16-bit signed integer WAV audio files (ignoring their sample rate), so the waveforms can be constructed either by your own programs or in audio editors.Another option is to switch toTeensy 4.1, which has a microSD card socket, and supports up to 16 MBytes of additional PSRAM (for 2×$2.25, you need to solder them yourself), so you could store the waveforms on an SD card (again, as raw WAV files), and generate the waveforms without any computer, standalone. Could add a couple of buttons and a small OLED or TFT (Teensy 4.x have 3 SPI buses) for control –– although OLED displays are electrically noisy, and some strong supply filtering, perhaps a capacitor-inductor-capacitor, would be needed for the DAC and opamp supplies.For the DAC, I'd probably splurge and get aTI DAC8832. It's a 16-bit one, and should be able to reproduce the waveform basically exactly at 1 Msamples/sec; it can do 3.125 Msamples/sec continuously, but the output slew rate limits the achievable maximum frequency, depending on the amplitude, to somewhere above 500 kHz or so. Mouser sells these for about 10€ apiece in singles, JLCPCB charges almost $15 for each using their assembly service, but I think it would be worth it. (The opamp will cost almost as much, too.)It is the output amplification/buffering and sufficient filtering of the DAC supply to avoid digital circuitry noise in the output, that I'd likely stumble on. For bipolar operation (so output would swing below zero too), I would just go with the datasheet suggestion (as outlined in the front page), and ask for further advice and suggestions here. The output signal voltage amplitude range would probably be about ±5V.And, because I'm just a hobbyist, I'd probably also add a TI ISO7740 between the DAC and the microcontroller, powering the isolated side from say a couple of 9V batteries, or suitable LiFePo cells in series (without a DC-DC converter, due to noise that entails). That way, I could connect the DAC "ground" –– 0V reference –– to the target ground or 0V reference, not having to make sure the microcontroller (and the computer) is referenced to the same potential. But also, the digital side can then be powered from any noisy USB powerbank or computer, without adding digital noise to the output analog signal. (So, the actual purpose of that isolation is more a barrier of supply noise, the DAC end powered by a battery or similar very-low-noise source; allowing the output reference to vary a couple of hundred volts from the host or Teensy "ground" reference is just a cherry on top of the cake.)It isn't an off-the-shelf solution by any means, but I do claim it is well within the capabilities of a hobbyist willing to learn. Experimenting with Teensies in the Arduino/Teensyduinoenvironment –– Teensies have all sorts of nice additions compared to the "bare" Arduino environment –– and then learning enough electronics to cobble this together would definitely be an adventure, but one that I think anyone with enough motivation can do. As to schematics and simple boards, I do recommend taking a look atEasyEDA online schematic and PCB editor: it is easy for us hobbyists to learn, but is also coupled to JLCPCB board manufacturing (and assembly) and LCSC parts catalog. You can find a lot of designs atoshwlab.com(it's where you can "publish" your EasyEDA projects), and open most of them in EasyEDA. You can see minehere; as you can tell, I too am just a hobbyist, and still have lots to learn –– all my designs can definitely be done better.

author: NorthGuy
author_rank: Super Contributor
timestamp: June 01, 2025, 01:21:19 pm
content: If you're to build DDS, 300 kHz bandwidth is not that much, and depends mostly on the speed of the DAC you use. Other than that you need an MCU with DMA which can update the DAC fast enough. The update rate should be somewhat faster than the bandwidth, a few MHz or more. You need exact numbers for required DAC speed and update rate. Without the exact numbers discussing anything is completely pointless.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: June 01, 2025, 03:18:08 pm
content: STM32G431 has 4 12-bit DAC channels that can run up to 15MSPS. There are also some example projects on github for running DDS algorithms (with R-2R) on the older STM32F103 (Without DAC). Is it within your reach to port that software to the other processor? I think the STM32G431 should be able to generate DDS output up to 2 or 3MHz. That would be a quite nice single chip solution. Just add voltage regulator, opamps, output stage etc to increase the chip count.And there are faster microcontrollers available 600MHz is no exception for microcontrollers these days.With this search:https://html.duckduckgo.com/html?q=STM32G431+%2BddsI find:https://blog.csdn.net/gitblog_09777/article/details/143125169And thanks to the built in translator in Firefox, I can read:STM 32 F407 uses built-in DAC+DMA+TIM to produce DDS signal sourcesbut following the link leads to a login screen for some site I don't have an account for.But this was a 2 minute search. I bet you can do better if you put some effort into it.

author: Amish_Fighter_Pilot
author_rank: Regular Contributor
timestamp: June 01, 2025, 08:01:32 pm
content: I went ahead and opened up the FG-200 this morning and I was extremely surprised by what I found. The FG-100 has an ATmega48V in it, but this new one is way different. In place of the old chip is a tiny square chip that they have conveniently sanded the writing off of....First off the display and it's electronics are significantly different than the FG-100The back of the board is pretty simple

author: pcprogrammer
author_rank: Super Contributor
timestamp: June 02, 2025, 06:53:53 am
content: Quote from: Amish_Fighter_Pilot on June 01, 2025, 08:01:32 pmTrace out the connections to the small square chip, like on what pins the crystal is connected and the power supply pins. Also look at where the not installed 4 pin header is connected to, as this might be a way to program the chip.With this information you can compare it to chips that come in this package, but there is a good change that it is an Atmel ATMEGAxxx chip, so looking at the datasheets of these is a good place to start.

author: Sacodepatatas
author_rank: Regular Contributor
timestamp: June 03, 2025, 01:47:22 am
content: Quote from: Doctorandus_P on June 01, 2025, 03:18:08 pmThis appnote can be useful.https://www.st.com/resource/en/application_note/an4566-how-to-extend-the-dac-performance-on-stm32-mcus-stmicroelectronics.pdfFurthermore, the cheapest MCU that has 2 simultaeous DACs is indeed a fake bluepill based on a high density F103 being sold for around 1€ (the original MCU has not DACs because is of medium density type).https://a.aliexpress.com/_EQSBRma

author: RobinD
author_rank: Newbie
timestamp: June 30, 2025, 01:31:00 pm
content: I've just been testing my FG-200 DDS. It's a pretty solid piece of equipment , obviously better than the FG-100. Still no sweep function , which is a real bummer.Maybe someone will be brave enough to reverse engineer / re-write some code for this chip. Can't see what it is , but it's probably one of the newer Amegas.Could probably narrow it down by looking at the layout of the xtal / reset etc.