PORTB vs PORTB.0


Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    Mar 2007
    Posts
    4

    Default PORTB vs PORTB.0

    Can some one tell me why this code works

    Code:
    OSCCON = %01100010
    ADCON1 = %01111111
    
        TRISB = 0
            
        loop:   
            Pause 500       ' Wait .5 second
            PORTB.3 = 1
            Pause 500       ' Wait .5 second
            PORTB.3 = 0
        Goto loop
        
    END
    And this code works as well ...

    Code:
    OSCCON = %01100010
    ADCON1 = %01111111
    
        TRISB = 0
            
        loop:   
            Pause 500       ' Wait .5 second
            PORTB = %11111111
            Pause 500       ' Wait .5 second
            PORTB = %00000000
        Goto loop
        
    END
    But this code does not...

    Code:
    OSCCON = %01100010
    ADCON1 = %01111111
    
        TRISB = 0
            
        loop:   
            Pause 500       ' Wait .5 second
            PORTB = 1
            Pause 500       ' Wait .5 second
            PORTB = 0
        Goto loop
        
    END
    I tried searching for the answer and I could not find anything. Maybe I don't know how to search properly.

    Thanks in advance,
    Matt

    p.s. I'm using a pic18f1320 and programming it using the PICKIT 2
    p.s.s. Sorry if this post is in the wrong forum
    Last edited by xzolian; - 4th March 2007 at 00:00. Reason: added another code example

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, 19:52
  2. MY FIRST scrolling 8X8 LED
    By earltyso in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th August 2008, 16:23
  3. shifting problem
    By helmut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st August 2007, 06:11
  4. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 20:10
  5. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 5th May 2005, 23: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