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.
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.
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.