ME Labs, Inc.
719-520-5323
 
Home:
  Support home:
General Topics:
  FAQ
  Downloads and patches
  Sample programs
Support by Product:
  melabs USB/U2 
Programmer
  melabs Field
Programmer
  melabs Serial 
Programmer
  EPICâ„¢ 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
 

Frequently Asked Questions

PicBasic Compiler         More FAQ Categories        

PicBasic Compiler Program Examples

  1. Why do I get errors when I try to use PicBasic Compiler with Microchip's MPLAB?

  2. Do the PicBasic and PicBasic Pro Compilers work with the Microchip programmers?

  3. How do I use an LCD with PicBasic Compiler?

  4. Can I use PortA (C, D, E) with the PicBasic Compiler?

  5. How do I use the A/D converter on a PIC that is so equipped?

  6. I want to run a serial port at a baud rate other than 300, 1200, 2400 or 9600. Can either compiler do this?

  7. Does the PicBasic Compiler or the PicBasic Pro Compiler work with the PIC16C5x (505, 52, 54, 55, 56, 57, 58) parts?

  8. What about the PIC12C508, 509, 12CE518 and 519?

  9. How do I decide between the PicBasic Compiler and the PicBasic Pro Compiler?




  1. Why do I get errors when I try to use PicBasic Compiler with Microchip's MPLAB?

    See the MPLAB installation page.

    Top


  2. Do the PicBasic and PicBasic Pro Compilers work with the Microchip programmers?

    The PicBasic and PicBasic Pro Compilers generate standard .HEX files that can be used with most PICmicro programmers including Microchip's PICStart Plus, ICD2, and Promate.

    Top


  3. How do I use an LCD with PicBasic Compiler?

    Of course, an LCD serial backpack from Scott Edwards Electronics may be used in conjunction with the SEROUT instruction, just as with a BASIC Stamp. Or an LCD module may be connected directly to 6 or 7 PICmicro I/O pins. See the PicBasic LCD sample program  for an example.

    Top


  4. Can I use PortA (C, D, E) with the PicBasic Compiler?

    As with the A/D converter above, PortA (and other ports on PICmicros with more pins) may be accessed using either the PicBasic PEEK and POKE instructions or by using the in-line assembler feature. See the PORTA sample program for an example.

    Top


  5. How do I use the A/D converter on a PIC that is so equipped?

    The internal A/D converter may be accessed using either the PicBasic PEEK and POKE instructions or by using the in-line assembler feature. See the PicBasic ADC71 sample program for an example.

    Top


  6. I want to run a serial port at a baud rate other than 300, 1200, 2400 or 9600. Can either compiler do this?

    There are several ways to run at baud rates other than those listed. PicBasic Pro's DEBUG, DEBUGIN, HSERIN, HSEROUT, SERIN2 and SEROUT2 instructions allow the setting of any baud rate. The simplest way in the standard compiler is to change the clock oscillator to something other than 4MHz. If you run the PICmicro at 8MHz and tell it to use 9600 baud, for example, the actual bit rate will be 19,200 baud. Another method is to alter the baud rate table in the compiler library file. This is an ASCII text file that can be changed with any text editor (a backup should be made first). You can also use a PICmicro with a hardware serial port and set the baud rate to just about anything. The hardware USART on the PIC16C63, 65(AB), 73(ABC) or 74(ABC) may easily be accessed by simply PEEKing and POKEing it with the PicBasic Compiler. See the PicBasic USART sample program for an example. Or it can be set directly with the PicBasic Pro Compiler.

    Top


  7. Does the PicBasic Compiler or the PicBasic Pro Compiler work with the PIC16C5x (505, 52, 54, 55, 56, 57, 58) parts?

    The standard PicBasic Compiler does not support these parts. Their 12-bit core only has a 2-level stack and the compiler requires the 8-level stack of the mid-range 14-bit core PICmicros. There are suitable pin-compatible replacements for the 54, 56 and 58. The PIC16C554, 558, 620, 621 and 622 are an updated version of those 16C5x parts and are available in about the same price range. They have expanded features and work well with either the PicBasic Compiler or the PicBasic Pro Compiler.  PicBasic Pro Compiler has limited support for the  16C5x series PICmicros.

    Top


  8. What about the PIC12C508, 509, 12CE518 and 519?

    The standard PicBasic Compiler does not support these parts. These 8-pin PICmicros also have the 12-bit core and thus only a 2-level stack. The 8-pin PIC12C671, 672, 12CE673 and 674 have the 14-bit core and work with either compiler. PicBasic Pro Compiler has limited support for the  12C5xx series PICmicros.

    Top


  9. How do I decide between the PicBasic Compiler and the PicBasic Pro Compiler?

    See the comparison page

    Top