microEngineering Labs, Inc.
    719-520-5323
 
Home:
  Developer Resources:

Programming Clues
    Sample Programs
   
    PICBASIC PRO™
Compiler Manual
    PICBASIC™ Compiler
Manual
    Serin2/Serout2 Modes
    ASCII Character Set
    Number Conversion
    Floating Point
Routines
    PBP Debug Monitor
    Articles and Tutorials

Hardware Clues
    Parts / Vendor List
    PICPROTO™ Boards
    LAB-X1 Docs
    LAB-X2 Docs
    LAB-X20 Docs
    LAB-X3 Docs
    LAB-X4 Docs
    LAB-XUSB Docs
    LAB-XT Docs
     
 

General PBP examples

Concepts are the intent here, rather than specifics.

767pwm.pbpPICBASIC PRO program to demonstrate the steps necessary to use hardware PWM channel 3 on the 16F767 (and similar devices).
7segment.pbpPICBASIC PRO program to demonstrate 7-segment LED display. Schematic can be found at http://melabs.com/resources/articles/ledart.htm (fig 6).
a2d10.pbpPICBASIC PRO program to display result of 10-bit A/D conversion on LCD. Connect analog input to channel-0 (RA0).
a2d8.pbpPICBASIC PRO program to display result of 8-bit A/D conversion on LCD. Connect analog input to channel-0 (RA0).
adcin10.pbpPICBASIC PRO program to display result of 10-bit A/D conversion on LCD. Connect analog input to channel-0 (RA0).
adcin8.pbpPICBASIC PRO program to display result of 8-bit A/D conversion on LCD. Connect analog input to channel-0 (RA0).
asmint.pbpPICBASIC PRO program to demonstrate interrupts in assembly language. Turn LED on. Interrupt on PORTB.0 (INTE) turns LED off. Program waits .5 seconds and turns LED back on.
bcd.pbpPICBASIC PRO program to demonstrate conversion to and from BCD.
blink.pbpPICBASIC PRO program to to blink an LED connected to PORTB.0 about once a second
button.pbpPICBASIC PRO program to demonstate the BUTTON command. Prints working variable (in this case B0) to show how auto-repeat works. Prints 'PRESS' when button is pressed or repeated.
case.pbpPICBASIC PRO program to demonstate the Select Case...Case... End Select structure. Each loop results in the same output using slightly different conditions.
div32.pbpPICBASIC PRO program to demonstate the Div32 command. Div32 must be used immediately after a multiply statement in order to retain the state of the internal registers of the device.
ee.pbpPICBASIC PRO program to demonstate the EEPROM, READ and WRITE Commands. Works on targets with data EE only!!! Initialized address 0..3 and 8. Writes 10..63.
ee12ce.pbpPICBASIC PRO program to demonstate the I2CREAD and I2WRITE Commands. Writes to the first 16 locations of internal I2C EEPROM, then reads first 16 locations back and send via serial out repeatedly. Note: for PIC12CE67x MCUs.
ee16ce.pbpPICBASIC PRO program to demonstate the I2CREAD and I2WRITE Commands. Writes to the first 16 locations of internal I2C EEPROM. Reads first 16 locations back and send to serial out repeatedly. Note: for PIC16CE62x MCUs
eeword.pbpPICBASIC PRO program demonstrating how to READ and WRITE word variables to on-board EEPROM. Word is used to add 1000 to each location address and store the result. The word data must be stored as 2 separate bytes.
for.pbpPICBASIC PRO program demonstrating FOR..NEXT Command. Prints series of numbers showing STEP facility.
hardpwm.pbpPICBASIC PRO program to demonstrate hardware PWM. Output is a 1Khz signal with duty cycle sweeping from 20% to 80% once per second. PWM output will be on the CCP1 pin. Register names are for the PIC16F87x devices.
HSER.pbpPICBASIC PRO program to demonstrate sending and receiving with the hardware serial port. Defaults to 2400 bps.
i2c.pbpPICBASIC PRO program to demonstrate I2CREAD and I2WRITE Commands. Writes to the first 16 locations of an external serial EEPROM, then reads first 16 locations back and sends via serial out repeatedly. For EEPROMS with byte-sized address.
i2cee12.pbpPICBASIC PRO program to demonstate the I2CREAD and I2WRITE commands with internal EEPROM on 12-bit core. Writes to the first 16 locations of internal I2C EEPROM, then reads first 16 locations back and send to serial out repeatedly Tested on 12CE519. Outputs: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P.
i2cee625.pbpPICBASIC PRO program to demonstate the I2CREAD and I2WRITE Commands. Writes to the first 16 locations of internal I2C EEPROM. Reads first 16 locations back and send to serial out repeatedly. Note: for PIC16CE62x MCUs.
i2cee674.pbpPICBASIC PRO program to demonstate the I2CREAD and I2WRITE Commands. Writes to the first 16 locations of internal I2C EEPROM. Reads first 16 locations back and send to serial out repeatedly. Note: for PIC12CE67x MCUs.
i2cmast.pbpPICBASIC PRO program to read and write to I2C slave. Writes a 1-byte offset value, pauses, then reads an 8 character string from the slave. Expects to find the ADC conversion value (- offset) in the 6th position of the string.
i2cslave.pbpPICBASIC PRO program for I2C slave program - PIC16F877/PIC-X1.
lcd.pbpPICBASIC PRO program to demonstrate operation of an LCD in 4-bit mode.
logic.pbpPICBASIC PRO program to display truth table for binary logical operators.
lookdown.pbpPICBASIC PRO program to demonstrate the LOOKDOWN Command. Converts ASCII Hexadecimal characters to numeric equivalents.
lookup.pbpPICBASIC PRO program to demonstrate LOOKUP & RANDOM commands. Converts numeric value to ASCII hexadecimal equivalents.
maxmin.pbpPICBASIC PRO program to demonstrate MAX/MIN Operators. Uses MAX and MIN operators to Bound [0..9] to [3..7].
onewire.pbpPICBASIC PRO program to demonstrate 1-wire temperature display with LAB-X1 and DS1820 1-wire temp sensor.
onint.pbpPICBASIC PRO program to demonstrate use of On Interrupt Interrupts in BASIC. Turn LED on. Interrupt on PORTB.0 (INTE) turns LED off. Program waits .5 seconds and turns LED back on.
pulsin.pbpPICBASIC PRO program to demonstrate use of PULSIN command with Serial Pulse Width Meter.
pulsout.pbpPICBASIC PRO program to demonstrate use of PULSOUT command for a variable pulse generator. Two buttons adjust from off to 10mSec in 10 uSec steps.
sdfs3.pbp10/02/08 - PICBASIC PRO 2.50L test program to talk to FAT16 formatted MMC/SD cards with PIC18F4550. This is only a test program that is part of a larger project. The complete fileset with schematic, includes, and details can be found at download: http://melabs.com/resources/samples/pbp/sdfs3.zip
ser2mod.pbpPICBASIC PRO Code that demonstrates the use of modifiers with the Serin2 and Serout2 commands.
serin.pbpPICBASIC PRO Code that demonstrates the use of SERIN & SEROUT commands with UPPER CASE serial filter.
serqual.pbpPICBASIC PRO Code that demonstrates the use of SERIN Command with qualifiers for a 'Crude' serial filter for C Style Comments.
shift.pbpPICBASIC PRO Code to demonstrate the use of SHIFTIN / SHIFTOUT commands.
sleep.pbpPICBASIC PRO Code to demonstrate the SLEEP command. Slowly blinks an LED using low power mode delay.
sound.pbpPICBASIC PRO Code to demonstrate the SOUND command. Makes random computer-like noises. More refinement might make sound effects realistic enough to convince your boss youre working when youre really just playing Doom!!!
spimast.pbpPicBasic Pro program to read and write to SPI slave using the hardware synchronous serial port. Connect SDI(master) to SDO(slave), SDO(master) to SDI(slave), AND SCK(master) to SCK(slave). Common ground is required. Sends ascii '?' to request data, waits for a '!' to begin receiving data. Expects to find the ADC conversion value in the 6th position of the received string.
spislave.pbpPicBasic Pro program SPI slave program (see spimast.pbp for connections) Common ground is required.
usart.pbpPICBASIC PRO program to demonstrate reading & writing the hardware serial port without HSERIN/HSEROUT. Defaults to 2400 bps.