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.

how to generate sine wave

Status
Not open for further replies.

mustakeem

Newbie level 5
Joined
Jan 13, 2012
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,327
please provide me the code in c language for the generation of sine wave using 8051 microcontroller
 

Good service. Answering an unclear question with solutions for their possible different meanings. The OP however doesn't acknowledge the answer and is crossposting the question.

How about a clear question instead?
 
please provide me the code in c language for 8051
Good service. Answering an unclear question with solutions for their possible different meanings. The OP however doesn't acknowledge the answer and is crossposting the question.

How about a clear question instead?
 

An easy solution is to use a R-ladder with 8 resistor you have good sine. BUt you must use a filter at the end.
 

The unclear point is related to the fact, that a 8051 processor has no means to output a sine wave directly, e.g. analog pins. In so far, you should mention the intended interface and representation method, e.g. PWM, parallel binary code, serial data stream, whatsoever.

Software-wise, a trivial answer can be
Code:
float x;
int i;
for (i=0;i<30;i++)
  x=sin(i*0.20944);
To send a sine waveform in real time, you'll more likely use a table or a Cordic algorithm. But the decision depends on prerequisites like intended frequency, accuracy that are yet unsaid.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top