Problem with ports help plz


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    Jul 2009
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    I am using the 18F1220 PIC.

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


    Did you find this post helpful? Yes | No

    Default

    Check the data sheet but if I remember correctly ADCON1 is the register to set on that PIC.
    ADCON1 = %01111111
    makes all digital.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2009
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Check the data sheet but if I remember correctly ADCON1 is the register to set on that PIC.
    ADCON1 = %01111111
    makes all digital.
    Setting ADCON1 makes no difference. Always on the first 'release from reset' it misbehaves.

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


    Did you find this post helpful? Yes | No

    Default

    Hmmm.
    How are the configs set?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jul 2009
    Posts
    23


    Did you find this post helpful? Yes | No

    Smile

    I finally found the solution. You cannot clear PORTA
    when I removed the code
    'PORTA = %01000000 ' Clear PORTA
    It worked on the first 'release from reset'. Now all I need is to indivually clear each bit.

  6. #6
    Join Date
    Jul 2009
    Posts
    23


    Did you find this post helpful? Yes | No

    Talking

    How's this for Spaghetti Code

    PORTA.1 = 0 :PORTA.2 = 0 :PORTA.3 = 0 :PORTA.4 = 0 :PORTA.5 = 0 :PORTA.6 = 0

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by wbubel View Post
    How's this for Spaghetti Code

    PORTA.1 = 0 :PORTA.2 = 0 :PORTA.3 = 0 :PORTA.4 = 0 :PORTA.5 = 0 :PORTA.6 = 0
    A friend of mine writes code that way. Here is a mild sample.
    http://www.picbasic.co.uk/forum/showthread.php?t=5407
    After you do it that way for awhile it begins to make sence.
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Boat-load of errors in wbubels code Dave.

    Got an E-Beer ready for the first one to fix em all & explain in detail why...;o}
    Last edited by Bruce; - 31st July 2009 at 02:06.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    Great!
    I saw you configs and was wondering about the OSC setting.
    But if it is working...
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. sleep problem help plz >>>.
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 16th November 2009, 09:21
  2. Replies: 6
    Last Post: - 10th January 2008, 11:38
  3. ESC problem plz help
    By al000y in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st January 2007, 11:21
  4. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 17:46
  5. Problem with intensity.. plz help
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th October 2004, 18:25

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