Compilers
Update
History
The Compilers are regularly updated in order to add new items to them, or to correct anomalies that have crept into them because of the constant changes made within new devices by their manufacturer. Below is a list of the, more recent, additions and corrections that have been performed with both the 8-bit PIC compiler and the dsPIC33 and PIC24 compiler.
Additions made in version 4.0.0.4 of Positron8 and version 1.1.0.3 of Positron16
As of this upgrade to the compilers, the Proton8 compiler will be named the Positron8 compiler, and the Proton24 compiler will be named the Positron16 compiler. I won't go into details as to why, but it is fully covered on the compiler facebook group and on the compilers new forum.
Positron8 Additions
Added support for 18F devices; PIC18F25Q43, PIC18F26Q43, PIC18F27Q43, PIC8F45Q43, PIC18F46Q43, PIC18F47Q43, PIC18F55Q43, PIC18F56Q43, PIC18F57Q43.
These have a slightly different, and more efficient, RAM structure to standard 18F devices, and offer 8K of RAM.
Added support for Enhanced 14-bit core devices; PIC16F18424, PIC16F18425, PIC16F18444, PIC16F18445, PIC16F18455, PIC16F18456.
Added a new variable type named Pin, that allows a Port.Pin mask value to be sent to a procedure as a parameter, and it can also be created as a standard global or local variable. The Pin variable is unique to the Positron compilers and allows a whole new flexability to procedures.
Added a new command to enable or disable an indiviual pin's internal pull-up resistor. The command is named PinPullup.
Added a new command to set a pin to input, output, high, low, or an input with an internal pull-up resistor enabled. The command is named PinMode.
Altered the compiler's Asm listing to make it a lot more clearer to read and understand, for the user who is also learning, or uses, assembly code.
Added the ability to read the size of a Flash memory table created with the Dim As Flashx directives, within the SizeOf function and the Bound function.
Added the ability to use the SizeOf function and the Bound function within a Flash Memory table, and as a constant value in the Symbol directive.
Added an, optional, new mechanism for flash memory tables. A curly open bracket can start the table and no line continuations are required. With a curly close bracket ending the data tables. This makes Flash memory table creation a whole lot faster and easier to add too, or remove from.
Added the ability to use alias' to global variables and device SFRs as the parameter to a Procedure and as its Return variable. This can make procedures a lot more optimised, and faster in operation.
Added the ability to use the same mechanism when assigning to a String variable, when calling a procedure with a String variable parameter. i.e. MyProc(“Hello ” + “World ” + Str$(Dec, MyByte))
Altered the syntax in the USB HID library to match some of the additions made to the compiler over the years.
Added extra HPWM channels supported by the compiler for some 18F devices, such as the PIC18F26K22 and PIC18F46K22 etc...
Significantly updated the Positron8 compiler's manual with a new front cover and the extra features added to it.
Positron16 Additions
Added support for devices; dsPIC33CK32MP102, dsPIC33CK32MP103, dsPIC33CK32MP105, dsPIC33CK32MP202, dsPIC33CK32MP203, dsPIC33CK32MP205, dsPIC33CK32MP206, dsPIC33CK32MP502, dsPIC33CK32MP503, dsPIC33CK32MP505, dsPIC33CK32MP506, dsPIC33CK64MP102, dsPIC33CK64MP103, dsPIC33CK64MP105, dsPIC33CK64MP202, dsPIC33CK64MP203, dsPIC33CK64MP205, dsPIC33CK64MP206, dsPIC33CK64MP208, dsPIC33CK64MP502, dsPIC33CK64MP503, dsPIC33CK64MP505, dsPIC33CK64MP506, dsPIC33CK64MP508, dsPIC33CK128MP202, dsPIC33CK256MP208, dsPIC33CK256MP502, dsPIC33CK256MP503, dsPIC33CK256MP505, dsPIC33CK256MP506, dsPIC33CK256MP508.
These are the newer dsPIC devices and offer a large set of internal peripherals and can operate up to 100 MIPS (200Mhz).
Also added support for devices; PIC24FJ32MC104 and dsPIC33FJ32MC104.
Added a new variable type named Pin, that allows a Port.Pin mask value to be sent to a procedure as a parameter, and it can also be created as a standard global or local variable. The Pin variable is unique to the Positron compilers and allows a whole new flexability to procedures.
Added a new command to set a pin to input, output, high or low. The command is named PinMode.
Added the ability to read the size of a Flash memory table created with the Dim As Flashx directives, within the SizeOf function and the Bound function.
Added the ability to use the SizeOf function and the Bound function within a Flash Memory table, and as a constant value in the Symbol directive.
Added an, optional, new mechanism for flash memory tables. A curly open bracket can start the table and no line continuations are required. With a curly close bracket ending the data tables. This makes Flash memory table creation a whole lot faster and easier to add too, or remove from.
Added the ability to use alias' to global variables and device SFRs as the parameter to a Procedure and as its Return variable. This can make procedures a lot more optimised, and faster in operation.
Added the ability to use the same mechanism when assigning to a String variable, when calling a procedure with a String variable parameter. i.e. MyProc(“Hello ” + “World ” + Str$(Dec, MyByte))
Significantly updated the Positron16 compiler's manual with a new front cover and the extra features added to it.
Correction made in version 3.7.5.5 of Proton8.
Proton8 Correction
Corrected the comparison stack variables not being added to the Context Save/Restore stack while inside an interrupt.
Corrections made in version 1.0.8.0 of Proton24.
Proton24 Corrections
Corrected a Less Than or Equal comparison where a Byte variable and constant value are used with an And or Or used within the comparison.
Corrected the use of an alias as a parameter item.
Corrections made in version 3.7.5.4 of Proton8 and version 1.0.7.8 of Proton24.
Proton8 Corrections
Corrected the GetPin function on 18F devices.
Corrected the bit name RCIF not being recognised in standard 14-bit core devices when the HRsin command is used.
Corrected Context Save/Restore with a low priority interrupt handler.
Altered the syntax in the USB HID routine samples to match some of the changes made to the compiler over the years the demo was first created.
Proton24 Corrections
Corrected some comparisons where a negative constant value is used with a signed variabe type.
Corrections made in version 3.7.4.7 of Proton8.
Proton8 Corrections
Corrected the Push command on an 18F device giving an error if a casting type does not precede the parameter.
Corrected variable names used within constant expressions. These were giving incorrect adresses.
Corrected interrupt Context Save and Restore variable stack size.
Corrected the use of the Byte, Word, Long, Dword and Float casting directives in Cdata and Dim as Code statements when they are on following lines.
Corrections and Additions made in version 3.7.4.1 of Proton8 and version 1.0.7.4 of Proton24.
Proton8 Corrections
Corrected the names of Procedures that have the latter part of the name the same as a variable or SFR's name, but the first part of the name is also the name of another procedure.
Corrected variable count when arrays are created that use multiple bytes for an element. i.e. Word, Long, Dword, and Float arrays. Previous compiler versions were one element short in the final variable count.
Proton8 Additions
Added optimisation to the use of the Movffl mnemonic available on the newer 18F devices. This mnemonic is used to access RAM above the address of 4095, but requires 3 code memory words, and uses 3 clock cycles, so the compiler makes sure it is only used when absolutely required.
Added identifiers; Code8, Code16, Code24, Code32 and CodeF to the Dim As Code directive, and these will set the table's constant values to a strict size. For example; Dim FlashTable As Code16 will assign all the constant values in the data table attached to it, to 16-bit, regardless of their actual size. So smaller values will be padded, and larger values will be shortened to fit within 2 bytes of flash memory. The use of the identifiers has also been added to the compiler's manual.
Added two declares to automatically create Array variables or String variables above standard variables. i.e. “Heaped”. The declares are: Declare Auto_Heap_Arrays = on or off and Declare Auto_Heap_Strings = on or off. This will help standard variables from too many RAM bank changes because Arrays and Strings are normally accessed indirectly, which does not require RAM bank changes, but it keeps backward compatability if the declares are not used. The declares, when issued, will usually offer even more code optimisation, especially on 18F devices.
Altered the location of the compiler's system variables that hold Dim As Bit variables, so that they are closer to lower RAM. This will usually optimise the Asm code produced by the compiler on larger programs that contain more than eight Bit variables, because RAM banks have less chance to be different with differing Bit variables declared, which means the compiler does not have to produce more Asm mnemonics to counter the RAM bank changes when Bit variables are being assigned or compared.
If an “As” directive is not included in a Dim or a procedure paramater template with a following variable type, the compiler will default to a Word variable type or a Word Array variable type.
If a length is not assigned to a String variable when it is created with Dim or as a procedure parameter template, it will default to a length of 32 characters.
Proton24 Additions
Added Dword0, Dword1, SDword0 and SDword1 directives for casting a Double variable into two seperate Dword types.
Added the ExitProc command to Proton24. This will operate the same as in Proton and immediately exit a procedure.
Added identifiers; Code8, Code16, Code24, Code32, CodeF and CodeD to the Dim As Code directive, and these will set the table's constant values to a strict size. For example; Dim FlashTable As Code16 will assign all the constant values in the data table attached to it, to 16-bit, regardless of their actual size. So smaller values will be padded, and larger values will be shortened to fit within 2 bytes of flash memory. The use of the identifiers has also been added to the compiler's manual.
If an “As” directive is not included in a Dim or a procedure paramater template with a following variable type, the compiler will default to a Word variable type or a Word Array variable type.
If a length is not assigned to a String variable when it is created with Dim or as a procedure parameter template, it will default to a length of 32 characters.
Corrections and Additions made in version 3.7.3.9 of Proton8 and version 1.0.7.2 of Proton24.
Proton8 Additions
Added a new variable type. Long is now supported which will create unsigned 24-bit integer variables (This is still in final Beta testing, so please report any problems encountered).
Added the ability to have expressions within the Ptrx and CPtrx commands.
Added the ability to use the Call command to call a procedure as well as a label's name. i.e. Call MyProc()
Added the ability to use a Procedure's name or a Sub's name straight after the Then directive.
Proton8 Corrections
Corrected the use of the text “Dev” in Config_Start-Config_End with 18F devices.
Corrected internal stack memory leak if too many expressions were used within nested comparisons.
Corrected the Val command with 14-bit core devices.
Corrected the missing system variable PP3 with the Val command on enhanced 14-bit core devices.
Corrected the missing error message if a Next command is not used after a For command when inside a loop. The compiler used to generate confusing assembler error messages.
Corrected Baud rates for the newer 18FxxK and 18FxxQ devices with the modified EUSART peripherals. The Baud rate now uses the division of 16 or the division of 4 to get the best Baud rate available for the oscillator frequency used.
Corrected Cwrite on enhanced 14-bit core devices with interrupts operating in the background. Both the Cwrite and Cerase commands should have interrupts disabled in the BASIC program bofore operation, then re-enabled when the commands are finished. This applies to all device families.
Proton24 Additions
Added the Long directive to flash memory data tables using Dim as Code and Cdata. The Long directive will produce 24-bit constant values that require 3 bytes of flash memory.
Added Cread24 and CPtr24 commands to read 24-bit constant data placed in an flash memory table.
Altered the Proton24 compiler's manual to include the Long directive and the addition of the cPtr24 and Cread24 commands.
Added the ability to use the Call command to call a procedure as well as a label's name. i.e. Call MyProc()
Added the ability to use a Procedure's name or a Sub's name straight after the Then directive.
Added the ability to have expressions within the Ptrx and CPtrx commands.
Proton24 Corrections
Corrected flash memory sizes based upon the sizes from the official linker files and deeper reading of the official Microchip datasheets. For dsPIC33 and PIC24 devices, the amount of available flash is smaller that the datasheet initially states.
Corrected the missing error message if a Next command is not used after a For command when inside a loop. The compiler used to generate confusing linker error messages.
Correction and Additions made in version 3.7.3.5 of Proton8 and version 1.0.6.7 of Proton24.
Proton8 Additions
Added Support for devices; PIC18F24Q10, PIC18F25Q10, PIC18F26Q10, PIC18F27Q10, PIC18F45Q10, PIC18F46Q10 and PIC18F47Q10. Many thanks to Jon for his funding for the device additions.
The compiler now, by default, sets pins to Digital TTL and disables the Schmitt Triggers on each pin before a users program runs. This makes them as they used to be, because Microchip stupidly set them on by default, so programs that used to work would not with the newer K and Q devices, and the reason why not working would not be obvious.
Proton24 Correction
Corrected 16-bit integer (Word) subtraction when the assignment is used as the final operand. i.e. Wordout = Wordin – Wordout.
Corrections and Additions made in version 3.7.3.3 of Proton8 and version 1.0.6.6 of Proton24.
Proton8 Correction
Corrected bitwise ORing of a Constant and a Dword variable, when the Operand and the Assignment are different variables.
Proton24 Additions
Added HBusin2 and HBusout2 commands for suitable PIC24 devices with an MSSP2 peripheral. Many thanks to Ian for his funding for the command additions.
Commands HBStart2, HBStop2, HBRestart2, HBusAck2 and HBusNack2 have also been added.
Two new Declares have been added to set the pins used by the device for its MSSP2 peripheral. These are Declare HSDA2_Pin and Declare HSCL2_Pin.
The Proton24 compiler's user manual has been altered to add the new commands into it.
Corrections, Alterations and Additions made in version 3.7.3.1 of Proton8.
Proton8 Corrections
Corrected the SizeOf function used as a parameter within a command such as Hrsout or Print etc...
Corrected Estr used to load a String variable assignment on enhanced 14-bit core devices.
Corrected a variable name anomaly if it is named similar to a Procedure's name. The compiler was mistakenly creating a local variable name from a constant value because it joined the name and the constant, which are also the name of a procedure, when it was looking if a variable was local or global.
Made further corrections to USART3 and USART4 library routines for 18F devices. No devices available at hand for testing, but examining the new code thoroughly in the Asm window of the IDE (Press F2 Button) seems to fit the datasheets nicely. The problem seemed to be the incorrect PIRx SFRs used on some devices for testing if a byte is ready to transmit or receive.
Corrected the USART counts in some of the 18F devices PPI files that contain 4 USARTS. Note that a 5th USART is not supported by the compiler yet, but “watch this space for their addition”
Proton8 Addition
Added the directive Global, so that Global variables can be created from within a procedure. For Example: Global Dim MyByte as Byte
Proton8 Alterations
Altered what the compiler does not include in the program when the library code is disabled using the Declare Library_Core = Off directive in the program. It now also removes any pre-user run code so it leaves an empty code memory area. Very necessary when writing a bootloader's firmware.
Altered the RAM bank selecting mechanism in the Proton compiler. A Return command or an EndProc or EndSub will always reset RAM banks to 0 on 18F devices also. This may add extra code to a program, but it makes it a lot more effective and safe with newer devices having a lot more RAM, which means a lot more RAM Banks to maintain.