Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Function Generator using PIC or HC12 Processor - What is a Good Architecture?

Status
Not open for further replies.

Felis_Silvestris

Junior Member level 2
Joined
Dec 27, 2007
Messages
23
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,283
Location
San Jose, CA
Activity points
1,517
I've dabbled a bit with microprocessors and even taught an online course in microprocessor interfacing (which is concerned more with peripherals than coding). However, I do not have any formal training or on the job training (or at home hobbyist training) in microprocessors such as the PIC or HC12. I have written limited code for both in C and assembly.

What I wish to accomplish is to build a robust function generator, but before I begin coding like a madman I would first like to find an architecture.

For now, I'm looking for

  • Frequency Range: mHz ~ 100kHz
  • Stable Waveform (glitch free during normal operation)
  • Square Wave is fine – but need accurate duty cycle settings.
  • The waveform output doesn’t have to be locked to a PLL – but that type of stability would be preferred.


On my own I've considered two architectures (see attached jpg files). Architecture1 uses a function generator type IC that normally interfaces with a microprocessor leaving the microprocessor free to handle the user interface. Architecture2 uses a dedicated microprocessor for waveform generation and a dedicated microprocessor for the user interface.

My concern is producing a very stable waveform robust enough to run like a free running oscillator that has been locked to a PLL and immune user interface interact (other than setting waveform parameters).

My questions are

Does a function generator IC chip designed for uP interfacing (say, via SPI) already exist with its own oscillators and whatnot?

If not then what is a good architecture? My current thoughts are to use two microcontrollers one for waveform generation and the other for controlling the waveform parameters.

Any comments would be much appreciated!

architecture1.jpg
architecture2.jpg
 

If you wanted, you could use a single processor, because 100kHz is quite low, and you could write to a DAC
using an timer interrupt on the microcontroller, and a lookup table; it is known as direct digital synthesis (DDS)
if you want to google it. The DAC could be implemented with some resistors, or an IC.

For a two-device solution, you can use a dedicated DDS chip (Analog Devices has some). In fact, to make
life easier, you can purchase pre-built DDS boards from eBay for very low cost (see image below), which are essentially a DDS chip
from Analog Devices and the bare minimum components needed to bring up the chip. There are a few pins that you
need to connect to your microcontroller.
These chips are capable of frequencies up to tens of MHz or much more, and will support sine and square wave.
dds.jpg
 
Last edited:

If you wanted, you could use a single processor, because 100kHz is quite low, and you could write to a DAC
using an timer interrupt on the microcontroller, and a lookup table; it is known as direct digital synthesis (DDS)
if you want to google it. The DAC could be implemented with some resistors, or an IC.

For a two-device solution, you can use a dedicated DDS chip (Analog Devices has some). In fact, to make
life easier, you can purchase pre-built DDS boards from eBay for very low cost, which are essentially a DDS chip
from Analog Devices and the bare minimum components needed to bring up the chip. There are a few pins that you
need to connect to your microcontroller.
These chips are capable of frequencies up to tens of MHz or much more, and will support sine and square wave.

Yes, I did consider a DDS from Analog Devices. In the past (a decade ago) I've used them for multiple loop PLLs. Perhaps I should have another look, but I did assume they were typically operating in the MHz region. I could probably live with a sine wave output, but I wasn't so sure how I would implement a duty cycle.
 

You can use them for a fraction of a Hertz, so no need to run to MHz if you don't want to.
You could use it to generate a 50% duty cycle square wave.

If you want a square wave with adjustable duty cycle, just use a microcontroller with a
built-in PWM capability (many microcontrollers will have this), no need for any external component.
 

Okay, thanks a lot for the info sky_123

I will try the interrupt method first since I desire a variable duty cycle, but need a stable output. If I feel the need to isolate the processor then I can always move toward a two chip solution.

I have written my own PWM in assembly for the PIC10F206, but I've got other processors with built in PWM as well.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top