MBP14

From Curuxa

MBP14

Very simple Main Board built on a perfboard using a Microchip PIC microcontroller. This is intended for learning the basics of electronics and/or being used on simple applications where only a few data pins are required.

Contents

Features

  • Based on a PIC16F688
    • 14 pin
    • Power supply: 2.0 to 5.5V
    • Program memory: 7168 bytes (4096 instructions)
    • RAM: 256 bytes
    • EEPROM: 256 bytes
    • 32kHz-8MHz internal oscillator
    • Up to 20MHz external oscillator
    • One 8-bit timer. One 16-bit timer
    • 10-bit, 8-channel Analog-to-Digital Converter
    • EUSART
    • Dual Analog Comparator module
  • ICSP connector
  • Up to 12 data input/outputs
  • Two decoupling capacitors

Electronic circuit

Schematic

Bill of materials:

  • Perforated board of at least 11x11 holes. Individual pads, not copper strips
  • 1x PIC16F688-I/P or PIC16F688-E/P (see datasheet)
  • 1x 14-pin PDIP socket
  • 6x Right-angle male headers (usually sold as 40-pin strips)
  • 36x Straight male headers (usually sold as 40-pin strips) (you can also buy double-row strips)
  • 1x 100uF electrolytic capacitor
  • 1x 100nF ceramic capacitor
  • Some thin wire


Layout: top view
Layout: bottom view

Printable version: Single, Double

Optional parts

Both decoupling capacitors can usually be left out of the board, but it's not recommended. They stabilize the voltage from the power supply and filter small voltage peaks/drops. Capacitive or inductive loads such as motors require decoupling capacitors.

Construction

MBP14 MBP14 MBP14 MBP14 MBP14 MBP14 MBP14 MBP14

Test

The following code can be compiled using SDCC.

Without Curuxa libraries

/*==================================================================
* Sample program for MBP14 using a PIC16F688
*
* This program configures all available pins as digital outputs.
* You can check that all digital pins are set at the same voltage as
* the power source using a voltmeter or Module LTIND-A (the LED
* should light up)
* Note: RA3 (pin 4) is an input-only pin
*
* http://curuxa.org
*=================================================================*/
 
#include <pic16f688.h>
 
typedef unsigned int config;
config at 0x2007 __CONFIG = _CPD_OFF & _CP_OFF & _BOD_OFF  & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _INTOSCIO;
 
void main(){
        //set all pins as digital, instead of analog inputs
        ANSEL=0;
 
        //set all digital pins as outputs
        TRISA=0;
        TRISC=0;
 
        while(1){
                PORTA=0b11111111;
                PORTC=0b11111111;
        }
}

With Curuxa libraries

/*==================================================================
* Sample program for MBP14 using a PIC16F688
*
* This program configures all available pins as digital outputs.
* You can check that all digital pins are set at the same voltage as
* the power source using a voltmeter or Module LTIND-A (the LED
* should light up)
* Note: RA3 (pin 4) is an input-only pin
*
* http://curuxa.org
*=================================================================*/
 
#include <MBP14.h>
 
ConfigBits( _CPD_OFF & _CP_OFF & _BOD_OFF  & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _INTOSCIO);
 
void main(){
        AdcDisable();
 
        //set all digital pins as outputs
        TRISA=AllDigitalOutputs;
        TRISC=AllDigitalOutputs;
 
        while(1){
                PORTA=0b11111111;
                PORTC=0b11111111;
	}
}
Retrieved from "http://curuxa.org/en/MBP14"