logo image - link to home page

Products | Support | Resources | PurchaseContact  | Basket  | Checkout

  Home
  What's New
  Products
  Distributors
  Purchasing Info
  Developer Resources
  Support
  Upgrades
  Site Index
  Contact Us
  Pb-Free Info (RoHS)
 

 

keyword search:
 


 

Home:
  Support home:
General Topics:
    FAQ
    MCU selector guide
    Developer's resources
    Downloads and patches
    Sample programs
Support by Product:
    melabs USB/U2 
Programmer
    melabs Serial 
Programmer
    EPIC™ Plus PICmicro®  
Programmer
    Programming Adapters
    PICBASIC PRO™ 
Compiler
    PICBASIC™ Compiler
    PICPROTO™ Boards
    LAB-X1 Experimenter Board
    LAB-X2 Experimenter Board
    LAB-X3 Experimenter Board
    LAB-X4 Experimenter Board
    LAB-X18 Experimenter Board
    LAB-X20 Experimenter Board
    LAB-XT Experimenter Board
    LAB-XUSB Experimenter 
Board
    melabs Loader
 

New Limited 12-bit Core Support

PICBASIC PRO™ version 2.40 added limited support for all the 12-bit core PICmicro® 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 PICmicro 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:

Command

Reason

Data

No on-chip EEPROM

Dtmfout

Not enough RAM or stack

Eeprom

No on-chip EEPROM

Erasecode No support in devices

Freqout

Not enough RAM or stack

Hpwm

No hardware PWM

Hserin

No hardware serial port

Hserin2 No hardware serial port

Hserout

No hardware serial port

Hserout2 No hardware serial port

On Interrupt

No Interrupts

Read

No on-chip EEPROM

Readcode

No support in devices

Resume

No Interrupts

Serin2

Not enough RAM or stack

Serout2

Not enough RAM or stack

USBIn

No USB devices

USBInit

No USB devices

USBOut

No USB devices

USBService No USB devices

Write

No on-chip EEPROM

Writecode

No support in devices

Xin

Not enough RAM or stack

Xout

Not enough RAM or stack

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- or 16-bit core device with more resources.

Commands that have had their operation modified are:

Button:  The Define for debounce, BUTTON_PAUSE is limited to 65 milliseconds.

Debug, Debugin:  The Serin2 and Serout2 modifiers are not supported for these commands because of memory and stack size limits.

I2CRead, I2CWrite:  The I2C clock and data pins are fixed at compile time by Defines. They still must be specified in the I2CRead and I2CWrite statements, though this information is ignored by the compiler.

Define I2C_SDA PORTA,0
Define I2C_SCL PORTA,1

Because of memory and stack constraints, the Define for I2C_SLOW does not do anything. Low-speed (100 kHz) I2C devices may be used up to 4MHz. Above 4MHz, high-speed (400kHz) devices should be used.

The Define for I2C_HOLD has no effect.

Lcdout:  The Serout2 modifiers are not supported for this command because of memory and stack size limits.

OWIn, OWOut:  The Rep, Skip and Str modifiers are not supported for these commands because of memory and stack size limits.

Serout:  The open drain modes are not available due to TRIS register constraints.

Shiftin, Shiftout:  The Define for SHIFT_PAUSEUS is not available because of stack size limitations.

General Considerations:

Because of the architecture of the 12-bit core PICmicro MCUs, programs compiled for them by PBP will, in general, be larger and slower that programs compiled for the other PICmicro 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 PICmicro 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 PICmicro MCU with more general purpose RAM.

12-bit core PICmicro 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 PICmicro 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 PICmicro MCU instead of the 12-bit core device.

 

Copyright 2008
microEngineering Labs, Inc.
Box 60039
Colorado Springs CO 80960
(719) 520-5323
(719) 520-1867 fax
email: support@melabs.com

Last Updated: 08/04/2008

Home | What's New | Products | Support
Resources
| Purchase | Index Contact

PIC, PICmicro, dsPIC, and  MPLAB are registered trademarks of Microchip Technology Inc. in the USA and other countries.  PICBASIC, PICBASIC PRO, PICPROTO, and EPIC are trademarks of Microchip Technology Inc. in the USA and other countries.   BASIC Stamp is a trademark of Parallax, Inc.

Microchip third-party partner  Microchip Consultant Program Member