element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum Signal Generator
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 9 replies
  • Subscribers 469 subscribers
  • Views 775 views
  • Users 0 members are here
  • signal_generator
  • arm;
  • pic
Related

Signal Generator

JohnDSiviter
JohnDSiviter over 15 years ago

I want to build a bench signal generator one day, 0-100MHz, sine, triangular, square, variable M/S ratio etc and want a single chip solution (except for maybe a few optoisolators/buffers), I was thinking about using a fast ARM processor and fast DAC/s, it would also need USB so I can use the PC to program waveforms, what processor would you choose and why?

  • Sign in to reply
  • Cancel
  • michaelkellett
    michaelkellett over 15 years ago

    Use pretty much any processor you like - the cost will be dominated by the FPGA, clock generator/DDS, DAC, reconstruction filter etc.

    You can go out and buy signal generators like this and there is a reason they cost £2000 or more.

     

    To get 100MHz sine wave at reasonable noise and distortion you will need at least 3e8 samples per second, even fast processors can't do IO at that rate so you'll need the FPGA to work the DAC.

     

    Use a processor with the necessary features from the family you are most familiar with.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • JohnDSiviter
    JohnDSiviter over 15 years ago in reply to michaelkellett

    Come on Michael, thats a bit of a cop out image, I cant use pretty much any processor I like because of the 100Mhz problem, I reckon if you get a fast enough processor the actual system is not that difficult to program, high speed DACs might be however....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 15 years ago in reply to JohnDSiviter

    John - you haven't quite got my point - I don't know of ANY processor that can drive a DAC at 300MHz with reasonable jitter. A DAC that fast will probably have LVDS inputs  - an easy interface to an FPGA but not to any processors I know.  Since you will need an FPGA (or other custom logic) the processor doesn't have any demanding real time work to do - so it is not a performance driven decision (at least as far as the signal generation goes). This is the case in a great many real development projects.

     

    You haven't given anything like enough spec details to really drive the processor choice but if I were doing this (on the basis of the limited information) I would use an ARM Cortex, probably one of the STM32F parts, because I am familiar with them so the cost of development would be lower. If you are tooled up for a PIC32 or something else - that would probably do just as well.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Jorge_Garcia
    Jorge_Garcia over 15 years ago in reply to JohnDSiviter

    Hi John,

     

    I've used this type of solution before on a PIC processor so I have a little experience on the subject. I think it's going to be pretty difficult to achieve what you're looking for using fully digital means. Here's the issue, and again this is the way I've done it, perhaps someone can mention a better way.

     

    Basically a produce a PWM waveform at the highest frequency my hardware will allow, or that I deem suitable. The idea is to use the PWM as a DAC. Fourier analysis tells us that a positive square wave (0 - 5V) will have frequency components at odd multiples of the fundamental as well a strong fundamental, additionally since it's a positive square wave we have a DC average value.

     

    It's the DC value that allows us to create arbitrary waveforms. If we vary the pulse width we can vary the DC component, in order to obtain the desired waveform we need to filter out the harmonics, so in order to obtain a clean waveform you'll need probably a filter of 3rd or fourth order.

     

    So basically you program the waveform by modulating the pulse width with the waveform. This method works very well for arbitrary waveforms. In my earlier experiment I got pretty amazing results just using a first order filter( Not the cleanest signals but much better than I expected).

     

    Besides the fact that you have to get a high speed PWM going which you can modify cycle by cycle(Takes one heck of a processor). In order to represent arbitrary waveforms with a high degree of accuracy you would want to be able to have at least 100 points for every period of the waveform. To reproduce one point you need one PWM cycle so If you run your PWM at 100Mhz the highest frequency you could faithfully recreate with this method would be a 1Mhz arbitrary signal.

     

    Following this same reasoning if you wanted to produce an arbitrary signal from 0-100MHz you would need a 10GHz PWM waveform! I'm not aware of too many computers that can run that fast let alone an embedded processor.

     

    Now that I've shattered your will to live, here's the good news. You could cut the 100 points per period minimum to 50 points. You mentioned you only want to create Sine, Triangle, and adjustable Square wave so the ability to create an arbitrary waveform is not really necessary.

     

    Another more feasible solution would be to use PLL which could easily generate a 100MHz Square wave, if you filter it you'll get a 100 MHz sine wave and with some other processing you can get a triangle waveform. I'm not to clear on the details but I believe many commercial units use this method.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • KennyMillar
    KennyMillar over 15 years ago in reply to michaelkellett

    Oooh let me throw a spanner in the works.

    Who says you have to use FPGAs and DACs?

    Good quality signal generators have been around a lot longer than FPGAs and fast DACs.

     

    Here's my suggestion... think outside the box. Do you think there is anyway to generate, say, a 100Mhz sine wave with just a few low cost components? How about square wave? How about triangular?..... (Hint: analogue).

     

    Now, given your circuit which generates the signal, how would you modify the frequency? How about the amplitude?

     

    I bet you could do all that without a processor or DAC in sight....

     

    Now, how could you build that/those circuit(s) and have the frequency and amplitude modified by a micro under software control? (Hint: digital pots).

     

    Am I talking nonsense? Or do you think mixed-signal might be the way to go here?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • JohnDSiviter
    JohnDSiviter over 15 years ago

    Thanks everyone that responded, it seems nothing is as clear cut as you first envisage!,  it does seem however that it is possible to build one using an Intel Atom @ 1.6Ghz or whatever giving a max output of approx 16Mhz...still a nice project for a rainy day, thanks also Kenny this is a case of..oh I have some PICs lets build something rather than me thinking "I could really do with a fast signal generator", as it happens I do need a signal generator, but dont need a terribly fast one for my audio work. Jorge...facinating, wasnt aware of that method!.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Jorge_Garcia
    Jorge_Garcia over 15 years ago in reply to JohnDSiviter

    Hi John,

     

    If this is for audio work, you should have said so. You are WWWAAAAYYYY over specing(?). Humans can hear frequencies from 20- 20000 Hz, so you could build a function generator that produces waveforms up to 100kHz and be golden.

     

    A generator like that could be easily designed using an MCU(For example with a PIC see"Flying the PIC24" by Lucio di Jasio, Chp 9 if memory serves, he uses the PWM DAC method to output the audio stream from an MP3 file).

     

    Kenny's idea is also brilliant and digital pots are very handy components.

     

    Take your pick, but if you're going to do audio work I think the Atom idea is serious overkill. You mentioned you wanted a one chip solution, if memory serves the EXAR XR2206 chip can be used as a decent function generator. I have a kit from another manufacturer that will remain nameless, which used it. Maybe I built it poorly(very likely was in a rush to finish) but I wasn't too impressed by it, but maybe it works for you.

     

    hth,

    Jorge Garcia

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • JohnDSiviter
    JohnDSiviter over 15 years ago in reply to Jorge_Garcia

    I will be using it for other things as well as audio, otherwise like you say you dont need anything higher than 100KHz image, but where would the fun be building just a 100KHz signal gen.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • michaelkellett
    michaelkellett over 15 years ago in reply to JohnDSiviter

    I must defend myself from (implicit) complaints of over engineering !

     

    John asked in his original post about making a 0Hz to 100MHz bench signal generator using a fast processor and DACs - that isn't easy. (BTW -  as far as I know no one uses PWM to generate 100MHz sine waves and it is a very poor technique for high frequency low distortion sine wave generation.)

     

    If the spec is reduced then of course other technologies might be appropriate.

     

    For audio work there is a lot to be said for classic Wein bridge oscillators with thermistor or FET feedback control. (SImple, low cost, low distortion - downside is limited frequency range without switching).

     

    You could make a not bad signal generator with one of the STM32F processors with the built in DAC because it supports DMA to the DAC. You wont be able to get much above 500kHz sample rate but it would be single chip (apart from the reconstruction filter).

    Another approach would be to use an audio DAC (low noise, low distortion, built in reconstruction filter, low cost) with a processor with an I2S port but you won't get over 100kHz out of it. (and it won't be easy to sweep the frequency).

     

    I use lots of different signal generators for different purposes - I don't think there is one design suitable for everything so perhaps you should concentrate on the one you need right now.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube