• AVR Freaks

Helpful ReplyStrange problem caused by config statements

Author
leon_heller
Super Member
  • Total Posts : 6411
  • Reward points : 0
  • Joined: 2004/08/17 13:19:45
  • Location: St. Leonards-on-Sea, E. Sussex, UK.
  • Status: offline
2013/01/09 14:35:03 (permalink)
0

Strange problem caused by config statements

This might have arisen since upgrading to MPLAB 8.89. When I assemble any program with config statements I get Program word too large warnings like this:
 
 
----------------------------------------------------------------------
Debug build of project `C:\PIC\16F\16F1827\Test.mcp' started.
Language tool versions: MPASMWIN.exe v5.48, mplink.exe v4.46, mplib.exe v4.46
Preprocessor symbol `__DEBUG' is defined.
Wed Jan 09 21:24:21 2013
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\PIC\16F\16F1827\Test.mcs".
Clean: Done.
Executing: "C:\Program Files (x86)\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F1827 "16F1827TEMP.ASM" /l"16F1827TEMP.lst" /e"16F1827TEMP.err" /d__DEBUG=1
Message[303] C:\PIC\16F\16F1827\16F1827TEMP.ASM 51 : Program word too large.  Truncated to core size. (C1E4)
Message[303] C:\PIC\16F\16F1827\16F1827TEMP.ASM 52 : Program word too large.  Truncated to core size. (DCFF)
Message[303] C:\PIC\16F\16F1827\16F1827TEMP.ASM 121 : Program word too large.  Truncated to core size. (C1E4)
Message[303] C:\PIC\16F\16F1827\16F1827TEMP.ASM 121 : Program word too large.  Truncated to core size. (DCFF)
Executing: "C:\Program Files (x86)\Microchip\MPASM Suite\mplink.exe" /p16F1827 "16F1827TEMP.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"16F1827TEMP.cof" /M"16F1827TEMP.map" /W /x
MPLINK 4.46, Linker
Device Database Version 1.11
Copyright (c) 1998-2011 Microchip Technology Inc.
Errors    : 0

Loaded C:\PIC\16F\16F1827\16F1827TEMP.cof.
----------------------------------------------------------------------
Debug build of project `C:\PIC\16F\16F1827\Test.mcp' succeeded.
Language tool versions: MPASMWIN.exe v5.48, mplink.exe v4.46, mplib.exe v4.46
Preprocessor symbol `__DEBUG' is defined.
Wed Jan 09 21:24:25 2013
----------------------------------------------------------------------
BUILD SUCCEEDED

 
Here is the program (a template file):
 
 
;******************************************************************************
;   This file is a basic code template for code generation on the             *
;   PIC16F1827. This file contains the basic code building blocks to build    *
;   upon.                                                                     *
;                                                                             *
;   Refer to the MPASM User's Guide for additional information on             *
;   features of the assembler.                                                *
;                                                                             *
;   Refer to the respective data sheet for additional                         *
;   information on the instruction set.                                       *
;                                                                             *
;******************************************************************************
;                                                                             *
;    Filename:        xxx.asm                                                 *
;    Date:                                                                    *
;    File Version:                                                            *
;                                                                             *
;    Author:                                                                  *
;    Company:                                                                 *
;                                                                             *
;                                                                             *
;******************************************************************************
;                                                                             *
;    Files Required: P16F1827.INC                                             *
;                                                                             *
;******************************************************************************
;                                                                             *
;    Notes:                                                                   *
;                                                                             *
;******************************************************************************
;                                                                             *
;    Revision History:                                                        *
;                                                                             *
;******************************************************************************


    list        p=16f1827      ; list directive to define processor
    #include    <p16f1827.inc> ; processor specific variable definitions

;------------------------------------------------------------------------------
;
; CONFIGURATION WORD SETUP
;
; The 'CONFIG' directive is used to embed the configuration word within the
; .asm file. The lables following the directive are located in the respective
; .inc file.  See the data sheet for additional information on configuration
; word settings.
;
;------------------------------------------------------------------------------   

    __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_ON & _IESO_OFF & _FCMEN_OFF
    __CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_19 & _LVP_OFF

