Need a working code for sine wave generation using pic 18f mcu

Thread Starter

khatus

Joined Jul 2, 2018
68
Hello guys i need a working code for sine wave generation using pic 18f mcu
 

MrChips

Joined Oct 2, 2009
19,269
Easy.
Store a sine wave in a lookup table and output the data to a DAC.
 

mvas

Joined Jun 19, 2017
538
What is the Frequency of your Sine Wave?
How many Data Points per cycle do you require?
 

danadak

Joined Mar 10, 2018
3,571
You also want to use a timer or clock to trigger the dac update, to avoid jitter
in the output waveform. An ISR can do this if its high priority, but thats not a
guarantee there will be no jitter. Only a HW process can guarantee that. There
are processors out there that can do an end to end HW solution. Not sure if PIC
can do this. Would have to have DMA. separate busses, and access to the sine
sample table.

Sine table values all over the net for download.

Other techniques - https://dspguru.com/dsp/tricks/sine_tone_generator/ https://dspguru.com/dsp/tricks/sine_tone_generator/


Regards, Dana.l
 

Attachments

Last edited:

JWHassler

Joined Sep 25, 2013
273
Google has a ton of examples.
Every one of these (that I looked at) has some version of "we need a better-formed/explained question"
 
Top