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.

programmable circuit design

Status
Not open for further replies.

spartekus

Member level 5
Joined
May 27, 2010
Messages
81
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Duisburg, Germany
Activity points
1,918
Hi,

Can anyone have idea, how can we make a circuit, that is programmable frequency generator.
for example, if user send command "a3" to microprocessor, then amplitude will be 2volt.
or if user send command "f2000000" then frequency will be 2mhz.

if i want to design such circuit, how should i start?
what should i know about microprocessor programming?

thanks
 

To generate any analog signal with a microprocessor requires some form of Digital to Analog(D/A) converter. Many micro development kits provide a D/A converter as part of the hardware. In the simplest form this device is accessed as either an I/O port or a memory location in the address space of micro. Writing a value to the device causes that value to be converted into an analog voltage at the output of the D/A. Generating a signal (be it a sine wave or whatever other waveform) is simply a matter of rapidly changing the values fed to the D/A to generate the waveform. The values you want to output can be stored in a table to be able to output them more rapidly. Different tables can be used for different waveform shapes. Varying voltage is simply a matter of changing the magnitude of the values. Varying frequency is simply a matter of calculating the rate you must send the values to the D/A.

For example if you have a waveform table with 100 elements and you want to generate a frequency of 100Hz, you must send that complete table to the D/A 100 times a second OR once every 10 milliseconds. This means the samples must be updated every 10ms/100 or 100 microseconds. Given the frequency value entered by the user the correct amount of time between samples can be calculated to control the output frequency.

Based on the processing speed of modern processors the above description can be used to generate signals in the audio range, with the amplitude matching the output range of the D/A. To generate signals at higher frequencies or voltages will require external hardware to generate the actual signal with the hardware controlled by the micro.
 
Last edited:

You need the following stages:

1. something to receive and interpret the commands.
2. a circuit that uses numbers after the 'a' command to set the amplitude
3. a circuit that uses the numbers after the 'f' command to set the frequency.

You should study 'parsing', the process of extracting information from either a stream of characters or a line of data. You then have to decide how you want to make the signal, how accurate it's frequency must be and how accurate the amplitude control must be. From there you can decide the best control method to use. For example for frequency you might program a PLL device, a DDS device or you could generate a voltage proportional to the number and use it to tune a VCO. There are many methods but which is most suitable depends on the needs of your application.

Brian.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top