Announcement

Collapse
No announcement yet.

SETUP_16_F88_0_CONFIG_3.ASM (46) : Missing opera

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SETUP_16_F88_0_CONFIG_3.ASM (46) : Missing opera

    [ASM ERROR] SETUP_16_F88_0_CONFIG_3.ASM (46) : Missing operator
    [ASM ERROR] SETUP_16_F88_0_CONFIG_3.ASM (46) : Symbol not previously defined (x)

    Please Help : see attached program


    '****************************************************************
    '* Name : TEST_0_16F88_config_3 *
    '* Author : [WVA] *
    '* Notice : Copyright (WVA) 2014 *
    '* : All Rights Reserved *
    '* Date : May/ 2015 *
    '* Version : 1.0 *
    '* Notes : INITIAL_SETUP_16F88 *
    '* : *
    '****************************************************************
    ;----[16F88 Hardware Configuration]---------------------------------------------

    ;----[16F88 Hardware Configuration]---------------------------------------------

    #IF __PROCESSOR__ = "16F88"

    #DEFINE MCU_FOUND 1

    #CONFIG

    cfg1 = _INTRC_IO ; INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin
    cfg1&= _WDT_OFF ; WDT enabled
    cfg1&= _PWRTE_OFF ; PWRT disabled
    cfg1&= _MCLR_ON ; RA5/MCLR/VPP pin function is MCLR
    cfg1&= _BODEN_ON ; BOR enabled
    cfg1&= _LVP_OFF ; RB3 is digital I/O, HV on MCLR must be used for programming
    cfg1&= _CPD_OFF ; Code protection off
    cfg1&= _WRT_PROTECT_OFF ; Write protection off
    cfg1&= _DEBUG_OFF ; In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
    cfg1&= _CCP1_RB0 ; CCP1 function on RB0
    cfg1&= _CP_OFF ; Code protection off
    __CONFIG _CONFIG1, cfg1

    cfg2 = _FCMEN_ON ; Fail-Safe Clock Monitor enabled
    cfg2&= _IESO_ON ; Internal External Switchover mode enabled

    __CONFIG _CONFIG2, cfg2 x

    #ENDCONFIG

    #ENDIF

    ;----[Verify Configs have been specified for Selected Processor]----------------
    ; Note: Only include this routine once, after all #CONFIG blocks
    #IFNDEF MCU_FOUND
    #ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
    #ENDIF


    'define OSC 4
    OSCCON=%01100000
    cmcon = 7 'comparator off
    ADCON1 = 7 'analog digital of
    ANSEL=0 'set i/o to digital

    TRISA=%11111111 'all A ports inputs
    'PORTB=%00000000 'Initiate all port B pins to 'low
    TRISB=%1100000 ' all ports outputs

    main:
    PORTB.0=0 'LED of
    'PORTB.1=1
    pause 1000 'Delay 1/2 second
    PORTB.0=1 'LED on
    'PORTB.1=0
    PAUSE 1000 'Delay 1/2 second
    goto main 'Loop back and do it again

  • #2
    __CONFIG _CONFIG2, cfg2 x
    whats this x ?

    why can't post your code in the code tags ? you make code very difficult to evaluate unless you do

    Comment


    • #3
      Thank you for your response Richard .
      PS: I am not always programing; So my reply is all over the Days/ Hr..

      I pasted that from the meCONFIG Code Generator
      Configuration Generator for PBP3 meCONFIG.exe

      microEngineering Labs Ver. 1.0.0.11

      I need to remove that ?

      I removed, it it compiled OK.

      I will try to program it now.

      Please stay with me. I try to program The 16f88
      and I run in many problems.

      The code tags ? I am new to the forum and learn proper usage .

      Comment


      • #4
        [xCODE]

        [x/CODE]

        These are code tags after the x is removed. Clicking the # in the editor toolbar when you post provides the tags. Place you code between them.

        Comment


        • #5
          Originally posted by mackrackit View Post
          [xCODE]

          [x/CODE]

          These are code tags after the x is removed. Clicking the # in the editor toolbar when you post provides the tags. Place you code between them.

          '****************************************************************
          '* Name : TEST_0_16F88_config_3 *
          '* Author : [WVA] *
          '* Notice : Copyright (WVA) 2014 *
          '* : All Rights Reserved *
          '* Date : May/ 2015 *
          '* Version : 1.0 *
          '* Notes : INITIAL_SETUP_16F88 *
          '* : *
          '****************************************************************
          ;----[16F88 Hardware Configuration]---------------------------------------------



          #IF __PROCESSOR__ = "16F88"

          #DEFINE MCU_FOUND 1

          #CONFIG

          cfg1 = _INTRC_IO ; INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin
          cfg1&= _WDT_OFF ; WDT enabled
          cfg1&= _PWRTE_OFF ; PWRT disabled
          cfg1&= _MCLR_ON ; RA5/MCLR/VPP pin function is MCLR
          cfg1&= _BODEN_ON ; BOR enabled
          cfg1&= _LVP_OFF ; RB3 is digital I/O, HV on MCLR must be used for programming
          cfg1&= _CPD_OFF ; Code protection off
          cfg1&= _WRT_PROTECT_OFF ; Write protection off
          cfg1&= _DEBUG_OFF ; In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
          cfg1&= _CCP1_RB0 ; CCP1 function on RB0
          cfg1&= _CP_OFF ; Code protection off
          __CONFIG _CONFIG1, cfg1

          cfg2 = _FCMEN_ON ; Fail-Safe Clock Monitor enabled
          cfg2&= _IESO_ON ; Internal External Switchover mode enabled


          #ENDCONFIG

          #ENDIF

          ;----[Verify Configs have been specified for Selected Processor]---
          ; Note: Only include this routine once, after all #CONFIG blocks
          #IFNDEF MCU_FOUND
          #ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
          #ENDIF


          define OSC 4
          OSCCON=%01100000
          cmcon = 7 'comparator off
          ADCON1 = 7 'analog digital of
          ANSEL=0 'set i/o to digital

          TRISA=%11111111 'all A ports inputs
          'PORTB=%00000000 'Initiate all port B pins to 'low
          TRISB=%1100000 ' all ports outputs

          main:
          PORTB.0=0 'LED of
          'PORTB.1=1
          pause 1000 'Delay 1/2 second
          PORTB.0=1 'LED on
          'PORTB.1=0
          PAUSE 1000 'Delay 1/2 second
          goto main 'Loop back and do it again



          I hope this is correct ?

          Comment


          • #6
            I hope this is correct ?
            no
            and yet you still won't post your code in the "code tags "

            Code:
            '****************************************************************
             '* Name : TEST_0_16F88_config_3 *
             '* Author : [WVA] * 
             '* Notice : Copyright (WVA) 2014 *
             '* : All Rights Reserved *
             '* Date : May/ 2015 *
             '* Version : 1.0 *
             '* Notes : INITIAL_SETUP_16F88 *
             '* : *
             '****************************************************************
             ;----[16F88 Hardware Configuration]---------------------------------------------
            
            
            
             #IF __PROCESSOR__ = "16F88"
            
             #DEFINE MCU_FOUND 1 
            
             #CONFIG
            
             cfg1 = _INTRC_IO ; INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin
             cfg1&= _WDT_OFF ; WDT enabled
             cfg1&= _PWRTE_OFF ; PWRT disabled
             cfg1&= _MCLR_ON ; RA5/MCLR/VPP pin function is MCLR
             cfg1&= _BODEN_ON ; BOR enabled
             cfg1&= _LVP_OFF ; RB3 is digital I/O, HV on MCLR must be used for programming
             cfg1&= _CPD_OFF ; Code protection off
             cfg1&= _WRT_PROTECT_OFF ; Write protection off
             cfg1&= _DEBUG_OFF ; In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
             cfg1&= _CCP1_RB0 ; CCP1 function on RB0
             cfg1&= _CP_OFF ; Code protection off
              __CONFIG _CONFIG1, cfg1
            
             cfg2 = _FCMEN_ON ; Fail-Safe Clock Monitor enabled
             cfg2&= _IESO_ON ; Internal External Switchover mode enabled
              __CONFIG _CONFIG2, cfg2
            
             #ENDCONFIG
            
             #ENDIF
            
             ;----[Verify Configs have been specified for Selected Processor]---
             ; Note: Only include this routine once, after all #CONFIG blocks
             #IFNDEF MCU_FOUND
             #ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
             #ENDIF
            
            
             define OSC 4
             OSCCON=%01100000
             cmcon = 7 'comparator off
             ADCON1 = 7 'analog digital of
             ANSEL=0 'set i/o to digital
            
             TRISA=%11111111 'all A ports inputs
             'PORTB=%00000000 'Initiate all port B pins to 'low
             TRISB=%1100000 ' all ports outputs
            
             main:
             PORTB.0=0 'LED of
             'PORTB.1=1 
             pause 1000 'Delay 1/2 second
             PORTB.0=1 'LED on
             'PORTB.1=0
             PAUSE 1000 'Delay 1/2 second
             goto main 'Loop back and do it again

            Comment


            • #7
              regarding code tags

              I put a code tag on program start and program end


              '****************************************************************
              '* Name : TEST_0_16F88_config_3 *
              '* Author : [WVA] *
              '* Notice : Copyright (WVA) 2014 *
              '* : All Rights Reserved *
              '* Date : May/ 2015 *
              '* Version : 1.0 *
              '* Notes : INITIAL_SETUP_16F88 *
              '* : *
              '****************************************************************
              ;----[16F88 Hardware Configuration]---------------------------------------------



              #IF __PROCESSOR__ = "16F88"

              #DEFINE MCU_FOUND 1

              #CONFIG

              cfg1 = _INTRC_IO ; INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin
              cfg1&= _WDT_OFF ; WDT enabled
              cfg1&= _PWRTE_OFF ; PWRT disabled
              cfg1&= _MCLR_ON ; RA5/MCLR/VPP pin function is MCLR
              cfg1&= _BODEN_ON ; BOR enabled
              cfg1&= _LVP_OFF ; RB3 is digital I/O, HV on MCLR must be used for programming
              cfg1&= _CPD_OFF ; Code protection off
              cfg1&= _WRT_PROTECT_OFF ; Write protection off
              cfg1&= _DEBUG_OFF ; In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
              cfg1&= _CCP1_RB0 ; CCP1 function on RB0
              cfg1&= _CP_OFF ; Code protection off
              __CONFIG _CONFIG1, cfg1

              cfg2 = _FCMEN_ON ; Fail-Safe Clock Monitor enabled
              cfg2&= _IESO_ON ; Internal External Switchover mode enabled


              #ENDCONFIG

              #ENDIF

              ;----[Verify Configs have been specified for Selected Processor]---
              ; Note: Only include this routine once, after all #CONFIG blocks
              #IFNDEF MCU_FOUND
              #ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
              #ENDIF


              define OSC 4
              OSCCON=%01100000
              cmcon = 7 'comparator off
              ADCON1 = 7 'analog digital of
              ANSEL=0 'set i/o to digital

              TRISA=%11111111 'all A ports inputs
              'PORTB=%00000000 'Initiate all port B pins to 'low
              TRISB=%1100000 ' all ports outputs

              main:
              PORTB.0=0 'LED of
              'PORTB.1=1
              pause 1000 'Delay 1/2 second
              PORTB.0=1 'LED on
              'PORTB.1=0
              PAUSE 1000 'Delay 1/2 second
              goto main 'Loop back and do it again

              Comment


              • #8
                Originally posted by merlim View Post
                [ASM ERROR] SETUP_16_F88_0_CONFIG_3.ASM (46) : Missing operator
                [ASM ERROR] SETUP_16_F88_0_CONFIG_3.ASM (46) : Symbol not previously defined (x)

                Please Help : see attached program


                '****************************************************************
                '* Name : TEST_0_16F88_config_3 *
                '* Author : [WVA] *
                '* Notice : Copyright (WVA) 2014 *
                '* : All Rights Reserved *
                '* Date : May/ 2015 *
                '* Version : 1.0 *
                '* Notes : INITIAL_SETUP_16F88 *
                '* : *
                '****************************************************************
                ;----[16F88 Hardware Configuration]---------------------------------------------

                ;----[16F88 Hardware Configuration]---------------------------------------------

                #IF __PROCESSOR__ = "16F88"

                #DEFINE MCU_FOUND 1

                #CONFIG

                cfg1 = _INTRC_IO ; INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin
                cfg1&= _WDT_OFF ; WDT enabled
                cfg1&= _PWRTE_OFF ; PWRT disabled
                cfg1&= _MCLR_ON ; RA5/MCLR/VPP pin function is MCLR
                cfg1&= _BODEN_ON ; BOR enabled
                cfg1&= _LVP_OFF ; RB3 is digital I/O, HV on MCLR must be used for programming
                cfg1&= _CPD_OFF ; Code protection off
                cfg1&= _WRT_PROTECT_OFF ; Write protection off
                cfg1&= _DEBUG_OFF ; In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
                cfg1&= _CCP1_RB0 ; CCP1 function on RB0
                cfg1&= _CP_OFF ; Code protection off
                __CONFIG _CONFIG1, cfg1

                cfg2 = _FCMEN_ON ; Fail-Safe Clock Monitor enabled
                cfg2&= _IESO_ON ; Internal External Switchover mode enabled

                __CONFIG _CONFIG2, cfg2 x

                #ENDCONFIG

                #ENDIF

                ;----[Verify Configs have been specified for Selected Processor]----------------
                ; Note: Only include this routine once, after all #CONFIG blocks
                #IFNDEF MCU_FOUND
                #ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
                #ENDIF


                'define OSC 4
                OSCCON=%01100000
                cmcon = 7 'comparator off
                ADCON1 = 7 'analog digital of
                ANSEL=0 'set i/o to digital

                TRISA=%11111111 'all A ports inputs
                'PORTB=%00000000 'Initiate all port B pins to 'low
                TRISB=%1100000 ' all ports outputs

                main:
                PORTB.0=0 'LED of
                'PORTB.1=1
                pause 1000 'Delay 1/2 second
                PORTB.0=1 'LED on
                'PORTB.1=0
                PAUSE 1000 'Delay 1/2 second
                goto main 'Loop back and do it again
                Code:
                 '****************************************************************
                '*  Name    : TEST_0_16F88_config_3                             *
                '*  Author  : [WVA]                                             *                
                '*  Notice  : Copyright (WVA) 2014                              *
                '*          : All Rights Reserved                               *
                '*  Date    : May/ 2015                                         *
                '*  Version : 1.0                                               *
                '*  Notes   :  INITIAL_SETUP_16F88                              *
                '*          :                                                   *
                '****************************************************************
                ;----[16F88 Hardware Configuration]---------------------------------------------
                
                
                
                #IF __PROCESSOR__ = "16F88"
                 
                  #DEFINE MCU_FOUND 1   
                  
                #CONFIG
                
                cfg1 = _INTRC_IO    ; INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin
                cfg1&= _WDT_OFF                ; WDT enabled
                cfg1&= _PWRTE_OFF             ; PWRT disabled
                cfg1&= _MCLR_ON               ; RA5/MCLR/VPP pin function is MCLR
                cfg1&= _BODEN_ON              ; BOR enabled
                cfg1&= _LVP_OFF               ; RB3 is digital I/O, HV on MCLR must be used for programming
                cfg1&= _CPD_OFF               ; Code protection off
                cfg1&= _WRT_PROTECT_OFF       ; Write protection off
                cfg1&= _DEBUG_OFF             ; In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
                cfg1&= _CCP1_RB0              ; CCP1 function on RB0
                cfg1&= _CP_OFF                ; Code protection off
                  __CONFIG _CONFIG1, cfg1
                  
                cfg2 = _FCMEN_ON              ; Fail-Safe Clock Monitor enabled
                cfg2&= _IESO_ON               ; Internal External Switchover mode enabled
                 
                
                #ENDCONFIG
                
                #ENDIF
                
                ;----[Verify Configs have been specified for Selected Processor]---
                ;   Note: Only include this routine once, after all #CONFIG blocks
                  #IFNDEF MCU_FOUND
                  #ERROR  "No CONFIGs found for [" + __PROCESSOR__ +"]"
                  #ENDIF
                
                
                 define OSC 4
                 OSCCON=%01100000
                 cmcon = 7          'comparator off
                 ADCON1 = 7         'analog digital of
                 ANSEL=0            'set i/o to digital
                
                  TRISA=%11111111    'all A ports inputs
                 'PORTB=%00000000    'Initiate all port B pins to 'low
                  TRISB=%1100000    ' all ports outputs
                
                 main:
                  PORTB.0=0   'LED of
                 'PORTB.1=1                                                                                          
                 pause 1000               'Delay 1/2 second
                  PORTB.0=1   'LED on
                 'PORTB.1=0
                 PAUSE 1000               'Delay 1/2 second
                 goto main               'Loop back and do it again

                Comment


                • #9
                  after only 10 months code posted in code tags , congratulations .
                  next step is to read and understand the replies .
                  what is the difference between my posted code in post#6 an yours (clue red)

                  Comment


                  • #10
                    I am very sorry about that !

                    Dear Richard Please disregard everything I posted so fare
                    had to go back to basics.
                    I drove every body crazy whit the 16F88 code.
                    I am very sorry about that !


                    USB U2 Not programming ?

                    Any body knows please Help:
                    PS: My first languish is German
                    typing on a German keyboard

                    I have installed :

                    PBP #3 Gold
                    Micro Code Studio Plus V 5.0.0.5
                    Compiler V PBPX 3.0.6.4
                    MPLAB IDE V 8.85

                    Programmer : USB U2 melabs 4.5. Firmware 5.9
                    Chip Target info ID 09A4 (16F877)

                    My problem started when I tried to program PIC16F88.

                    So I went back to BASICs:
                    I use the USB U2 melabs with a LAB-X2 from meLAB
                    Chip is 16F877-20/P .
                    Yes power is supplied to the LAB-X2
                    My programmer gets power from a powered USB Port

                    My program is blink3x2 from meLAB sample library for the LAB-X2

                    When I go [program compile inMicro Code Studio] it appears every thing is fine however
                    the red programming LED on the U2 Programmer is not flashing !
                    And I don’t get the desired results on the LAB-X2

                    When I program from the meLAB Programmer it appears to program just
                    fine [the red led is flashing].unfortunate I don’t get the desired results on the LAB-X2.
                    Except now the hex code is changed !

                    Code:
                     ' Name        : BLINK3X2.pbp
                    ' Compiler    : PICBASIC PRO Compiler 2.6
                    ' Assembler   : PM or MPASM
                    ' Target PIC  : 28/40-pin PIC types compatible with LAB-X2 board
                    ' Hardware    : LAB-X2 Experimenter Board
                    ' Oscillator  : 4MHz external crystal
                    ' Keywords    : FOR NEXT
                    ' Description : PICBASIC PRO program to blink 3 LEDS in sequence.
                    ' 16F877
                    
                    ' Define LOADER_USED to allow use of the boot loader.
                    ' This will not affect normal program operation.
                    'Define LOADER_USED 1
                    
                     i Var Byte   ' Define loop variable
                    LEDS Var PORTB  ' Alias PORTB to LEDS
                    
                       TRISB = %00000000  ' Set PORTB to all output
                    
                    mainloop:
                       LEDS = 1           ' First LED on
                       Pause 500          ' Delay for .5 seconds
                    
                       For i = 1 To 2     ' Go through For..Next loop 2 times
                         LEDS = LEDS << 1 ' Shift on LED one to left
                         Pause 500        ' Delay for .5 seconds
                       Next i
                       Goto mainloop      ' Go back to mainloop and blink LED forever
                    
                       End

                    Comment


                    • #11
                      if you compile this code
                      Code:
                      '****************************************************************
                       '* Name : TEST_0_16F88_config_3 *
                       '* Author : [WVA] * 
                       '* Notice : Copyright (WVA) 2014 *
                       '* : All Rights Reserved *
                       '* Date : May/ 2015 *
                       '* Version : 1.0 *
                       '* Notes : INITIAL_SETUP_16F88 *
                       '* : *
                       '****************************************************************
                       ;----[16F88 Hardware Configuration]---------------------------------------------
                      
                      
                      
                       #IF __PROCESSOR__ = "16F88"
                      
                       #DEFINE MCU_FOUND 1 
                      
                       #CONFIG
                      
                       cfg1 = _INTRC_IO ; INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin
                       cfg1&= _WDT_OFF ; WDT enabled
                       cfg1&= _PWRTE_OFF ; PWRT disabled
                       cfg1&= _MCLR_ON ; RA5/MCLR/VPP pin function is MCLR
                       cfg1&= _BODEN_ON ; BOR enabled
                       cfg1&= _LVP_OFF ; RB3 is digital I/O, HV on MCLR must be used for programming
                       cfg1&= _CPD_OFF ; Code protection off
                       cfg1&= _WRT_PROTECT_OFF ; Write protection off
                       cfg1&= _DEBUG_OFF ; In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
                       cfg1&= _CCP1_RB0 ; CCP1 function on RB0
                       cfg1&= _CP_OFF ; Code protection off
                        __CONFIG _CONFIG1, cfg1
                      
                       cfg2 = _FCMEN_ON ; Fail-Safe Clock Monitor enabled
                       cfg2&= _IESO_ON ; Internal External Switchover mode enabled
                        __CONFIG _CONFIG2, cfg2
                      
                       #ENDCONFIG
                      
                       #ENDIF
                      
                       ;----[Verify Configs have been specified for Selected Processor]---
                       ; Note: Only include this routine once, after all #CONFIG blocks
                       #IFNDEF MCU_FOUND
                       #ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
                       #ENDIF
                      
                      
                       define OSC 4
                       OSCCON=%01100000
                       cmcon = 7 'comparator off
                       ADCON1 = 7 'analog digital of
                       ANSEL=0 'set i/o to digital
                      
                       TRISA=%11111111 'all A ports inputs
                       'PORTB=%00000000 'Initiate all port B pins to 'low
                       TRISB=%1100000 ' all ports outputs
                      
                       main:
                       PORTB.0=0 'LED of
                       'PORTB.1=1 
                       pause 1000 'Delay 1/2 second
                       PORTB.0=1 'LED on
                       'PORTB.1=0
                       PAUSE 1000 'Delay 1/2 second
                       goto main 'Loop back and do it again
                      and manually load the hex file into the melabs programmer
                      is this what you get. changing to a 16f877 won't help and I have not got one to play with
                      Attached Files
                      Last edited by richard; 06-15-2015, 04:49 AM.

                      Comment


                      • #12
                        The only reason I switch to the 16F877 was because I have one
                        and I installed it in the meLab LAB-x2 board

                        I want to make sure everything is from meLab and hopefully works
                        together including there program samples.

                        U2 programer, cable, LAB-X2 board , recommended PIC chip,
                        and there sample software (blink3x2) .

                        Comment


                        • #13
                          Originally posted by richard View Post
                          if you compile this code
                          Code:
                          '****************************************************************
                           '* Name : TEST_0_16F88_config_3 *
                           '* Author : [WVA] * 
                           '* Notice : Copyright (WVA) 2014 *
                           '* : All Rights Reserved *
                           '* Date : May/ 2015 *
                           '* Version : 1.0 *
                           '* Notes : INITIAL_SETUP_16F88 *
                           '* : *
                           '****************************************************************
                           ;----[16F88 Hardware Configuration]---------------------------------------------
                          
                          
                          
                           #IF __PROCESSOR__ = "16F88"
                          
                           #DEFINE MCU_FOUND 1 
                          
                           #CONFIG
                          
                           cfg1 = _INTRC_IO ; INTRC oscillator; CLKO function on RA6/OSC2/CLKO pin and port I/O function on RA7/OSC1/CLKI pin
                           cfg1&= _WDT_OFF ; WDT enabled
                           cfg1&= _PWRTE_OFF ; PWRT disabled
                           cfg1&= _MCLR_ON ; RA5/MCLR/VPP pin function is MCLR
                           cfg1&= _BODEN_ON ; BOR enabled
                           cfg1&= _LVP_OFF ; RB3 is digital I/O, HV on MCLR must be used for programming
                           cfg1&= _CPD_OFF ; Code protection off
                           cfg1&= _WRT_PROTECT_OFF ; Write protection off
                           cfg1&= _DEBUG_OFF ; In-Circuit Debugger disabled, RB6 and RB7 are general purpose I/O pins
                           cfg1&= _CCP1_RB0 ; CCP1 function on RB0
                           cfg1&= _CP_OFF ; Code protection off
                            __CONFIG _CONFIG1, cfg1
                          
                           cfg2 = _FCMEN_ON ; Fail-Safe Clock Monitor enabled
                           cfg2&= _IESO_ON ; Internal External Switchover mode enabled
                            __CONFIG _CONFIG2, cfg2
                          
                           #ENDCONFIG
                          
                           #ENDIF
                          
                           ;----[Verify Configs have been specified for Selected Processor]---
                           ; Note: Only include this routine once, after all #CONFIG blocks
                           #IFNDEF MCU_FOUND
                           #ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
                           #ENDIF
                          
                          
                           define OSC 4
                           OSCCON=%01100000
                           cmcon = 7 'comparator off
                           ADCON1 = 7 'analog digital of
                           ANSEL=0 'set i/o to digital
                          
                           TRISA=%11111111 'all A ports inputs
                           'PORTB=%00000000 'Initiate all port B pins to 'low
                           TRISB=%1100000 ' all ports outputs
                          
                           main:
                           PORTB.0=0 'LED of
                           'PORTB.1=1 
                           pause 1000 'Delay 1/2 second
                           PORTB.0=1 'LED on
                           'PORTB.1=0
                           PAUSE 1000 'Delay 1/2 second
                           goto main 'Loop back and do it again
                          and manually load the hex file into the melabs programmer
                          is this what you get. changing to a 16f877 won't help and I have not got one to play with
                          When I go [program compile inMicro Code Studio] it appears every thing is fine however
                          the red programming LED on the U2 Programmer is not flashing !
                          And I don’t get the desired results .

                          When I program from the meLAB Programmer it appears to program just
                          fine [the red led is flashing].unfortunate I don’t get the desired results.
                          Except now the hex code is changed !

                          Comment


                          • #14
                            merlim I don't seem to be able to upload an image that actually works to this forum any longer I will try the other forum
                            Attached Files

                            Comment

                            Working...
                            X