;------------------------------------------------------------------------------
; VARIABLE DEFINITIONS
;
; Available Data Memory divided into Bank 0-15.  Each Bank may contain
; Special Function Registers, General Purpose Registers, and Access RAM
;
;------------------------------------------------------------------------------

    CBLOCK 0x20 ; Define GPR variable register locations
        MYVAR1  ; User variables allocated contiguously
        MYVAR2  ;
        MYVAR3  ;
    ENDC

SAMPLE1        EQU    0x7D        ; Sample user registers
SAMPLE2        EQU    0x7E        ;
SAMPLE3        EQU    0x7F        ;

;------------------------------------------------------------------------------
; EEPROM INITIALIZATION
;
; The 16F1827 has 256 bytes of non-volatile EEPROM, starting at address 0xF000
;
;------------------------------------------------------------------------------

DATAEE    ORG  0xF000
    DE    "MCHP"  ; Place 'M' 'C' 'H' 'P' at address 0,1,2,3

;------------------------------------------------------------------------------
; RESET VECTOR
;------------------------------------------------------------------------------

    ORG     0x0000            ; processor reset vector
    PAGESEL START
    GOTO    START             ; When using debug header, first inst.
                              ; may be passed over by ICD2. 

;------------------------------------------------------------------------------
; INTERRUPT SERVICE ROUTINE
;------------------------------------------------------------------------------

    ORG      0x0004

;------------------------------------------------------------------------------
; USER INTERRUPT SERVICE ROUTINE GOES HERE
;------------------------------------------------------------------------------

; Note the 16F1827 family automatically handles context restoration for
; W, STATUS, BSR, FSR, and PCLATH where previous templates for 16F families
; required manual restoration.  Shadow registers store these SFR values, and
; shadow registers may be modified since they are readable and writable for
; modification to the context restoration.   

    RETFIE                    ; return from interrupt
   
;------------------------------------------------------------------------------
; MAIN PROGRAM
;------------------------------------------------------------------------------

START

;------------------------------------------------------------------------------
; PLACE USER PROGRAM HERE
;------------------------------------------------------------------------------

    GOTO $

    END

post edited by leon_heller - 2013/01/09 14:36:32

Leon Heller
G1HSM

#1
vloki
Jo, alla!
  • Total Posts : 6801
  • Reward points : 0
  • Joined: 2007/10/15 00:51:49
  • Location: Germany
  • Status: offline
Re:Strange problem caused by config statements 2013/01/10 00:42:31 (permalink)
0
leon_heller
This might have arisen since upgrading to MPLAB 8.89. ...

May be.
With 8.88 it's:
----------------------------------------------------------------------
Debug build of project `D:\T-E-S-T\MPLAB\test8_88.mcp' started.
Language tool versions: mpasmwin.exe v5.46, mplink.exe v4.44, mcc18.exe v3.43, mplib.exe v4.44
Preprocessor symbol `__DEBUG' is defined.
Thu Jan 10 08:37:23 2013
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\eda\Microchip\mplabc18\v3.43\mpasm\mpasmwin.exe" /q /p16F1827 "tesst8_88.asm" /l"tesst8_88.lst" /e"tesst8_88.err" /d__DEBUG=1
Warning[207] D:\T-E-S-T\MPLAB\TESST8_88.ASM 68 : Found label after column 1. (SAMPLE1)
Warning[207] D:\T-E-S-T\MPLAB\TESST8_88.ASM 69 : Found label after column 1. (SAMPLE2)
Warning[207] D:\T-E-S-T\MPLAB\TESST8_88.ASM 70 : Found label after column 1. (SAMPLE3)
Warning[207] D:\T-E-S-T\MPLAB\TESST8_88.ASM 79 : Found label after column 1. (DATAEE)
Warning[207] D:\T-E-S-T\MPLAB\TESST8_88.ASM 113 : Found label after column 1. (START)
Executing: "C:\eda\Microchip\mplabc18\v3.43\bin\mplink.exe" /p16F1827 "tesst8_88.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"tesst8_88.cof" /M"tesst8_88.map" /W /x
MPLINK 4.44, Linker
Device Database Version 1.9
Copyright (c) 1998-2011 Microchip Technology Inc.
Errors    : 0

