16F630 and MCP3221 I2C


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    badcock,

    The datasheet for the MCP3221 is a bit ambiguous. While the graphic in figure 5-2 shows the device code as 1001. The text in section 5.2 says that it's 1010.

    I've never used that part before, so I don't know which one it really is, but you might try ...

    cont con %10101010

    Also, the first byte sent (B1) is the highbyte. So the A/D value will have to be greater than 1280 (1.56V) to satisfy the B1 > 2 condition.

    And, don't forget the pull-up resistors on SDA and SCL.<br><br>
    Last edited by Darrel Taylor; - 18th August 2005 at 09:40.
    DT

  2. #2
    Join Date
    Aug 2005
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor
    The datasheet for the MCP3221 is a bit ambiguous. While the graphic in figure 5-2 shows the device code as 1001. The text in section 5.2 says that it's 1010.
    Tell me about the ambiguity! One of the reasons I aksed the question is that the AppNote (AN845) and the datasheet are confusing. My problems could stem from this.

    Quote Originally Posted by Darrel Taylor
    I've never used that part before, so I don't know which one it really is, but you might try ...

    cont con %10101010
    I'll give a few of these variants a go - worth a try for a small amount of effort.

    Quote Originally Posted by Darrel Taylor
    Also, the first byte sent (B1) is the highbyte. So the A/D value will have to be greater than 1280 (1.56V) to satisfy the B1 > 2 condition.
    Exactly as it is meant to - I have a pot and reference voltage attached; I should be able to swap the lit LED by turning the pot (nice easy check).

    Quote Originally Posted by Darrel Taylor
    And, don't forget the pull-up resistors on SDA and SCL.<br><br>
    Already fitted on the Pictail board - one of the advantages of using two of the Microchip development boards together is that the hardware is definitely correct - pity their software data is so ambiguous!

    Many thanks Darrel - I was starting to question whether I had missed some other device specific code. It's nice to have some confirmation that it ma only be the address / control code. Can anyone else confirm the correct MCP3221 control/address byte?

    Rod

  3. #3
    Join Date
    Aug 2005
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    I just tracked some information down on the Microchip website:
    Description: Section 5.2 of the datasheet states '1010' is the 4-bit device code.
    However, all of the diagrams indicate '1001' is the device code.
    Which is it?

    Resolution: The paragraph is incorrect.
    The device code is '1001' as stated in the diagrams.
    I'll give the other code a try!

    Rod

  4. #4
    Join Date
    Aug 2005
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by badcock
    I just tracked some information down on the Microchip website:


    I'll give the other code a try!

    Rod
    But the code I had originally used was correct - could there be something else I am missing?

    Rod

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Rod,

    Your comments show that the LED's are on PORTA.0 and PORTA.1

    But, PORTA.1 and PORTA.2 are being toggled after reading the ADC<br><br>
    DT

  6. #6
    Join Date
    Aug 2005
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor
    Rod,

    Your comments show that the LED's are on PORTA.0 and PORTA.1

    But, PORTA.1 and PORTA.2 are being toggled after reading the ADC<br><br>
    Not a problem - 16F630 is in the PicKit1 board - there are LEDS on RA1, RA2, RA4 and RA5. My comments are incorrect!

    Rod

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Is there a jumper installed in JP1 on the PICtail board?

    It connects the pot to the ADC.<br><br>
    DT

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