PORTA problems 18LF252


Closed Thread
Results 1 to 3 of 3
  1. #1
    iphillips's Avatar
    iphillips Guest

    Default PORTA problems 18LF252

    I am new to the forum and PBP.
    I also have searched and tried some of the things listed here.
    I am using PORTA with a dip switch but it dosent' seem to be working.
    Here is what I got from the site
    ADCON1 = %0111111 ' Disable AD Converters
    TRISA = %0111111 ' PORTA all set to Input
    IF PORTA.bit0 = 0 Then Map
    Any help appreciated.
    Ian

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


    Did you find this post helpful? Yes | No

    Default

    Welcome to the forum.

    In your case, refer to datasheet section 17-2
    if you set BIT3-0 as %1111... AN0 will be analog ;( not what you want i guess.

    try ADCON1 = 7
    Steve

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

  3. #3
    iphillips's Avatar
    iphillips Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks! That worked. It also helped if I could design a board properly. Missed the fact that you have to pull up/down for the PIC to know where anything is at.

Similar Threads

  1. Replies: 5
    Last Post: - 16th October 2009, 18:29
  2. problems with parallel LCD
    By Brown in forum mel PIC BASIC
    Replies: 11
    Last Post: - 12th June 2008, 04:37
  3. Changing from PORTC to PORTA Problems
    By Tissy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 13th December 2005, 21:11
  4. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 5th May 2005, 23:29
  5. 16F627 porta problems
    By electronicsuk in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th September 2003, 10:40

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