Compile "opcode"


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006
    Posts
    76

    Default Compile "opcode"

    I tried compiling the code below for a PIC16F628A and I got and error stating:
    " opcode expected instead of '__config' ". Please help...

    -Mike

    CODE:

    @ __CONFIG _INTRC_OSC_NOCLKOUT & _MCLRE_ON & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON

    TRISB = %11101011
    CMCON = 7
    Baud con 16780 ' 2400 bauds
    Pre CON $A5
    Synch CON "~"
    In var byte

    LOW PORTB.2 ' inverted mode normal idle state
    pause 50

    Main:
    if (PORTB.1 = 0) then pressed
    goto main

    Pressed:
    serout2 PORTB.2, baud, [Pre, Synch,"1"]
    serin2 PORTB.3, baud, [WAIT(Synch),in]
    if (in == "1") then
    high PORTB.4
    pause 250
    low PORTB.4
    pause 250
    endif
    goto main

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Change:

    @ __CONFIG _INTRC_OSC_NOCLKOUT & _MCLRE_ON & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON

    to:

    @ DEVICE INTRC_OSC_NOCLKOUT & MCLR_ON & LVP_OFF & WDT_OFF & PWRT_ON & BOD_ON
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. Unable to pass a variable to LCDOUT without getting compile errors
    By Ferroto Baggins in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th February 2010, 16:43
  2. Compile and Program help using PICKit2
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th March 2009, 14:51
  3. USB PBPL Compile errors
    By Rob in forum USB
    Replies: 11
    Last Post: - 7th April 2008, 08:18
  4. Cannot compile for 40MHz 4 x pll
    By passion1 in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 21st October 2007, 17:50
  5. Replies: 2
    Last Post: - 9th February 2006, 22:03

Members who have read this thread : 1

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