| Home | Products | Prices | Directory | Order | Contact | New | Books | Files | Links | Other |
| Bottom of Page |
PicBasic, New Name, New Features!
The PicBasic Compiler instruction set is compatible with the Parallax BASIC Stamp I. BASIC Stamp I programs can be compiled into PIC code ready for programming into a PIC, eliminating the need for a BASIC Stamp module. The benefits of the PicBasic Compiler include faster program execution than BASIC interpreters, longer programs possible and substantial cost savings over a BASIC Stamp.
New Peek and Poke instructions let you access PORTA, A/D converters and other on-PIC features in BASIC. Also in the latest release, the serial speed has been increased to 9600 baud.
Assembly language instructions may be mixed with BASIC instructions through the use of the PicBasic Compiler's in-line assembler and Call instruction. Our PIC macro assembler is included and automatically invoked by the PicBasic Compiler.
The PicBasic Compiler runs on PC compatibles. It can create programs for the PIC16C6x, 62x, 7x and 8x series PIC microcontrollers and works with most PIC programmers.
Available from DonTronics NOW.
Check the Dontronics "Manual and Disk" prices
page for full pricing calculations.
And check out the Dontronics Upgrade price from Standard PicBasic to
the PRO version of PicBasic.
Price includes PicBasic Compiler, and PIC Macro Assembler.
There is now a support group for Picbasic: Send a message to majordomo@qunos.net In the message body enter: subscribe picbasic-l This will then reply with a message to check your email exists and asking you to reply. Once this is done you can send a message to picbasic-l@qunos.net
' Blinks LED using HIGH and LOW commands to control specified pin. Symbol LED = 2 ' LED Pin Loop: High LED ' LED On Pause 1000 ' Delay 1 second Low LED ' LED Off Pause 1000 ' Delay 1 second goto Loop ' Forever
' Blink LEDs using For..Next Loops. Uses Nap for low power. Symbol LED1_DIR = DIR2 ' LED Direction Bit (0=Out, 1=In) Symbol LED2_DIR = DIR3 Symbol LED1_PIN = PIN2 ' LED Output Bit Symbol LED2_PIN = PIN3 LED1_DIR = 1 ' Make Pins Outputs LED2_DIR = 1 Loop: For LED2_PIN = 0 To 1 ' Toggle LED 1 For LED1_PIN = 0 To 1 ' Toggle LED 2 Nap 6 ' Delay Approx 1 Second (Low Power) Next LED1_PIN Next ' NOTE : No NEXT Variable goto Loop ' Forever
' Access PIC16C71 A/D using PEEK and POKE instructions. Symbol ADCON0 = 8 ' A/D Configuration Register 0 Symbol ADRES = 9 ' A/D Result Symbol ADCON1 = $88 ' A/D Configuration Register 1 Symbol SO = 0 ' Serial output poke ADCON1, 0 ' Set PORTA 0-3 to analog inputs poke ADCON0, $41 ' Set A/D to Fosc/8, Channel 0, On Loop: poke ADCON0, $45 ' Start conversion pause 1 ' Wait 1ms for conversion peek ADRES, B0 ' Get result to variable B0 serout SO,N2400,(#B0,10) ' Send variable to serial out goto Loop
' Read and write PORTA using PEEK and POKE instructions. Symbol PORTA = 5 ' PORTA address Symbol TRISA = $85 ' PORTA data direction register Symbol SO = 0 ' Serial output poke TRISA, 0 ' Set PORTA to all output poke PORTA, 31 ' Send a value to PORTA poke TRISA, 255 ' Set PORTA to all input Loop: peek PORTA, B0 ' Get PORTA inputs to variable B0 serout SO,N2400,(#B0,10) ' Send variable to serial out goto Loop
A. The PicBasic Compiler uses the BASIC Stamp I (PBASIC I) instruction set. However, most BASIC Stamp users are using only a few of the BASIC Stamp II specific instructions. BASIC Stamp II features such as more I/O pins can be accessed using the PicBasic Compiler's PEEK and POKE instructions or its in-line assembler function and assembler calls. These instructions allow any of the larger PICs expanded features to be accessed.
Q. I want to run a serial port at 9600 baud. Can the PicBasic Compiler do this?
A. Yes. The latest version of the PicBasic Compiler supports serial baud rates up to 9600. The supported baud rates are 300, 1200, 2400 and 9600.
Q. Does the PicBasic Compiler work with the PIC16C5x ( 54, 56, 58) parts?
A. The PicBasic Compiler does not support the older 5x series PICs. They only have a 2 level stack and the compiler requires the 8 level stack of the mid-range PICs. There are suitable pin compatible replacements for the 54, 56 and 58. The PIC16C620, 621 and 622 are an updated version of those 5x parts and are available in about the same price range. They have expanded features and are well suited to the PicBasic Compiler.
Q. Which PICs does the PicBasic Compiler support?
A. The PicBasic Compiler works with all of the PIC16C6x, 62x, 7x and 8x series PICs. These include the PIC16C61, 62, 620, 621, 622, 63, 64, 65, 71, 710, 711, 72, 73, 74, 83 and 84. It is particularly suited to the EEPROM PIC16C84 as it is a good match to the BASIC Stamp I feature set.
Q. How do I use the A/D converter on the PIC16C71?
A. The A/D converter on the PIC16C7x series parts may be accessed using either the PicBasic PEEK and POKE instructions or by using the in-line assembler feature. See the ADC71 sample program for an example.
Q. Can I use PORTA with the PicBasic Compiler?
A. As with the A/D coverter above, PORTA (and other ports on PICs 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.
Q. Can I use the PIC16C74 as a platform for PicBasic?
A. Yes, the '74 works OK with the compiler right now. Several people are using it. They want the A/D converters, real serial port, and more I/O. Peek and Poke makes it all possible.
Every PIC has a problem at the 2K boundary. It's because of the cool page crossing design. Calls and the like don't have enough bits to handle the long address. You have to set the PCLATH before each instruction that may try to go to either side of 2K. Since the compiler was designed to be as small as possible to allow programs to fit in 1K or .5K PICs, the boundary problem hasn't been addressed. You need to fix up the assembler code every place it tries to cross the boundary (usually a daunting task unless you can just use the upper 2K for tables or the like.) Writing in PIC assembler or C has the same issues.
microEngineering Labs are looking at addressing this and there may be
a future release that overcomes these limitations.
More user variables from B0-B79 and W0-W39 for use with larger PICs.
PicStic 4+ PASS function.
Interrupt vector access improved in INC\PBH.INC.
ENDASM previously had to be on a line all by itself.
Additional Info: Full Update Info and other
items of interest.
DonTronics offers the same upgrade policy that microEngineering Labs offer. That is, free software upgrades to the latest revision. You need only pay a $15AUD handling fee to receive the latest release.
Just E-Mail us and quote your DonTronics Registration number. The $15AUD Payment can now be done by Credit Card using our Internet On-line Secure Credit Card Facilities at http://www.dontronics.com/ord.html.
This service is only for DonTronics customers. Please
contact microEngineering Labs if you purchased elsewhere.
As per our agreement with mEL, new manuals must be purchased directly
form mEL, as they may get out of date quickly if DonTronics were to stock
them, however any new features are normally covered in the readme file
that come with the files update.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Home | Products | Prices | Directory | Order | Contact | New | Books | Files | Links | Other |
mailto: don@dontronics.com_
Copyright © 1996-99 DonTronics
| Top of Page |