Code Issue? - Pin Labels


Closed Thread
Results 1 to 5 of 5

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Or i'm Blind OR i'm stupid.. i don't see any reason why it shouldn't work. I use PORT alias every day and never had issue with.

    what are you using
    PIC:
    PBP version:

    what else is bellow your code, you use a goto at the top. How you acces to the Checkports?
    Steve

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

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


    Did you find this post helpful? Yes | No

    Smile

    In the second program, the HIGH and LOW commands automatically make the pins outputs – you have not set them in the first to output. Add

    Code:
    TRISA = 0 ' make all PORTA output that can be outputs 
              ' (check datasheet depending on your PIC)
    to the first.

    In the second program, you are changing PORTB pins and in the first, PORTA pins. Most PICs default PORTB to digital but many default PORTA to analog. Without knowing what PIC you are using, it is hard to say if this is the issue. Look at this link from MELABS for help on this latter issue. (Pins must be set digital to use them in your manner)

    http://www.melabs.com/support/mcu_hints.htm

    Good Luck,
    Paul Borgmeier
    Salt Lake City, Utah
    USA

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


    Did you find this post helpful? Yes | No

    Default

    yeah but.. Both code use the High LOW statement... one use the PIN alias, not the other.

    I agree with the possibility of the analog stuff on every port, but.. it doesn't explain why the PIN alias don't work but the direct HIGH PORTB.x work ... at least it doesn't make sense to me...

    OK at the begining is the TRIS is not set, the following lines..
    LedA = 0
    LedB = 0
    LedC = 0
    LedD = 0
    won't do anything for sure unless LOW LEDx is used.

    Also we don't know if external pull-up resistor are used.. so that may cause some oddity, and so on
    Last edited by mister_e; - 12th July 2006 at 16:25.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Red face

    Quote Originally Posted by mister_e
    Both code use the High LOW statement...
    Wow, coffee please, I missed the scroll bar his code insert on the first program and had not scrolled down to see the rest of his code.

    You are right, we are left with the analog issue as a possible problem. As Steve asked, what PIC and what PBP version?

    Paul

Similar Threads

  1. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 17:11
  2. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  3. Code Issue - select case or 'if' issue - not sure why
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th October 2007, 08:52
  4. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23
  5. Keypad unlock (as in garage door possibly)
    By Fred in forum Code Examples
    Replies: 5
    Last Post: - 2nd April 2006, 04:26

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