MBP8

From Curuxa

MBP8

Extremmely 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 very simple applications where only a very few data pins are required.

Contents

Features

  • Based on a PIC12F683
    • 8 pin
    • Power supply: 2.0 to 5.5V
    • Program memory: 3584 bytes (2048 instructions)
    • RAM: 128 bytes
    • EEPROM: 256 bytes
    • 31kHz-8MHz internal oscillator
    • Up to 20MHz external oscillator
    • Two 8-bit timers. One 16-bit timer
    • 10-bit, 4-channel Analog-to-Digital Converter
    • CCP/PWM
    • Analog Comparator module
  • ICSP connector
  • Up to 6 data input/outputs
  • One decoupling capacitor

Electronic circuit

Schematic

Bill of materials:

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


Layout: top view
Layout: bottom view

Printable version: Single, Double

Optional parts

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

Construction

MBP8 MBP8 MBP8 MBP8 MBP8 MBP8 MBP8 MBP8

Test

The following code can be compiled using SDCC.

Without Curuxa libraries

/*==================================================================
* Sample program for MBP8 using a PIC12F683
*
* 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: GP3 (pin 4) is an input-only pin
*
* http://curuxa.org
*=================================================================*/
 
#include <pic12f683.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
        TRISIO=0;
 
        while(1){
                GPIO=0b11111111;
	}
}

With Curuxa libraries

/*==================================================================
* Sample program for MBP8 using a PIC12F683
*
* 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: GP3 (pin 4) is an input-only pin
*
* http://curuxa.org
*=================================================================*/
 
#include <MBP8.h>
 
ConfigBits(_CPD_OFF & _CP_OFF & _BOD_OFF  & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _INTOSCIO);
 
void main() {
        AdcDisable();
 
        //set all digital pins as outputs
        TRISIO=AllDigitalOutputs;
 
        while(1) {
                GPIO=0b11111111;
	}
}
Retrieved from "http://curuxa.org/en/MBP8"