1. You can now buy finished microcontroller project from us, Check out the Store for the complete list of projects.
  2. Need a custom project, Send us some details about your project. So that we can quote the price for it.

8051 keil

Discussion in 'Microcontrollers' started by wassaf, Jul 23, 2014.

  1. wassaf

    wassaf New Member

    Likes Received:
    0
    Trophy Points:
    1
    can i get a simple C code for generating a sine wave in keil , so that i could see the output in the logic analyzer feature of keil .
    This is my program code :-


    #include<reg51.h>
    sbit sine=P0.1;
    void main() {
    unsigned char WAVEVALUE[12]={128,192,238,255,238,192,
    128,64,17,0,17,64};
    unsigned char x;
    while(1) {
    for (x=0;x<12;x++){
    sine = WAVEVALUE[x];
    }
    }
    i wanted to make sure if the above program is correct??
    also i wanted to view the sine wave in the logic analyzer ,but all that i can see is a blank window in the analyzer.Please help !!
  2. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
    Check this file.

    Attached Files:

  3. wassaf

    wassaf New Member

    Likes Received:
    0
    Trophy Points:
    1
    Thank you sir , this post helped me a lot !!
    also , to note that , i wanted to simulate my code in keil as to view the sine wave in logic analyzer which is being generated through my code . please provide me some info on that !!
Loading...

Share This Page