Mcp3208 adc help


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Thumbs down Re: Mcp3208 adc help

    Duh?!?
    3.6 Serial Data Output (DOUT)
    The SPI serial data output pin is used to shift out the
    results of the A/D conversion. Data will always change
    on the falling edge
    of each clock as the conversion
    takes place.
    Change your clock idle from low to high, and see what happen.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Mcp3208 adc help

    That was easy
    Code:
            high cs
            Pause 100 ' Pause to see display on LCD.
    Main:
            LOW CS ' Enable ADC
            SHIFTOUT DataOut, Clock, 2, [%11000] ' Select CH0, Single-Ended
            high Clock
            SHIFTIN DataIn, Clock, 6, [result0\13] ' Read ADC
            HIGH CS ' Disable ADC
            Low Clock
            LCDOUT $FE,1,"ADC: ",dec result0
            PAUSE 100 'Pause long enough to read LCD.
            Goto Main
    now read the datasheet to know why it works
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts