PicBasicPRO Examples
Dec 09, 2011 Software serial with interupts example. I have a project that requires the use of 3 uarts. The Pic I'm using is a 18f2321 running at 40Mhz. One of the uarts is using the hardware, and the other 2 will be implemented in software, all will run at 9600 bps. My problem is all of these ports can be hit with unsolicited data, so i need to figure out.
These examples are designed to demonstrate how to use aPIC16F877 and PicBasic PRO to communicate with our modules, most of these examples use the LCD03 display module to show theresults. All the modules which use the I2C bus have 1k8 pull-up resistorsto 5v. You only need one set of resistors for the whole I2C bus regardlessof however many I2C devices you have connected to it. You can findmore information about the I2C bus in our I2C tutorial.
Note - Pin 1 of the PIC16F877 is MCLR. When your programmer isnot connected to this pin, it should be pulled to +5v with a resistor. Any valuefrom 1k to 47k should be fine. You may need disconnect it when the programmer isconnected.
Index: | |
CMPS03 | Magnetic Compass |
SRF01 | Ultrasonic Ranger |
SRF02 | Ultrasonic Ranger |
SRF04 | Ultrasonic Ranger |
SRF05 | Ultrasonic Ranger |
SRF08 | Ultrasonic Ranger |
SRF10 | Ultrasonic Ranger |
SRF235 | Ultrasonic Ranger |
TPA81 | 8 Pixel Thermal Sensor |
SD20 | Servo Controller |
SD21 | Servo Controller |
MD03 | 24V 20A Motor Driver |
MD22 | Dual 24V 5A Motor Driver |
MD25 | RD02 Motor Driver |
RLY08 | Relay Module |
CMPS03 Magnetic Compass
This uses the I2C bus to connect the PIC16F877 to the CMPS03. It reads thebearing as a 16 bit integer and displays the bearing as a number0.0-359.9 on the LCD03.
Download the CMPS03PicBasic.PBP file |
SRF01 Ultrasonic Ranger
The SRF01 uses a single pin for both serial input and output. You can have up to16 SRF01's connected to a single pin. The Range is displayed on an LCD03 module.
PicStic 1-4 (2K Version) Using the Hardware Serial Port with PicBasic Pro. December 13, 2001 Introduction: This application note will illustrate how to utilize the hardware serial port available on the 2K versions of Micromints PicStic 1-4 line of microcontrollers. Background: The original versions of Micromints PicStic 1-4 controllers were only capable of serial communication through a. One feature that PicBasic offers with the serin command is the ability to use a qualifier. Using this technique, we can force our serial I/O-expander to wait for a specific qualifier before accepting other data from the serial-pin. This helps to ensure that our I/O-expander isn't false triggered by line noise, or other interference. Receiving data from the Serial Keypad controller. 2-9 Assembler coded Keypad decoder. Experimenting with Serial Eeproms. Giving the PIC a memory. 3-1 Microwire Interface principals. 3-3 SPI Interface principals. 3-4 12C Interface principals. 3-6 12C serial eeprom Interface principals. 3-8 Interfacing to the 24C32, 12C serial.
Download the SRF01PicBasic.PBP file |
SRF02, SRF08, SRF10,SRF235 Ultrasonic Rangers
The SRF02, SRF08, SRF10 and SRF235 all use the same I2C interface. Thebasic ranging commands are the same, so this example works for all theserangers.
Download the srf02PicBasic.PBP file |
SRF04 Ultrasonic Ranger
As the SRF04 and SRF05 use the same method of communicating this example is compatiblewith both the SRF04 and SRF05.
Download the SRF04PicBasic.PBP file |
SRF05 Ultrasonic Ranger
This example uses the SRF05 in one pin mode, where the Trigger and Echo signalsappear on the same pin. Note the SRF05's mode pin is connected to ground toplace it in one pin mode.
Download the SRF05PicBasic.PBP file |
SRF08 Ultrasonic Ranger
Although the SRF08 is compatible with the SRF02 example, this example uses the SRF08 to take range and lightreadings and displays them on the LCD03.
Download the SRF08PicBasic.PBP file |
TPA81 Thermal Sensor
The TPA81 connects to the PIC16F877 using the I2C bus. This example displays theambient temperature and 8 temperatures from thermal sensor, on an LCD03 moduleand drives a servo.
Download the TPA81PicBasic.PBP file |
SD20 Servo Controller
This example shows how to drive a servo by usingthe SD20 chip, you can control up to 20 servo's.
Download the SD20PicBasic.PBP file |
SD21 Servo Controller
The SD21 is a ready wired module which can save a lot of time compared to theSD20 above. This example moves all servos through their maximum range.
Download the SD21PicBasic.PBP file |
MD03 24V 20A Motor Driver
This example runs the motor forwards and backwards, displaying thetemperature and motor current on the LCD03. Xtl 2500 installation manual.
Download the CMPS03PicBasic.PBP file |
SRF01 Ultrasonic Ranger
The SRF01 uses a single pin for both serial input and output. You can have up to16 SRF01's connected to a single pin. The Range is displayed on an LCD03 module.
PicStic 1-4 (2K Version) Using the Hardware Serial Port with PicBasic Pro. December 13, 2001 Introduction: This application note will illustrate how to utilize the hardware serial port available on the 2K versions of Micromints PicStic 1-4 line of microcontrollers. Background: The original versions of Micromints PicStic 1-4 controllers were only capable of serial communication through a. One feature that PicBasic offers with the serin command is the ability to use a qualifier. Using this technique, we can force our serial I/O-expander to wait for a specific qualifier before accepting other data from the serial-pin. This helps to ensure that our I/O-expander isn't false triggered by line noise, or other interference. Receiving data from the Serial Keypad controller. 2-9 Assembler coded Keypad decoder. Experimenting with Serial Eeproms. Giving the PIC a memory. 3-1 Microwire Interface principals. 3-3 SPI Interface principals. 3-4 12C Interface principals. 3-6 12C serial eeprom Interface principals. 3-8 Interfacing to the 24C32, 12C serial.
Download the SRF01PicBasic.PBP file |
SRF02, SRF08, SRF10,SRF235 Ultrasonic Rangers
The SRF02, SRF08, SRF10 and SRF235 all use the same I2C interface. Thebasic ranging commands are the same, so this example works for all theserangers.
Download the srf02PicBasic.PBP file |
SRF04 Ultrasonic Ranger
As the SRF04 and SRF05 use the same method of communicating this example is compatiblewith both the SRF04 and SRF05.
Download the SRF04PicBasic.PBP file |
SRF05 Ultrasonic Ranger
This example uses the SRF05 in one pin mode, where the Trigger and Echo signalsappear on the same pin. Note the SRF05's mode pin is connected to ground toplace it in one pin mode.
Download the SRF05PicBasic.PBP file |
SRF08 Ultrasonic Ranger
Although the SRF08 is compatible with the SRF02 example, this example uses the SRF08 to take range and lightreadings and displays them on the LCD03.
Download the SRF08PicBasic.PBP file |
TPA81 Thermal Sensor
The TPA81 connects to the PIC16F877 using the I2C bus. This example displays theambient temperature and 8 temperatures from thermal sensor, on an LCD03 moduleand drives a servo.
Download the TPA81PicBasic.PBP file |
SD20 Servo Controller
This example shows how to drive a servo by usingthe SD20 chip, you can control up to 20 servo's.
Download the SD20PicBasic.PBP file |
SD21 Servo Controller
The SD21 is a ready wired module which can save a lot of time compared to theSD20 above. This example moves all servos through their maximum range.
Download the SD21PicBasic.PBP file |
MD03 24V 20A Motor Driver
This example runs the motor forwards and backwards, displaying thetemperature and motor current on the LCD03. Xtl 2500 installation manual.
Download the MD03PicBasic.PBP file |
MD22 24V 5A MotorDriver
This example runs the motors forwards and backwards.
Picbasic Serial Examples
Download the MD22PicBasic.PBP file |
MD25 RD02 MotorController
This example drives the RD02 motors and displays the encoder values on the LCD03in hex format, as well as the batteryvoltage. It runs the motors back and forth between 2 values output by theencoders.
Download the MD25PicBasic.PBP file |
RLY08 Relay Module
Example of switching all the relays on and then off, and then turning them onand off individually.
Picbasic Serial Example Online
Download the RLY08PicBasic.PBP file |