Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Discussion Groups

Discussion Groups | Piclist | function generating IC

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

function generating IC - bacha bacha - May 21 8:52:30 2007


Hi;
do u know any ic to generate sin, tri, sq. wave. i
should control it via pic
thanks...

____________________________________________________________________________________Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: function generating IC - Leon Heller - May 22 5:04:21 2007

----- Original Message -----
From: "bacha bacha"
To:
Sent: Monday, May 21, 2007 1:40 PM
Subject: [piclist] function generating IC
> Hi;
> do u know any ic to generate sin, tri, sq. wave. i
> should control it via pic

What frequency?

Leon
--
Leon Heller
Amateur radio call-sign G1HSM
Yaesu FT-817ND transceiver
Suzuki SV1000S motorcycle
l...@btinternet.com
http://www.geocities.com/leon_heller



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: function generating IC - bacha bacha - May 24 7:37:25 2007

10Hz-800Hz
can i generate these waves(4output) with a single pic
at the same time. the frequency for 4output must be
set by external +/- buttons. should i use 4 DAC for 4
output? thanks for your help...
--- Leon Heller wrote:

> ----- Original Message -----
> From: "bacha bacha"
> To:
> Sent: Monday, May 21, 2007 1:40 PM
> Subject: [piclist] function generating IC
> > Hi;
> > do u know any ic to generate sin, tri, sq. wave. i
> > should control it via pic
>
> What frequency?
>
> Leon
> --
> Leon Heller
> Amateur radio call-sign G1HSM
> Yaesu FT-817ND transceiver
> Suzuki SV1000S motorcycle
> l...@btinternet.com
> http://www.geocities.com/leon_heller
>

____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: function generating IC - Leon Heller - May 24 12:49:28 2007

----- Original Message -----
From: "bacha bacha"
To:
Sent: Thursday, May 24, 2007 12:36 PM
Subject: Re: [piclist] function generating IC
> 10Hz-800Hz
> can i generate these waves(4output) with a single pic
> at the same time. the frequency for 4output must be
> set by external +/- buttons. should i use 4 DAC for 4
> output? thanks for your help...

At thoe frequencies you should be able to do it with a software DDS, with
four DACs:

http://www.myplace.nu/avr/minidds/index.htm

Leon


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: function generating IC - Eirik Karlsen - May 24 14:44:15 2007

Sure you can, easily...
but not just any PIC can do it. Since you want 4 outputs
you'll need a proc with at least 4 outputs.
Have a look at the PIC18 series motor control chips...
some of these have 6 PWM outputs that can be used as
DACs. They also have more than enough memory and speed.

What you do:
calculate (in basic or whatever) the magnitude data for one period
(or even a half period), and put these in tables in memory, one table
for each output.
Actually only the sine needs a table, the other ones are so simple
they can be 'calculated' on the fly.
Then simply read out the tables and send the data to their respective
PWM generators. You can make almost any waveform using this table
approach.

Read the tables in parallel, the speed at which you read determines the
frequency.
A rough estimate is that you can get from 0 to about 100Khz.

To simplify initial tests I'd suggest using the DAC in 8bit mode, and
use 256 samples
for each period (or half period). This will produce a tiny bit of
'staircasing' and
distortion, but may be good enough.
Use 10bit mode and 1024 samples and you'll have the nicest waveforms
you've ever seen!

E.K

bacha bacha wrote:

> 10Hz-800Hz
> can i generate these waves(4output) with a single pic
> at the same time. the frequency for 4output must be
> set by external +/- buttons. should i use 4 DAC for 4
> output? thanks for your help...--
>
*******************************************
VISIT MY HOME PAGE:

LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

RE: function generating IC - Alan KM6VV - May 24 15:21:38 2007

Hi Leon,

Too bad it doesn't use a PIC! Nice little project, 'tho.

Alan KM6VV

>
> > 10Hz-800Hz
> > can i generate these waves(4output) with a single pic
> > at the same time. the frequency for 4output must be
> > set by external +/- buttons. should i use 4 DAC for 4
> > output? thanks for your help...
>
> At thoe frequencies you should be able to do it with a software DDS, with
> four DACs:
>
> http://www.myplace.nu/avr/minidds/index.htm
>
> Leon



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: function generating IC - rtstofer - May 24 16:36:04 2007

--- In p...@yahoogroups.com, bacha bacha wrote:
>
> 10Hz-800Hz
> can i generate these waves(4output) with a single pic
> at the same time. the frequency for 4output must be
> set by external +/- buttons. should i use 4 DAC for 4
> output? thanks for your help...

When you say "at the same time" do you mean the signals have to be
syncronized? Considering that it takes time to change the values for
the DACs (or PWMs), changing 4 in serial fashion could be an issue.

Richard



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: function generating IC - Eirik Karlsen - May 24 19:14:49 2007

Just a few clarifications / corrections...
Sine and triangle needs a DAC (PWM), square does not.
So you need 2 PWMs and this means you can use simpler
chips, like the 18F242.

Using this simple scheme and the internal DACs the max
freq will not be as high as 100Khz (you'll have to use external DACs for
that).
It will be something like (or less than) PWM frequency /
(samples/period).

