PDA

View Full Version : BUG With MPLAB 8.89 ...



Acetronics2
- 20th January 2013, 10:41
Hi, The team

a new message arrived with Mplab 8.89



Executing: "C:\PBP3\PBPX.EXE" -ampasmwin -k# -p12F1840 "Voltmètre12B.bas"
PICBASIC PRO(TM) Compiler 3.0.6.4, (c) 1998, 2012 microEngineering Labs, Inc.
All Rights Reserved.
Message[303] C:\PROGRAM FILES\MICROCHIP\MPLAB IDE\PROJETS\VOLTMèTRE12B.ASM 21 : Program word too large. Truncated to core size. (EF9C)
Message[303] C:\PROGRAM FILES\MICROCHIP\MPLAB IDE\PROJETS\VOLTMèTRE12B.ASM 22 : Program word too large. Truncated to core size. (DFFF)
Message[303] C:\PROGRAM FILES\MICROCHIP\MPLAB IDE\PROJETS\VOLTMèTRE12B.ASM 723 : Program word too large. Truncated to core size. (EF9C)
Message[303] C:\PROGRAM FILES\MICROCHIP\MPLAB IDE\PROJETS\VOLTMèTRE12B.ASM 723 : Program word too large. Truncated to core size. (DFFF)
Loaded C:\Program Files\Microchip\MPLAB IDE\Projets\Voltmètre12B.COF.
BUILD SUCCEEDED: Sun Jan 20 11:33:44 2013


asm line 21/22



__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_ON & _PWRTE_ON & _MCLRE_OFF & _BOREN_ON & _IESO_OFF
__CONFIG _CONFIG2, _PLLEN_ON & _BORV_LO & _LVP_OFF


line 723


END


This deals with the #CONFIG and END directives.

Everything was fine with 8.88 Version.

the .bas program :



'************************************************* ******************************
'Voltmètre12.bas
'
' R/C Expanded scale Voltmeter W/ Calibration @ 5v000
' Pic 12F1840
' 12 Multiplexed Leds

' 2 Display modes :
' - Jumper ON is Actual voltage BAR Display
' - Jumper OFF is Minimun reached Voltage in BAR Mode, plus Actual Voltage in DOT Mode
' ( intended to show Voltage swing under load )
'
' 985 Lines
'************************************************* ******************************

' Defines
'************************************************* ******************************
DEFINE OSC 32 ' not to disturb multiplexing !!!
DEFINE BUTTON_PAUSE 255

' Config
'************************************************* ******************************

#CONFIG

__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_ON & _PWRTE_ON & _MCLRE_OFF & _BOREN_ON & _IESO_OFF
__CONFIG _CONFIG2, _PLLEN_ON & _BORV_LO & _LVP_OFF

#ENDCONFIG

'#DEFINE Debugg

OPTION_REG = %00000001
WPUA = %00001000
OSCCON = %11110000 ' !!! SCS 1:0 = 00 pour PLL ON !!!
INTCON = 0
PIE1 = 0
T1CON = 0
T1GCON = 0
CM1CON0 = 7
ADCON0 = %00000001
ADCON1 = %11100011
FVRCON = %11010011

LATA = 0
TRISA = 255

'************************************************* ******************************
' Aliases

Modeselect VAR PORTA.3

'************************************************* ******************************
' Variables

Nvalue VAR WORD
Ivalue VAR WORD
Calval VAR WORD
Nominal VAR WORD

Mvalue VAR BYTE
Dvalue VAR BYTE
Value VAR BYTE
I VAR BYTE
J VAR BYTE

mode VAR BIT
modeI VAR BIT

CLEAR

Mvalue = 12
Dvalue = 12
Nominal = 8388

VDD_Res CON 10
FVrefmv CON 4096
VRef_AD5 CON EXT
@Vref_AD5 = (_FVrefmv *100000) / (500000000/ (1 << _VDD_Res))


'************************************************* ******************************
FirstCalib: ' !!! 5v000 Supply for calib.!!!

READ 0,WORD Calval
IF Calval = $FF THEN Calib ' Calibration ever done ?
PAUSE 2000 ' Settling time

Jumperon:

BUTTON Modeselect,0,255,0,I,1,Calib ' Jumper ON : redo calib.
GOTO test ' Jumper OFF : measure


Calib:

TRISA = %11111001 ' Red Led ON
LATA = %00000100

PAUSE 1000 ' Time to show LED

ADCON1 = %10110000 ' ADC temp. setting
' for Calibration
WHILE !FVRCON.6 : WEND
ADCIN 31,Calval ' Nominal 838.86 @ 5v000
Calval = Calval * 10

WRITE 0, WORD Calval

ADCON1 = %11100011 ' ADC Norm. resetting

LATA = 0
TRISA = %11001111
LATA = %00010000 ' Green Led ON

PAUSE 1000 ' Time to show Led !
LATA = 0 ' Display OFF

'************************************************* ******************************
test:

Calval = Nominal ' just for the test !!!

FOR Value = 1 to 12

Mode = 0 : ModeI = 0
GOSUB Display
PAUSE 200

NEXT Value

LATA = 0
Dvalue = 0

'************************************************* ******************************
'Take jumper OFF While test or after PWR OFF to get Alternate mode @ first run
'************************************************* ******************************
Displaymode:

BUTTON Modeselect,0,255,0,I,0,First ' Display actual Voltage
ModeI = 1 ' IF Jumper OFF then Alternate mode