Loaded D:\T-E-S-T\MPLAB\tesst8_88.cof.
----------------------------------------------------------------------
Debug build of project `D:\T-E-S-T\MPLAB\test8_88.mcp' succeeded.
Language tool versions: mpasmwin.exe v5.46, mplink.exe v4.44, mcc18.exe v3.43, mplib.exe v4.44
Preprocessor symbol `__DEBUG' is defined.
Thu Jan 10 08:37:38 2013
----------------------------------------------------------------------
BUILD SUCCEEDED


post edited by vloki - 2013/01/10 00:45:21

Uffbasse !
#2
leon_heller
Super Member
  • Total Posts : 6411
  • Reward points : 0
  • Joined: 2004/08/17 13:19:45
  • Location: St. Leonards-on-Sea, E. Sussex, UK.
  • Status: offline
Re:Strange problem caused by config statements 2013/01/10 02:43:35 (permalink)
0
Thanks. I'm sure I'd have noticed those warnings with 8.88.
 
I checked a couple of projects and the 8.88 error files were empty. Building with 8.89 produced the warnings, so it does look like a problem with 8.89. I'll raise a support ticket.

Leon Heller
G1HSM

#3
MBedder
Circuit breaker
  • Total Posts : 6732
  • Reward points : 0
  • Joined: 2008/05/30 11:24:01
  • Location: Zelenograd, Russia
  • Status: offline
Re:Strange problem caused by config statements 2013/01/10 03:05:56 (permalink)
0
leon_heller Building with 8.89 produced the warnings, so it does look like a problem with 8.89. I'll raise a support ticket.
Don't!
 
Executing: "C:\eda\Microchip\mplabc18\v3.43\mpasm\mpasmwin.exe" /q /p16F1827 "tesst8_88.asm" /l"tesst8_88.lst" /e"tesst8_88.err" /d__DEBUG=1

Hint: the MPASM supplied with MPLAB 8.89 is v5.47 LoL
post edited by MBedder - 2013/01/10 03:17:50
#4
leon_heller
Super Member
  • Total Posts : 6411
  • Reward points : 0
  • Joined: 2004/08/17 13:19:45
  • Location: St. Leonards-on-Sea, E. Sussex, UK.
  • Status: offline
Re:Strange problem caused by config statements 2013/01/10 04:23:23 (permalink)
0
It looks as though it doesn't cause a problem, the config settings seem to be correct according to the Configuration Bits window. I'll try it on an actual chip.

Leon Heller
G1HSM

#5
MBedder
Circuit breaker
  • Total Posts : 6732
  • Reward points : 0
  • Joined: 2008/05/30 11:24:01
  • Location: Zelenograd, Russia
  • Status: offline
Re:Strange problem caused by config statements 2013/01/10 04:37:32 (permalink)
0
The older MPASM (and ASM30) did have this bug I recall. Later it was fixed, so just reconfigure the active toolsuit in MPLAB (make it MPASM instead of C18) and you're done.
#6
vloki
Jo, alla!
  • Total Posts : 6801
  • Reward points : 0
  • Joined: 2007/10/15 00:51:49
  • Location: Germany
  • Status: offline
Re:Strange problem caused by config statements 2013/01/10 04:41:40 (permalink)
5 (1)
MBedder
Executing: "C:\eda\Microchip\mplabc18\v3.43\mpasm\mpasmwin.exe" /q /p16F1827 "tesst8_88.asm" /l"tesst8_88.lst" /e"tesst8_88.err" /d__DEBUG=1

