Blinker Test on a 16F18313


+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2013
    Posts
    8

    Default Blinker Test on a 16F18313

    Hello,

    I've just started to use a new PIC which I cannot get to work at all, I suspect it has to do with the OSC setting or the PPS setup.
    To start with I'm just trying to flash a LED on RA3, in the long term I'll have TX on RA0, RX on RA1, and PWM on RA3.

    Any help will be greatly appreciated!

    Code:
    '                        PIC16F18313
    '                  +---------:_:---------:
    '         5v0 -> 1 : VDD             VSS : 8 <- GND
    '             <> 2 : RA5/AN5     AN0/RA0 : 7 <> PGD -> TX
    '             <> 3 : RA4/AN4     AN1/RA1 : 6 <> PGC -> RX
    '  PWM <- VPP -> 4 : RA3/MCLRn   AN2/RA2 : 5 <>
    '                  +---------------------+
    '                           DIP-8
    
    
    ' DEVICE CONFIGURATION
    #CONFIG
        __config _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT32 & _CLKOUTEN_OFF & _CSWEN_ON & _FCMEN_ON
        __config _CONFIG2, _MCLRE_OFF & _PWRTE_ON & _WDTE_OFF & _LPBOREN_OFF & _BOREN_OFF & _BORV_LOW & _PPS1WAY_OFF & _STVREN_ON & _DEBUG_OFF
        __config _CONFIG3, _WRT_OFF & _LVP_OFF
        __config _CONFIG4, _CP_OFF & _CPD_OFF
    
    
    #ENDCONFIG
    
    
    ' DEFINEs
        DEFINE    OSC    8                        ' Internal 8MHz
    
    
    ' Pin ALIASES
      
    ' CONSTANTS
    
    
    ' VARIABLES
    
    
    ' INITIALIZE REGISTERS
        OSCCON1 = 100000                    ' NOSC = 110, NDIV = 0000
        'OSCCON2 =  100000                ' COSC = 110, CDIV = 0000
        OSCCON3 =  0
        OSCFRQ = 00                        ' HFFRQ 8MHz
    
    
        ADCON0 = 0                            ' Disable ADC
        ANSELA = 0                            ' Set to Digital Port A
    '    ANSELC = 0                            ' Set to Digital Port C (16F18323 only)
        ODCONA = 0                            ' set output as push-pull (OD by default)
        SLRCONA = 0                            ' set output slew rate to maximum
        CM1CON0 = 0                            ' Disable Comparator
    '    CM2CON0 = 0                            ' Disable Comparator (16F18323 only)
    '    WPUA = 000001                    ' Set Weak Pull-ups
    '    OPTION_REG.7 = 0                    ' Enable Weak Pull-up for Temp Sensor so check works
    
    
        TRISA = 000000                    ' Set ports as outputs
    
    
    ' PROGRAM Start
    
    
    
    
    MAIN:
        LATA.3 = 1
        PAUSE 1000
        LATA.3 = 0
        PAUSE 1000
        GOTO MAIN

  2. #2
    Join Date
    Mar 2013
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Re: Blinker Test on a 16F18313

    RA3 is input only

Similar Threads

  1. Blinker for 16F18446 - OSC settings and PORT addressing
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 10th February 2024, 13:40
  2. test
    By innchick in forum Test Area
    Replies: 0
    Last Post: - 15th September 2012, 18:45
  3. test
    By innchick in forum Test Area
    Replies: 0
    Last Post: - 15th September 2012, 18:42
  4. Test
    By MikeWinston in forum Test Area
    Replies: 6
    Last Post: - 8th February 2012, 17:56
  5. blinker
    By nlirette in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th July 2009, 13:59

Members who have read this thread : 6

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