This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Need some help in programming 8051 with keil C

Hi 2 all,
Actually iam doing a project where i have to convert the analog voltage to digital and read it's output. I have done the program for generating the sclock and ss/ for ADC(Max187) and getting the serial 12 bit data output successfully....
But iam not able to convert this serial 12 bit data to parallel using 89C51 controller...
Can anyone help me by giving some hints or a sample program for it please....

Parents
  • If having software SPI, you just toggle the clock for every bit, and pick up the state of the data line once for every bit. Then you use the shift operator to one-bit-at-a-time shift in the values in a 16-bit integer. After all 12 bits have been received, your integer have a value between 0 and 4095 (unless you managed to shift in the data from the wrong direction).

    The world is full of examples of software SPI. How many of these examples have you looked at?

Reply
  • If having software SPI, you just toggle the clock for every bit, and pick up the state of the data line once for every bit. Then you use the shift operator to one-bit-at-a-time shift in the values in a 16-bit integer. After all 12 bits have been received, your integer have a value between 0 and 4095 (unless you managed to shift in the data from the wrong direction).

    The world is full of examples of software SPI. How many of these examples have you looked at?

Children