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
  • all you need to do is to write a piece of code that outputs a 12-bit number onto two ports. something like

    #define OUT(x) {HIGH_PORT = (x) >> 8; LOW_PORT = (x) & 0x00ff;}

    would work in C. HIGH_PORT would be the port where you output the highest 4 bits and LOW_PORT is one for the lowest 8 bits.

    you can write fancier ones obviously but that should get you started.

Reply
  • all you need to do is to write a piece of code that outputs a 12-bit number onto two ports. something like

    #define OUT(x) {HIGH_PORT = (x) >> 8; LOW_PORT = (x) & 0x00ff;}

    would work in C. HIGH_PORT would be the port where you output the highest 4 bits and LOW_PORT is one for the lowest 8 bits.

    you can write fancier ones obviously but that should get you started.

Children