ME Labs, Inc. 719-520-5323 |
Limited 12-bit Core SupportPICBASIC PRO™ version 2.40 added limited support for all the 12-bit core (instruction set) PIC® microcontrollers. The reason the support is limited is that the resources on the 12-bit core devices are limited. Some of these limits include only a two-level hardware stack and very small amounts of general purpose RAM memory. The code page size is also small at 512 bytes. There is also a limitation that calls and computed jumps can only be made to the first half (256 words) of any code page. These limitations have made it necessary to eliminate some compiler commands and modify the operation of some others. While many useful programs can be written for the 12-bit core PIC MCUs using the PICBASIC PRO Compiler, some applications will not be suited for these devices. Choosing a 14- or 16-bit core device with more resources will, in many cases, be the best solution. Commands that are not supported for the 12-bit core PICmicro MCUs:
Trying to use these commands with 12-bit core devices will result in numerous errors. If you must use one of these commands, choose a 14-bit or 16-bit core device with more resources.
General Considerations: Because of the architecture of the 12-bit core PIC MCUs, programs compiled for them by PBP will, in general, be larger and slower that programs compiled for the other PIC MCU families. In many cases, choosing a device from one of these other families will be more appropriate. However, many useful programs can be written and compiled for the 12-bit core devices. The two main programming limitations that will most likely occur are running out of RAM memory for variables and running past the first 256 word limit for the library routines. The compiler uses between 20 and 22 bytes of RAM for its internal variables, with additional RAM used for any necessary temporary variables. This RAM allocation includes a 4 level software stack so that the BASIC program can still nest GOSUBs up to 4 levels deep. Some PIC MCU devices only have 24 or 25 bytes of RAM so there is very little space for user variables on those devices. If the Unable To Fit Variable error message occurs during compilation, choose another PIC MCU with more general purpose RAM. 12-bit core PIC MCUs can call only into the first half (256 words) of a code page. Since the compiler's library routines are all accessed by calls, they must reside entirely in the first 256 words of the PIC MCU code space. Many library routines, such as I2CRead, are fairly large. It may only take a few routines to overrun the first 256 words of code space. If it is necessary to use more library routines that will fit into the first half of the first code page, it will be necessary to move to a 14- or 16-bit core PIC MCU instead of the 12-bit core device. |
Copyright 2022 ME Labs, Inc. PO Box 8250 Asheville NC 28814 (719) 520-5323 (719) 520-1867 fax email: support@melabs.com |
|