Hint: the MPASM supplied with MPLAB 8.89 is v5.47 LoL

You are right, my toolsuite settings are totally messed up   <edit> I did not select the right tool suite at all pink
(anyway, result for Language tool versions: MPASMWIN.exe v5.47, mplink.exe v4.45, mplib.exe v4.45 is the same)</edit>

I don't really use MPLAB calssic any more because I switched to MPLAB-X
Wwith PIC18, PICKIT3 and C18 and small projects X-IDE seems to be almost ok.
 
Anyway I updated to 8.88 right one or two days before 8.89 was announced   LoL
 
post edited by vloki - 2013/01/10 05:30:14

Uffbasse !
#7
leon_heller
Super Member
  • Total Posts : 6411
  • Reward points : 0
  • Joined: 2004/08/17 13:19:45
  • Location: St. Leonards-on-Sea, E. Sussex, UK.
  • Status: offline
Re:Strange problem caused by config statements 2013/01/10 04:49:41 (permalink)
0
The MPASM I'm using with MPLAB 8.89 is 5.48.
 
It seems to be the CONFIG1 and CONFIG2 that cause the problem, it doesn't arise with the 10F and 12F PICs which have a single CONFIG statement.
 
I can disable the warnings, of course, with errorlevel -303, but I then get  302 warnings (the bank switching ones). I'd have thought that both would be disabled.
post edited by leon_heller - 2013/01/10 04:52:52

Leon Heller
G1HSM

#8
MBedder
Circuit breaker
  • Total Posts : 6732
  • Reward points : 0
  • Joined: 2008/05/30 11:24:01
  • Location: Zelenograd, Russia
  • Status: offline
Re:Strange problem caused by config statements 2013/01/10 05:09:20 (permalink)
0
So does the MPASM v5.48 really generate that warning? Would you please quote the build window again?
#9
leon_heller
Super Member
  • Total Posts : 6411
  • Reward points : 0
  • Joined: 2004/08/17 13:19:45
  • Location: St. Leonards-on-Sea, E. Sussex, UK.
  • Status: offline
Re:Strange problem caused by config statements 2013/01/10 06:13:41 (permalink)
0
It's definitely using 5.48:
 
 
----------------------------------------------------------------------
Debug build of project `C:\PIC\16F\16F1827\Test.mcp' started.
Language tool versions: MPASMWIN.exe v5.48, mplink.exe v4.46, mplib.exe v4.46
Preprocessor symbol `__DEBUG' is defined.
Thu Jan 10 13:13:13 2013
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\PIC\16F\16F1827\16F1827TEMP.o".
Clean: Deleted file "C:\PIC\16F\16F1827\16F1827TEMP.err".
Clean: Deleted file "C:\PIC\16F\16F1827\16F1827TEMP.hex".
Clean: Deleted file "C:\PIC\16F\16F1827\16F1827TEMP.lst".
Clean: Deleted file "C:\PIC\16F\16F1827\16F1827TEMP.cof".
Clean: Done.
Executing: "C:\Program Files (x86)\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F1827 "16F1827TEMP.ASM" /l"16F1827TEMP.lst" /e"16F1827TEMP.err" /d__DEBUG=1
Message[303] C:\PIC\16F\16F1827\16F1827TEMP.ASM 51 : Program word too large.  Truncated to core size. (C1E4)
Message[303] C:\PIC\16F\16F1827\16F1827TEMP.ASM 52 : Program word too large.  Truncated to core size. (DCFF)
Message[303] C:\PIC\16F\16F1827\16F1827TEMP.ASM 122 : Program word too large.  Truncated to core size. (C1E4)
Message[303] C:\PIC\16F\16F1827\16F1827TEMP.ASM 122 : Program word too large.  Truncated to core size. (DCFF)
Executing: "C:\Program Files (x86)\Microchip\MPASM Suite\mplink.exe" /p16F1827 "16F1827TEMP.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"16F1827TEMP.cof" /M"16F1827TEMP.map" /W /x
MPLINK 4.46, Linker
Device Database Version 1.11
Copyright (c) 1998-2011 Microchip Technology Inc.
Errors    : 0