Max PWM freq for 8bit res is 156Khz, and for 256 samples/period you'll
get about 600Hz.
Eirik Karlsen wrote:

> Sure you can, easily...
> but not just any PIC can do it. Since you want 4 outputs
> you'll need a proc with at least 4 outputs.
> Have a look at the PIC18 series motor control chips...
> some of these have 6 PWM outputs that can be used as
> DACs. They also have more than enough memory and speed.
>
> What you do:
> calculate (in basic or whatever) the magnitude data for one period
> (or even a half period), and put these in tables in memory, one table
> for each output.
> Actually only the sine needs a table, the other ones are so simple
> they can be 'calculated' on the fly.
> Then simply read out the tables and send the data to their respective
> PWM generators. You can make almost any waveform using this table
> approach.
>
> Read the tables in parallel, the speed at which you read determines
> the frequency.
> A rough estimate is that you can get from 0 to about 100Khz.
>
> To simplify initial tests I'd suggest using the DAC in 8bit mode, and
> use 256 samples
> for each period (or half period). This will produce a tiny bit of
> 'staircasing' and
> distortion, but may be good enough.
> Use 10bit mode and 1024 samples and you'll have the nicest waveforms
> you've ever seen!
>
> E.K
> bacha bacha wrote:
>
>> 10Hz-800Hz
>> can i generate these waves(4output) with a single pic
>> at the same time. the frequency for 4output must be
>> set by external +/- buttons. should i use 4 DAC for 4
>> output? thanks for your help...--
>>
> *******************************************
> VISIT MY HOME PAGE:
>
> LAST UPDATED: 23/08/2003
> *******************************************
> Regards
> Eirik Karlsen

--
*******************************************
VISIT MY HOME PAGE:

LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: function generating IC - rtstofer - May 24 19:44:34 2007

--- In p...@yahoogroups.com, bacha bacha wrote:
>
> 10Hz-800Hz
> can i generate these waves(4output) with a single pic
> at the same time. the frequency for 4output must be
> set by external +/- buttons. should i use 4 DAC for 4
> output? thanks for your help...

There's another way to skin this cat. Suppose you decide that 1024
samples per cycle are sufficient. Then you can use 1K x ?? wide
EEPROMS to hold the wave tables. Each EEPROM would be 10 bits wide
(probably 16 is what you would buy) and the output would drive the DACs.

The address for the EEPROMS would be common and could come from a PIC
but you would have problems switching 10 bits at a time. Instead, I
would use an external counter that was controlled by the PIC. The
square wave would not require an EEPROM, it could be grabbed from the
address counter.

So, all the PIC does is respond the operator input and derive the
proper frequency for the external counter. Maybe it displays the
frequency on an LCD.

It takes at least 4 external chips but it does guarantee that the
outputs are synchronized.

Richard



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Re: function generating IC - bacha bacha - May 25 14:56:21 2007

thanks for your help... i'm going to try :)

____________________________________________________________________________________Sick sense of humor? Visit Yahoo! TV's
Comedy with an Edge to see what's on, when.
http://tv.yahoo.com/collections/222



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Re: function generating IC - Eirik Karlsen - May 25 15:13:43 2007

If you use the table approach I suggested then there may be a lot of
work typing in hundreds of data entries in the asm file.
But just open the file in BASIC and insert the data code as text strings
there,
its very simple and you won't have to type all that data.
Better yet, put the data in a separate asm file, and just INCLUDE
it in your project...then the long listings of data won't clutter your
editor.
bacha bacha wrote:

> thanks for your help... i'm going to try :)
>
--
*******************************************
VISIT MY HOME PAGE:

LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

RE: Re: function generating IC - Alan KM6VV - May 25 17:17:36 2007

Hi Eirik, all,

Good ideas. I’d also like to add that if you write a function in BASIC (or
any other language of your choice), you can use a simple loop and print out
the values to a file that can be included. Generate a SIN table, Log table,
etc. Never any need to type it all in!

The DDS project mentioned earlier Mini DDS

http://www.myplace.nu/avr/minidds/index.htm

has the ASM code available, and there are three tables in it you can use.

Alan KM6VV
If you use the table approach I suggested then there may be a lot of
work typing in hundreds of data entries in the asm file.
But just open the file in BASIC and insert the data code as text strings
there, its very simple and you won't have to type all that data.
Better yet, put the data in a separate asm file, and just INCLUDE
it in your project...then the long listings of data won't clutter your
editor.
 
Regards
Eirik Karlsen



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: function generating IC - rtstofer - May 25 18:24:53 2007

--- In p...@yahoogroups.com, Eirik Karlsen wrote:
>
> If you use the table approach I suggested then there may be a lot of
> work typing in hundreds of data entries in the asm file.
> But just open the file in BASIC and insert the data code as text strings
> there,
> its very simple and you won't have to type all that data.
> Better yet, put the data in a separate asm file, and just INCLUDE
> it in your project...then the long listings of data won't clutter your
> editor.
>

Or build the tables with Excel and export them as Comma Separated
Variables. Reformat with the editor of choice.

Download GWBasic (actually works under WinXP) and write a program to
generate all of the statements. Under Linux you could use C or
Fortran to do the same thing.

Richard



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )