A/D problem on 18F2550 ?


Closed Thread
Results 1 to 4 of 4

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Well the only pointer i can say

    look for ADCON, ADCON0, ADCON1 and/or CMCON register. PORTA can be set as analog i/o by default. So you nbeed to set it to digital.
    Steve

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

  2. #2
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    154


    Did you find this post helpful? Yes | No

    Default

    I thought i have, the register that i thought was applicable was the ADCON1 which has been set to ADCON1 = %00001111.

    Are there any others that i am missing.

    I thought this was the only one, as if i set the code to:

    Code:
    Main:
        if Switch = 1 THEN
            gosub flash
            endif
    GOTO Main
    
    Flash:
        For loop = 1 to 10
            Redled = 1
            Pause 50
            Redled = 0
            Pause 50
        Next Loop
    Return
    When you push the button, it does jump to the Flash routine. So i am guessing it is in digital mode.

    I have a pull-down resistor on the input pin, which when the switch is pressed the input line goes to 5v.

    I'll keep trying for a solution. Of course it could be my code up the spout !!

    Steve

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


    Did you find this post helpful? Yes | No

    Default

    Tissy,

    Well, my original comment is still there, but I guess the thought behind it didn't make it through.

    ' use a pin with Schmitt Trigger input
    <br>
    DT

Similar Threads

  1. A/D converter problem
    By netstranger.nz in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th September 2009, 07:56
  2. A/D conversion problem in 18F2520, 2523, 2550 etc.
    By selimkara in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 10th March 2008, 16:26
  3. Array problem (18F2550)
    By Ronald123 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th January 2008, 18:47
  4. Problem with A port on 18F2550
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 9th May 2007, 22:59
  5. A/D conversion problem with pic16F88
    By Tapio Linkosalo in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 18th August 2006, 11:42

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