News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Error compiling

Started by Giuseppe MPO, Dec 08, 2021, 07:06 PM

Previous topic - Next topic

Giuseppe MPO

Hello, compiling a program that didn't give me any problems a few months ago, now it gives me these errors.
The PIC is a PIC18F25K22.
Thanks

joesaliba

Maybe they are missing from the PPI file. Try adding: -

Dim PP_T3CCP1 as Byte System
Dim PP_T3CCP2 as Byte System

Regards

Joe

top204

What compiler version are you using, because I have just tried the HPWM commands on a PIC18F25K22 device and they operate as expected, and they are the only commands to use the CCP timer bits:

    Device = 18F25K22
    Declare Xtal = 16                   ' Setup to run at 16MHz

    Declare CCP1_Pin = PORTC.2
    Declare CCP2_Pin = PORTC.1
    Declare CCP3_Pin = PORTB.5
    Declare CCP4_Pin = PORTB.0
   
'------------------------------------------------------------------
Main:
    HPWM 1, 127, 1000
    HPWM 2, 127, 1000
    HPWM 3, 127, 1000
    HPWM 4, 127, 1000
 

Press the F2 button after a succesful compile and the compiler version is in the header text of the assembler file.

Giuseppe MPO


Hello Les,
the version I am using is the latest 4.0.1.3.
I also tried to compile your example and it gives me these errors.

RGV250

Hi,
Les's example compiles fine for me on 4.0.1.3, are you sure is is that version, do you have the old one still installed?

Bob

Giuseppe MPO

Hi Bob

Yes, absolutely sure, on the assembler page it clearly indicates 4.0.1.3,
maybe it's my problem, now I try to uninstall and reinstall everything again

top204

Run the free corrections update from here, over your current installation of version 4.0.1.3:

Positron Corrections Update 4.0.1.3 - 1.1.0.6

This may have the corrected Pos8.exe with the "PP_" texts on the CCP bit names added, because so many things get tweaked in the compilers, I cannot write all of them down, and sometimes I forget to write them down since my injury. :-(

I have tried version 4.0.1.3 and the above program compiles OK.

trastikata

Quote from: top204 on Dec 09, 2021, 03:12 PMRun the free corrections update from here, over your current installation of version 4.0.1.3:

Les, I can confirm - the example code is not compiling with the latest update.

ERR.jpg

Giuseppe MPO

hi Les,
I tried to update 4.0.1.3 and it didn't work, in compilation it gives the same errors.
I tried to uninstall everything and do a fresh install but the errors remain.
The installation from scratch, after cleaning the PC completely, I did it like this:

1) installed 3.7.5.5
2) installed from your link the 4.0.0.0
3) installed update 4.0.1.3.

Am I missing something?

Giuseppe MPO

I tried to add to my program the two lines recommended by joesaliba
and the program is all compiled correctly.

RGV250

Hi,
I wonder if the difference is the upgrade rather than the full install, I have the Full 4.0.0.0 so do not need the 3.7.5.5 to start with. What version does Trastikata have?

Bob

trastikata

Quote from: RGV250 on Dec 09, 2021, 05:27 PMI wonder if the difference is the upgrade rather than the full install, I have the Full 4.0.0.0 so do not need the 3.7.5.5 to start with. What version does Trastikata have?

Good point Bob, I also have to start with 3.7.5.5 and upgrade to 4.0.0.0

Bob, I am attaching the PPI and DEF files for 18F25K22 - can you compare the contents with the ones you have?

RGV250

#12
Hi,
The PPI is slightly different, mine is on the right.
Done with Winmerge if anyone is interested, it is brilliant for comparing text files.
18F25K22.JPG

Bob

trastikata

Quote from: RGV250 on Dec 09, 2021, 05:53 PMThe PPI is slightly different, mine is on the right.
Done with Winmerge if anyone is interested, it is brilliant for comparing text files.

Thanks Bob, adding the missing line indicating which HPWM routine should be used, resolves the issue. Interesting, why the update doesn't modify the PPI file as it is supposed to do?

This, however, raises another question that maybe Les can answer - is this failure to update the specific PPI file limited only to this devices because of omission somewhere in the update code, or this is more general problem and it is happening to all PPI files that were supposed to be updated with the latest patches?

P.s. Thanks for the Winmerge suggestion.

NOERR.jpg

top204

#14
You all beat me to it. :-)

I had forgotten to add the modified p18F25K22.ppi file to the installer's directory, and that is causing the issue.

In the p18F25K22.ppi file, the top text should be:

[INFOSTART]
CORE=16             ; Core Type: 12, 14, or 16
MAXRAM=1536         ; Amount of RAM
MAXCODE=32768       ; Amount of Code Memory (in Bytes)
PORTS=5             ; Amount of Ports
ADC=19              ; Amount of ADCs
ADRES=10            ; Resolution of the ADC
EEPROM=256          ; Amount of On-Board Eeprom (in Bytes)
RAM_BANKS=0         ; Amount of RAM Banks
BANKA_END=0x5F      ; Address of the End of Access RAM
UART=2              ; Amount of UARTs. 0, 1, or 2
USB=0
FLASH_WRITE=1       ; Whether the device has Self Modifying support. 0=No, 1=Read and Write, 2=Read no Write
MSSP=2              ; 0=None, 1=Single MSSP, 2=Dual MSSP, 3=SSP Only
HPWM=4              ; Amount of PWM channels (supported by the compiler) available
HPWM_TYPE=2         ; The type of HPWM library to use for the device
BLOCK=32            ; Size of the Code Memory Write Segment (in Bytes)
ERASE=64            ; Size of the Code Memory Erase Segment (in Bytes)
DEBUG=1             ; Whether the Device has Debug Capabilities (1 or 0)
[INFOEND]

Only change the .ppi files with notepad or a standard text editor, and never a word processor or Windows "word" because these add invisible directives to the text.

Microchip have changed the way all peripherals work on individual devices, so I have had to add extra directives in the PPI files, so the compiler knows what code to use for a particular device. I know... Utter stupidity from Microchip, but it is gettng worse as time goes on with them, and the same is happenng with other microcontroller devices. For example ARM... There are a few hundred types of ARM, and are all different!!!

It's not just me who is having some logistic difficulties with the plethora of, unnecessary, changes made to some peripherals either. The Microchip libraries for the MPLABX and Microchip compilers are altered every few days to deal with the changes... So if Microchip cannot get it correct for their own devices, what chance do I have to get it right first time, everytime. LOL

Dompie

Quote from: RGV250 on Dec 09, 2021, 05:53 PM.....Done with Winmerge if anyone is interested, it is brilliant for comparing text files....

Thanks Bob excellent advise!

Johan