PortA Doesn't Work


+ Reply to Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Thanks

    Thanks Melanie,

    That is a good troubleshooting doc to have on hand and review.


    And as sbobowski noted it is much easier for a newbie to understand why/how to set a particular register if it is depicted as a binary value.

    ie. cmcon = %00000111 instead of =07, Since each bit has a unique function, showing it in binary rather than hex or dec is easier for me to understand.

    Thanks
    Dwight
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Some folks think in Binary, some in Decimal, other in Hexadecimal.

    I like Binary (when dealing with say up to 8 bits), because in my mind it immediately relates to those BIT positions in the PICs Registers.

    It doesn't matter what you use, or if you chop and change throughout your code, the compiler doesn't care - it's there just for YOUR convenience.

    The biggest confusion is when folks come along and say "What's inside the BYTE - is it Decimal or Hex or Binary?". It takes some explaining to convince people the answer is YES - It's ALL OF THOSE simultaneously! It's simply a matter of how you perceive it YOURSELF.

    If you wanted to extract say just BIT 5 out of a BYTE... what's easier to visualise what is going on...

    Example A.

    NewByte=OldByte & %00100000

    or...

    Example B.

    NewByte=Oldbyte & 32

    or...

    Example C.

    NewByte=Oldbyte & $20

    All three examples are EXACTLY the same. Use whichever one turns you on.

  3. #3
    Join Date
    Jun 2006
    Location
    Bangalore, India
    Posts
    136


    Did you find this post helpful? Yes | No

    Post Re: PortA Doesn't Work

    Another option to set PortA to digital automatically is Darrel's "AllDigital.pbp" . It will set the required registers on the selected device to make PortA digital and there is also a provision to see which registers have been set by the "All Digital" include.
    http://www.picbasic.co.uk/forum/showthread.php?t=11100
    I have used this in almost all of my 16F designs.
    Last edited by shahidali55; - 9th May 2012 at 13:46.

  4. #4
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: PortA Doesn't Work

    Port A works, it’s port A bit 4 that doesn’t work lol!

Similar Threads

  1. pls help me verify my code not work, why???
    By chai98a in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th January 2010, 09:19
  2. error worring pbp247
    By chai98a in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th January 2010, 04:51
  3. 16f876 PortA set-up trouble?
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2006, 19:31
  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. Pin RA4 doesn't work
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 15th July 2004, 12:03

Members who have read this thread : 2

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