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

Intefacing 8051 to Serial ADC via SPI protocol

Hi all,

8051 micro is very new to me.
Does anybody in this forum kind enough
to help me to create a routine to perform A/D and D/A so that it can
be interfaced to a serial A/D or D/A
converters using SPI protocol? or may
be somebody can instruct me to the right
site on the internet? The project I
am working on requires that a standard
8051 micro to interface with the MAX187
ADC.

Thanks in advance

Jimmy Sayavong
jsayavong@perkinselectronics.com

Parents
  • The SPI port will just transmit (2) 8 bits to you. This way you can get all 16 bits from whatever adc you use.

    For example, the Maxim 186 is an 8 channel 12 bit A/D with an SPI interface. To use it you would

    Send a Control Byte with the channel selection and other setup data and simulteneously read in a byte RB1. (discard this byte)

    Then transmit a byte of all zeros and simultaneously read in a byte RB2.

    Do this again and read in RB3.

    RB2 and RB3 together contain the 12 bits of data (with one leading zero and three trailing zeros). Discard the extra bits and you have your 12 bit A/D data.
    MG

Reply
  • The SPI port will just transmit (2) 8 bits to you. This way you can get all 16 bits from whatever adc you use.

    For example, the Maxim 186 is an 8 channel 12 bit A/D with an SPI interface. To use it you would

    Send a Control Byte with the channel selection and other setup data and simulteneously read in a byte RB1. (discard this byte)

    Then transmit a byte of all zeros and simultaneously read in a byte RB2.

    Do this again and read in RB3.

    RB2 and RB3 together contain the 12 bits of data (with one leading zero and three trailing zeros). Discard the extra bits and you have your 12 bit A/D data.
    MG

Children