18F1220 fuse help


Results 1 to 7 of 7

Threaded View

  1. #3
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    This is the config sections plus the pin var definitions, not the whole code. As I don't get a flash on PortA.1 at startup for 500mS the rest is sort of irrelevant I think.

    Thanks in advance,
    Martin
    (T-rex 450 and 500 pilot :-)

    PS. I have remarked out the _Config lines in 18F1220.INC in PBP directory


    Code:
    '-----------------------
    ' PIC Defines
    ' ===========
    'Config bits set to INTERNAL OSC, Watch dog ON, Power up timer ON, Master Clear NOT used, BrownOut protection ON, 
    '@    device  pic16F819, intrc_osc, wdt_on, pwrt_on, mclr_off, bod_off, lvp_off, DEBUG_OFF, CPD_OFF, WRT_OFF  ;Config switches, different from PBP default
    
    'Config1H register
    @ CONFIG OSC=INTIO2
        ' Oscillator switch OFF
        ' 
    'Config2L register
    @ CONFIG BOR=ON, PWRT=ON, BORV=27
        ' Brown out reset ON @ 2.7Volts
        ' Power-up timer ON
        '
    'Config2H register
    @ CONFIG WDT=ON
        ' Watch dog timer ON
        '
    'Config4L register
    @ CONFIG STVR=ON, LVP=OFF, DEBUG=OFF
        ' Stack over/underflow ON
        ' Low Voltage programming OFF
        ' Background debugger OFF 
        
        Define Osc 8 '8Mhz clock used. 
    
        CPIN        var     PortB.0       ' I2C clock pin 
        DPIN        var     PortB.1       ' I2C data pin
        SO          Var     PortA.0        'Serial out pin
        LED         var     PortA.1        'Indicator LED, via 500ohm to +3.3V rail
    
    ' Initialise Processor - check for each PIC type 
    ' --------------------
    '    VRCON.7 = %0    'Comparator voltage reference OFF
    '    CMCON0 = %111   'Comparator inputs to OFF, all pins normal I/O
    '    ADCON0 = 0       'Turn off all AD's 
        ADCON1 = %11111111       'Turn off all AD's     
    '    Osccon = %01100000    'set INTRC to 4 MHZ
        
    ' Set initial state of GPIO port pins as Input or Output
    
        TRISA = %11111100    'Input(0 = output, 1 = Input)
        TRISB = %11111100    '
        
    ' PIC initialization code
            Low So      'Must start low, or you get rubbish on the LCD at PIC boot up.
            Low LED     'LED on
            pause 500
            High LED    'LED off
    Last edited by mr.sneezy; - 24th May 2010 at 00:09.

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