877A AtoD config problem?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    17

    Default 877A AtoD config problem?

    Hi,

    Using the X1-demo board and a 877A chip. All I want to do is config portA so I can use the pins, An2, An4 An5 to read the voltage from and accelerometer. I started with the A2D8.bas demo code and all works to read pin An2, the problem happens when I try to config the A/D port config control bits from:

    ANDCON1 = %1000 0010 ' An0-An4 configed for Analog Input

    to

    ANDCON1 = %1000 0000 ' An0-An7 configed for Analog Input

    or

    ANDCON1 = %1000 1001 ' An0-An5 configed for Analog Input

    I'm only trying to read An2 but ,my display is not showing anything but sometimes flashes, any ideas?

    oh, ADCON0 is:
    ADCON0 = %11010001 ' Configure and turn on A/D Module


    thanks

    t



    Seems simple, really just use

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Question I am surprised that your program is compiling!

    Quote Originally Posted by ttease View Post
    Hi,

    Using the X1-demo board and a 877A chip. All I want to do is config portA so I can use the pins, An2, An4 An5 to read the voltage from and accelerometer. I started with the A2D8.bas demo code and all works to read pin An2, the problem happens when I try to config the A/D port config control bits from:

    ANDCON1 = %1000 0010 ' An0-An4 configed for Analog Input

    to

    ANDCON1 = %1000 0000 ' An0-An7 configed for Analog Input

    or

    ANDCON1 = %1000 1001 ' An0-An5 configed for Analog Input

    I'm only trying to read An2 but ,my display is not showing anything but sometimes flashes, any ideas?

    oh, ADCON0 is:
    ADCON0 = %11010001 ' Configure and turn on A/D Module


    thanks

    t



    Seems simple, really just use
    You also need to set your data direction register TRISA as inputs and disable the comparator. Although the POR values should do, it is better to configure manually.
    Regards

    Sougata

  3. #3
    Join Date
    Mar 2007
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Solved..

    Thanks for the reply, I only included the code I figured might be giving me the problem. My Bad!

    After re-reading the correct DS, I figued out that RA4 cannot be configured as an Analog Input.

    I'm using the 877A to prototype some code that will run on a P18F4431. All pins on Port A of the 4431 can be Analogs, so I figured.....

    Note to self:RTCFDS- Read the correct F* data sheet!

    thanks

    t

Similar Threads

  1. A/D conversion with PIC18F67J50
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2009, 01:48
  2. 18F4550 Bootloader enter via eeprom setting
    By bradb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd November 2008, 23:51
  3. Error 0X0000008E when connecting a 18F2550 USB HID
    By FranciscoMartin in forum USB
    Replies: 8
    Last Post: - 16th October 2008, 17:20
  4. PortE problems (PIC18F4455)
    By RubenR in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 12th July 2006, 15:26
  5. Installation sequence
    By Demon in forum General
    Replies: 23
    Last Post: - 11th July 2006, 03:56

Members who have read this thread : 1

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