english français deutsch
italiano portugese español

PicBasic Pro Code Samples for the LAB-X1 Experimenter Board (PIC16F887)

PicBasic Pro code samples for use with the LAB-X1 Experimenter Board from MicroEngineering Labs. These code samples have been written specifically for the PIC16F887 microcontroller. The PIC16F887 replaced the older PIC16F877A. The 887 is less expensive and has an internal oscillator.

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - adcin10x.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to display result of 10-bit A/D conversion on LCD. Connect analogue input to channel-0 (RA0).

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - adcin3x.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to display result of 8-bit A/D conversion on LCD. Connect analogue inputs to channels 0, 1, 3 (RA0, 1, 3).

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - adcin8x.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to display result of 8-bit A/D conversion on LCD. Connect analogue input to channel-0 (RA0).

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - adcx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read potentiometers on 16F887 ADC.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - blink8x.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to blink all the LEDs connected to PORTD.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - blinkx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to blink an LED connected to PORTD.0 about once a second.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - bpx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to simulate an LCD Serial Backpack. Serial data received is displayed on the LCD.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - butx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to show button presses on 4 LEDs.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - clockx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program for an LCD clock using ON INTERRUPT. Uses TMR0 and prescaler. Watchdog Timer should be set to off at program time and NAP or SLEEP should not be used. Buttons may be used to set hours and minutes.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - eepagex.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to demonstrate the page-write capability of the 24LC256 serial memory. This program will transfer 64 bytes of data to the memory before a pause is needed to complete the write.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - hserx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to send and receive from the hardware serial port.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - i2cwordx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read and write to I2C SEEPROMs that require a word-sized address. Writes to the first 16 locations of an external serial EEPROM. Reads first 16 locations back and sends to LCD repeatedly.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - i2cwx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read and write to I2C SEEPROMs that require a word-sized address. Writes to the first 16 locations of an external serial EEPROM. Reads first 16 locations back and sends to LCD repeatedly.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - i2cx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read and write to I2C SEEPROMs that require a byte-sized address. Writes to the first 16 locations of an external serial EEPROM. Reads first 16 locations back and sends to LCD repeatedly.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - jrcx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program for an LCD clock using the JRC6355 RTC.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - keyx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to display key numbers on LCD.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - lcd_bit_bang.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to manually operate (without LCDOUT) an LCD in 4-bit mode.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - lcdinx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to display 'hello world' on LCD, then use LCDIN to read the first letter of each line and change it to upper case.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - lcdx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to display 'Hello World' on LCD.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - ltcx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read LTC1298 ADC.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - mwx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read and write to Microwire SEEPROM 93LC56A. Writes to the first 16 locations of an external serial EEPROM. Reads first 16 locations back and sends to LCD repeatedly. Note: For SEEPROMs with byte-sized address.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - progee8x.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to receive a HEX file from PC and write data to I2C memory. Writes data in page mode, 8 bytes at a time. Memory device must be addressed with 8 bits and capable of receiving 8 bytes at once.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - progeex.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to receive a HEX file from PC and write data to I2C memory. Writes data in page mode, 16 bytes at a time. Memory device must be addressed with 8 bits and capable of receiving 16 bytes at once.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - rtcx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program for LCD clock using the Dallas 1202/1302 RTC.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - rwcodex.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read and write to code space. Flash Program Write must be enabled on your programmer. Writes to 8 locations of code space beginning at $1800. Reads 8 locations back and sends to LCD repeatedly.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - serbufax.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to demonstrate an interrupt-driven input buffer for hardware USART receive using assembly language interrupt.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - serbufx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to demonstrate an interrupt-driven input buffer for HSERIN using ON INTERRUPT.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - servosx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program for servo control using ON INTERRUPT. Uses TMR0 and prescaler. Watchdog Timer should be set to off at program time and NAP or SLEEP should not be used. Buttons on keypad are used to move servos.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - servox.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to move RC servo 1 using keypad buttons. Button 1 moves servo left, 2 centres servo, 3 moves servo right.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - spix.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read and write to SPI SEEPROMs. Writes to the first 16 locations of an external serial EEPROM. Then reads first 16 locations back and sends to LCD repeatedly. Note: For SEEPROMs with word-sized address.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - strtblx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to demonstrate a method of storing text strings in a table. The strings can be called by storing the location of the first character in a variable and calling the strout subroutine. The string will be sent to both LCD and Serial pin and the main program will resume when the null terminating character is encountered in the table.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - temp3x.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read the DS1620 3-wire temperature sensor and display temperature on LCD.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - temp_ds1822.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read DS1822 or DS18B20 1-wire temperature sensor using OWIN and OWOUT commands and display temperature on LCD.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - tempx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to read DS1820 1-wire temperature sensor and display temperature on LCD.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - tmr1clkx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to demonstrate the use of Timer1 interrupt for a real-time clock.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - tonex.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to create telephone pad tone. Note: LAB-X1 Oscillator must be set to 20MHz.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - vbarx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to measure voltage (0-5VDC) and display on LCD with 2 decimal places. A 60 segment bargraph is also displayed using custom LCD characters. This program uses the */ operator to scale the ADC result from 0-1023 to 0-500. The */ performs a divide by 256 automatically, allowing maths which would normally exceed the limit of a word variable.

source code

LAB-X1 PicBasic Pro Code Sample (PIC16F887) - vmeterx.pbp

Picbasic Pro Compiler Product Thumb

PicBasic Pro program to measure voltage (0-5VDC) and display on LCD with 2 decimal places. This program uses the */ operator to scale the ADC result from 0-1023 to 0-500. The */ performs a divide by 256 automatically, allowing maths which would normally exceed the limit of a word variable.

source code

Page Updated:
20/12/11

Visa Credit
Mastercard
Visa Debit
Maestro
Visa Electron
Paypal

Tel: +44 7814 044 754 - Fax: +44 8715 283 948 - Skype: warburtech.co.uk

Warburton Technology, 33 Selkirk Close, Wimborne, Dorset, BH21 1TN, United Kingdom

VAT Number: GB 846 917 877