Loaded C:\PIC\16F\16F1827\16F1827TEMP.cof.
----------------------------------------------------------------------
Debug build of project `C:\PIC\16F\16F1827\Test.mcp' succeeded.
Language tool versions: MPASMWIN.exe v5.48, mplink.exe v4.46, mplib.exe v4.46
Preprocessor symbol `__DEBUG' is defined.
Thu Jan 10 13:13:15 2013
----------------------------------------------------------------------
BUILD SUCCEEDED

post edited by leon_heller - 2013/01/10 06:15:51

Leon Heller
G1HSM

#10
Swaroop Bekal
Senior Member
  • Total Posts : 156
  • Reward points : 0
  • Joined: 2007/07/26 22:53:07
  • Location: Microchip Technology
  • Status: offline
Re:Strange problem caused by config statements 2013/01/15 01:01:49 (permalink) ☄ Helpfulby JuliaDee 2016/11/21 09:48:10
5 (1)
I can confirm that this is an MPASM v5.48 issue and only PIC16F1xxx and PIC12F1xxx devices are affected. The config options values for these devices, in their .inc files, have the upper most two bits (which are not implemented) set to 1. The value of these upper most two bits should be 0. 
 
Prior to v5.48, MPASM did not used to properly check if the program/config words that it is outputting for these devices is within valid range. Now it does and if it finds any value greater than the valid range, then it truncates the word to proper size and issues a warning. The .inc files will be rectified in one of the future releases. 
 
For now, you can safely ignore the warning as this does not affect the behavior of the program since these bits which are truncated are not actually implemented. 
 
Thanks for reporting this. 
#11
leon_heller
Super Member
  • Total Posts : 6411
  • Reward points : 0
  • Joined: 2004/08/17 13:19:45
  • Location: St. Leonards-on-Sea, E. Sussex, UK.
  • Status: offline
Re:Strange problem caused by config statements 2013/01/15 02:13:02 (permalink)
0
Thanks. It didn't seem to affect program execution.

Leon Heller
G1HSM

#12
Gortzh
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2009/02/25 21:50:14
  • Location: 0
  • Status: offline
Re:Strange problem caused by config statements 2013/01/30 18:04:34 (permalink)
0
FYI I tried editing the .inc file and the warning went away
#13
vloki
Jo, alla!
  • Total Posts : 6801
  • Reward points : 0
  • Joined: 2007/10/15 00:51:49
  • Location: Germany
  • Status: offline
Re:Strange problem caused by config statements 2013/01/31 00:43:17 (permalink)
0
Oh, what a surprise wink

Uffbasse !
#14
MotoDog
Junior Member
  • Total Posts : 95
  • Reward points : 0
  • Joined: 2012/03/17 08:38:59
  • Location: 0
  • Status: offline
Re:Strange problem caused by config statements 2013/03/01 11:01:39 (permalink)
0
I am having this problem with 16F1825 stuff that used to be OK.
I tried changing the Config statement at least 5X, OK if I comment it out.
error......."Program word too large.  Truncated to core size. (FFE4)"
 
Must be a problem?? with new MPLAB 889?
#15
leon_heller
Super Member
  • Total Posts : 6411
  • Reward points : 0
  • Joined: 2004/08/17 13:19:45
  • Location: St. Leonards-on-Sea, E. Sussex, UK.
  • Status: offline
Re:Strange problem caused by config statements 2013/03/01 11:19:09 (permalink)
5 (1)
I reported a similar problem with the 16F1508 and Microchip Support has confirmed that it is a bug that has been introduced in 8.89. You should report your problem, to make sure that it gets fixed.
post edited by leon_heller - 2013/03/01 11:28:38

Leon Heller
G1HSM

#16
Jump to:
© 2019 APG vNext Commercial Version 4.5