Problem with AD inputs at PIC16f873a


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Posts
    6

    Default Problem with AD inputs at PIC16f873a

    Hi,

    I have a problem with a Pic16f873a.
    I´m using 4 of the 5 analog to digital converts. Every AD port is with a resistor pulled down.
    On Port c I have 4 outputs with LEDs.
    As you can see on Beispiel1.bas I read ad channel 0 to 3 and when there is a value bigger than 0 the Led on the output changes to high.
    This works for all of the 4 channels.

    Now I`ve changed the program (see Beispiel2.bas)
    On AD channel 0 the Led only get high when on the input a signal with 2.5V exists.
    Now, when I put a signal bigger than 0V on any of the 4 AD inputs, all of the 4 output Led gets high.
    I can´t understand this. I´ve tried various ADCON0 and ADCON1 and Sample-times without any other result.

    Does somebody know, what here is wrong?

    Best regards,
    Thorsten Wurm
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Maybe
    Code:
    IF Messwert1 > 120 then check
    check: 
    IF Messwert1 < 130 then
    
        high Alarm1
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    hi,

    I´ve trie this, but the problem is still the same.
    I think the main program is correct and there
    only can be some errors in the configuration and the adcons.

    Best regards,
    Thorsten Wurm

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    You might be correct, I have not looked at the data sheet for that chip lately.

    Read this article. http://www.rentron.com/PIC12C67XAD.htm

    It is for a different chip but it explains how to set up the ADC much better than I can.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  2. ADC problem with PIC16F917
    By eetech in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th March 2007, 21:22
  3. ADCIN - AD settings are wrong
    By teverett in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th December 2006, 16:32
  4. problem RB4-7 on a 18F876A
    By mischl in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th March 2006, 14:30
  5. ADC problem
    By NacNud in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th December 2004, 02:27

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