'************************************************* ******************************
First: '

ADCON0.1 = 1 'Launch First Conversion

Wait0:
FOR I = 1 to 16

IF ADCON0.1 = 0 THEN
Nvalue = ADRESH*256 + ADRESL ' read ADC result if ready
ELSE
GOTO Wait0 ' 50µs per conv.
ENDIF

ADCON0.1 = 1 ' relaunch conversion
Ivalue = ( Nvalue +(Ivalue*9)) /10 ' First Value for Ivalue
' = True value for Mvalue !
NEXT I

PAUSE 1000


'************************************************* ******************************
Main:

WHILE 1

Wait1:
IF ADCON0.1 = 0 THEN
Nvalue = ADRESH*256 + ADRESL ' read ADC result if ready
ELSE
GOTO Wait1
ENDIF

ADCON0.1 = 1 ' relaunch conversion
Ivalue = (Nvalue + (Ivalue*9))/10 ' Rolling average

Nvalue = Nvalue * Calval ' Works
Ivalue = DIV32 Nominal

GOSUB Convert

IF Dvalue < Mvalue THEN Mvalue = Dvalue ' Memorize Minimum

'************************************************* ******************************
' Prepare value to be displayed

IF ModeI = 1 THEN

FOR I = 0 to Dvalue ' Bar Display Actual value
Value = I
GOSUB Display
NEXT I

ELSE

FOR I = 0 to Mvalue ' Bar Display Min Value
Value = I
GOSUB Display
NEXT I

Value = Dvalue ' Add Actual Value dot
GOSUB Display
ENDIF

WEND
END

' SUBROUTINES
'************************************************* ******************************
'************************************************* ******************************
Display:

LATA = 0 'Prevent Ghosting

LOOKUP Value,[%11111111,%11111001,%11111001,%11101101,%11101101, %11011101,%11011101,_
%11101011,%11101011,%11011011,%11011011,%11001111, %11001111], TRISA

LATA.1 = !!(value == 2)|| (value == 4) || (value == 6)
LATA.2 = !!(value == 1)|| (value == 8) || (value ==10)
LATA.4 = !!(value == 3)|| (value == 7) || (value ==12)
LATA.5 = !!(value == 5)|| (value == 9) || (value ==11)


PAUSE 1
RETURN
'************************************************* ******************************
Convert: 'Convert ADC Counts to LED#

LOOKDOWN2 Ivalue, < [513,526,538,551,563,576,588,601,613,626,638,651,66 3,1024], Dvalue
IF Dvalue > 12 THEN Dvalue = 12

'************************************************* ******************************
''Test purpose values set
'LOOKDOWN2 Ivalue, < [551,563,576,588,601,613,626,638,651,663,676,688,70 0,1024], Dvalue
'IF Dvalue > 12 THEN Dvalue = 12
'************************************************* ******************************
RETURN
END



This is a nice multiplexed 12 Leds Volmeter ...

Alain

Darrel Taylor
- 20th January 2013, 18:15
This issue affects all languages. It is not specific to PicBasic Pro.
It only affects the Enhanced core devices (12F1xxx and 16F1xxx).

Programs are compiled correctly, but non-critical messages are reported.

Those messages can be supressed with ...
#HEADER
errorlevel -303 ; suppress Program word too large
#ENDHEADER


Hopefully Microchip will fix it.
If not, PBP will need to suppress it by default.

Acetronics2
- 21st January 2013, 16:13
Programs are compiled correctly, but non-critical messages are reported.


Thank you Darrel ...
as we ( mere mortals ;) ) do not have possibility to verify compilation is correct ...

Alain

Darrel Taylor
- 8th May 2013, 23:18
This seems to be a permenant problem with MPLAB now.

So with PBP 3.0.7.x and later, all [303] messages will be suppressed on the Enhanced core devices.

If you are getting the "Program word too large. Truncated to core size." messages ... update your version of PBP3.
Or, Even if you're not getting those messages ... update your version of PBP3.

If you already have PBP3, the updates are free. So keep it up to date.
http://pbp3.com/download.html

Ioannis
- 9th May 2013, 09:44
After updating to 3.0.7.4 I get

ERROR: Unable to execute MPASMWIN.

My MPLAB is 8.85, does it matter?

Ioannis

Acetronics2
- 9th May 2013, 10:32
Hi, Ioannis

as the " bug " was linked to the lasts revs of MPLAB ... seems obvious you have to update MPLAB ...

Everything fine here with MPLAB 8.90 and MCSPX ...

Regards
Alain

Ioannis
- 9th May 2013, 12:04
Hi Alain. Yes it compiles OK now. I am in general reluctant to update MPLAB with no apparent reason.

Of course now it (MPLAB) does not "see" my Pickit3...

Thanks,
Ioannis

Acetronics2
- 9th May 2013, 15:50
I played somewhat with my PK3 and the 18F45K20 demo board, from MPLAB IDE ...

no problem noticed ... what happens to you ?

BTW ... MPLAB became 8.91 version, now ...

Alain

Ioannis
- 9th May 2013, 21:18
Yes, I downloaded 8.91.

Normally I use the stand alone application for the Pickit2 and 3.

From within the Mplab IDE, it says that Pickit3 was found but then it expected 4 bytes which were never received.

ICD3 works OK by the way.

It is not very serious problem for me, since I have other alternatives, just noticed it.

Ioannis