16F1786 issue with simple program.


Results 1 to 6 of 6

Threaded View

  1. #4
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: 16F1786 issue with simple program.

    Here is one way to handle configs for multiple processsors...

    Code:
        #IF __PROCESSOR__ = "16F1828"
            #CONFIG
            __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_ON & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
            __CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_25 & _LVP_OFF
            #endconfig
        #ELSE
            #IF __PROCESSOR__ = "16F690"
                #CONFIG
                __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOD_OFF & _IESO_OFF & _FCMEN_OFF
                #endconfig
            #ELSE
                #ERROR "Program does not support " + __PROCESSOR__
            #ENDIF
        #ENDIF
    
        #msg "compiling for target " + __PROCESSOR__
    it dosen't paste in a code window very well (due to line wrap) but you should get the idea.
    try and copy/paste it into your IDE
    Last edited by Heckler; - 23rd January 2016 at 18:22.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

Similar Threads

  1. 18F4550 issue with simple program.
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th January 2016, 12:48
  2. Program Configuration check mark issue... maybe.
    By Szczepaniec in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th November 2012, 19:17
  3. Simple LED driving issue - setup?
    By George in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th March 2011, 02:54
  4. Code issue with a flashing light(simple question)
    By IAmTheAnswer in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th May 2010, 12:46
  5. Help with simple program
    By mykewl in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 31st July 2008, 09:58

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