Pic18f14k50


Closed Thread
Results 1 to 3 of 3

Thread: Pic18f14k50

  1. #1

    Default Pic18f14k50

    Hi

    I am looking for the Config Settings for a Pic 18F14K50 for internal ossification at 4mhz and a simple program to turn an led on and off at PB.5

    I am sure I will be able to take if from there

    Please Thanks

  2. #2
    Join Date
    Nov 2007
    Location
    West Covina, CA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: Pic18f14k50

    Untested using PBPX 3.0.1.4 but should get you started and hopefully not even more lost.

    Code:
    '****************************************************************
    '  Config files for PIC18F14K50 with internal 4MHz clock
    #CONFIG
       __CONFIG    _CONFIG1L, _CPUDIV_NOCLKDIV_1L & _USBDIV_OFF_1L
       __CONFIG    _CONFIG1H, _FOSC_IRC_1H & _PLLEN_OFF_1H & _PCLKEN_ON_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
       __CONFIG    _CONFIG2L, _PWRTEN_ON_2L & _BOREN_ON_2L & _BORV_19_2L
       __CONFIG    _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
       __CONFIG    _CONFIG3H, _MCLRE_OFF_3H
       __CONFIG    _CONFIG4L, _STVREN_OFF_4L & _LVP_OFF_4L & _BBSIZ_ON_4L & _XINST_OFF_4L & _DEBUG_OFF_4L
       __CONFIG    _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L
       __CONFIG    _CONFIG5H, _CPB_OFF_5H
    #ENDCONFIG
    PORTA = %00000000       ' Turn off all PORTA 
    TRISA = %11111111       ' PORTA set to inputs
    PORTB = %00000000       ' Turn off all PORTB
    TRISB = %00000000       ' PORTB set to outputs
    PORTC = %00000000       ' Turn off all PORTC
    TRISC = %11111111       ' PORTC set for intputs
    CM1CON0.7 = 0		    ' Analog comparator #1 off
    CM2CON0.7 = 0		    ' Analog comparator #2 off
    ADCON0.0 = 0            ' A/D module disabled
    ADCON1 = 0              ' A/D references set to Vdd and Vss
    ANSEL = 0               ' Turn Analog Register 1 OFF
    ANSELH = 0              ' Turn Analog Register 2 OFF
    CCP1CON = 0             ' Disables CCP module
    TXSTA.5 = 0             ' EUSART transmitter disabled
    RCSTA.7 = 0             ' EUSART serial port disabled
    
    OSCCON = %01010110      ' Section 2.6 Oscillator Control of data sheet
    CLEAR                   ' Set all registers to 0 
                       
    DEFINE OSC 4
    
    '=========================================================================
    '                        Variable Definitions      
    '=========================================================================
    LED VAR LATB.5  ' LED aliased to PORTB Latch register 5
    
    '=========================================================================
    ' Turn LED On/OFF @ 2Hz
    '=========================================================================  
    Main:
        LED = 1     ' Turn LED ON
        PAUSE 500   ' Wait 500ms
        LED = 0     ' Turn LED OFF
        PAUSE 500   ' Wait 500ms
    GOTO Main
    Louie

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Pic18f14k50

    Thanks Link

Similar Threads

  1. PIC18F14K50 and i2cread/i2cwrite on PORT C
    By RuudNL in forum Off Topic
    Replies: 5
    Last Post: - 28th February 2012, 11:01
  2. Pic18F14K50 when?
    By Free_Flow in forum PBP Wish List
    Replies: 16
    Last Post: - 17th August 2009, 03:36
  3. USB with 20 pins anyone? PIC18F14K50 issues
    By ScaleRobotics in forum USB
    Replies: 6
    Last Post: - 17th July 2009, 16:39

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