PortA , PortB


Closed Thread
Results 1 to 18 of 18

Thread: PortA , PortB

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by BobK
    ...If you want to get real basic here you can read porta like this:

    Peek PortA, B0 Read PortA and put results in Variable B0
    If Bit0 = 1 then task 1 'Reads PortA pin 0, if 1 then goto task 1
    If Bit1 = 1 then task 2 'Reads PortA pin 1, if 1 then goto task 2
    If Bit2 = 0 then task 3 'Reads PortA pin 2, if 1 then goto task 3

    ...
    Bob,
    Nice addition - your approach is certainly easier and faster to write. Utilizing the fact that Bit0, Bit1, etc. are predifeined as the bits of B0 is the better approach for straightforward (i.e., normal) operations. Thanks for adding - now Dirk has lots of options. If it were me, I would skip the bitwise stuff and use what Bob has above.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  2. #2
    DiGGi's Avatar
    DiGGi Guest


    Did you find this post helpful? Yes | No

    Default workin

    hi,

    my prog i working by using Peek and Bit0, Bit1 ...

    Thanks for your help!

    Diggi

Similar Threads

  1. PICs can do more if use others than delays instructions
    By hardcore in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th February 2010, 20:52
  2. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 08:57
  3. shifting problem
    By helmut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st August 2007, 07:11
  4. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 21:10
  5. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 6th May 2005, 00:29

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