Help with configuring


Results 1 to 10 of 10

Threaded View

  1. #1

    Default Help with configuring

    Hello there. I have written a simple code but it seems not to work properly. I am not sure what I am missing here and any help will be appreciated.

    The code is as follows:
    Code:
    #CONFIG
        ifdef PM_USED
            device  pic16F688, intrc_osc_noclkout, wdt_on, mclr_on, protect_off
        else
            __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_ON & _CPD_ON & _BOD_ON & _IESO_ON & _FCMEN_ON
        endif
    #ENDCONFIG
    DEFINE OSC 8       ' OSCCON defaults to 8MHz on reset
    DEFINE NO_CLRWDT 1
    Include   "modedefs.bas"
    
    ' declare the interrupt handler
    define INTHAND _ISR
    
    goto main
    
    ISR:
    asm
    
    ; my asm code
    
    endasm
    
    main:
            PAUSE 50
    	OSCCON = %01110001 ' Internal Oscillator 8MHz
            TRISA = %000100
            TRISC = %000010
            CMCON0 = 7
            ANSEL = 0               ' NO ANALOGS
            OPTION_REG = %10000011  ' RAPU = off, PS 1:16 to TMR0
            PORTA=0
            PORTC=0
            
            ' setup iZCD to interrupt on change
    '        INTCON= %10110000
            '         |         Global interrupts enabled
            '           |       Timer0 interrupt enabled
            '            |      Zero Crossing interrupt enabled
            '             ----  Flags are cleared
     while 1
    	toggle PortA.4
    	pause 500
    wend
    When I comment the INTCON, my led blinks fine @ 500mS. When I uncomment it, the timings go out.
    I want to run my PIC16F688 at internal 8MHz and not sure if I am missing any configuration register.
    Last edited by financecatalyst; - 15th August 2014 at 08:03.
    ___________________
    WHY things get boring when they work just fine?

Similar Threads

  1. configuring AD converter in a 12F615
    By tekart in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 1st June 2011, 03:38
  2. Configuring 16F616
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th February 2009, 16:28
  3. Configuring register problem
    By shawn in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd January 2005, 20:03
  4. configuring the internal oscillator
    By bartman in forum General
    Replies: 12
    Last Post: - 30th November 2004, 00:41
  5. need help configuring 16F628
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd March 2004, 18:59

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