PORTB vs PORTB.0


Results 1 to 8 of 8

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Yes indeed!

    PORTB=255 ' decimal
    PORTB=$FF 'Hexadecimal
    PORTB=%11111111 ' Binary

    P.S.: it's a good practice to set your PIC configuration fuses in your code.
    Code:
            '
            '       Pic Configuration
            '       =================
            asm
            
            __CONFIG  _CONFIG1H, _IESO_ON_1H & _FSCM_OFF_1H & _INTIO2_OSC_1H
                    ;
                    ;_IESO_ON_1H       Internal External Oscillator Switch Over mode enabled
                    ;_FSCM_OFF_1H      Fail-Safe Clock Monitor disabled
                    ;_INTIO2_OSC_1H    Internal RC, OSC1 as RA7, OSC2 as RA6
    
            __CONFIG  _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_27_2L
                    ;
                    ;_BORV_27_2L       BOR Voltage - 2.7v
                    ;_BOR_ON_2L        Brown-out Reset enabled
                    ;_PWRT_ON_2L       Power-up Timer enabled
    
            __CONFIG  _CONFIG2H, _WDT_OFF_2H & _WDTPS_32K_2H
                    ;
                    ;_WDT_OFF_2H       Watch Dog Timer disabled
                    ;_WDTPS_32K_2H     1:32,768    WDT Postscaler ratio
                    
            __CONFIG  _CONFIG3H, _MCLRE_ON_3H
                    ;
                    ;_MCLRE_ON_3H      MCLR enabled, RA5 input disabled
                    
            __CONFIG  _CONFIG4L, _DEBUG_OFF_4L & _LVP_OFF_4L & _STVR_ON_4L
                    ;
                    ;_DEBUG_OFF_4L     BacKground deBUGger disabled
                    ;_LVP_OFF_4L       Low Voltage Prgramming disabled
                    ;_STVR_ON_4L       Stack over/underflow Reset enabled
                            
            __CONFIG  _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L
    
            __CONFIG  _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
    
            __CONFIG  _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L
                    
            __CONFIG  _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
                    
            __CONFIG  _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L
                   
            __CONFIG  _CONFIG7H, _EBTRB_OFF_7H
            ENDASM
    There's a whole thread about that bellow. Take your time to read it.
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Last edited by mister_e; - 4th March 2007 at 00:27.
    Steve

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

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