MBP40

From Curuxa

MBP40

Main Board built on a perfboard using a Microchip PIC microcontroller. This is intended for applications where many data pins, a lot of memory or complex integrated peripherals (EEPROM, CCP, PWM, I2C, SPI, EUSART...) are required.

Features

  • Based on a PIC16F887
    • 40 pin
    • Power supply: 2.0 to 5.5V
    • Program memory: 14336 bytes (8192 instructions)
    • RAM: 368 bytes
    • EEPROM: 256 bytes
    • 31kHz-8MHz internal oscillator
    • Up to 20MHz external oscillator
    • Two 8-bit timers. One 16-bit timer
    • Two CPP/PWM modules
    • 10-bit, 14-channel Analog-to-Digital Converter
    • MSPP (SPI, master/slave I2C)
    • EUSART/SCI/RS-232
    • Dual Analog Comparator module
  • ICSP connector
  • Up to 35 data input/outputs
  • Three I2C connectors with pull-ups
  • Two decoupling capacitors
  • One independent power connector, with enough room for more

Electronic circuit

Schematic

Bill of materials:

  • Perforated board of at least 13x29 holes. Individual pads, not copper strips
  • 1x PIC16F887-I/P or PIC16F887-E/P (see datasheet)
  • 1x 40-pin PDIP socket
  • 2x 10k, 1/4W resistors
  • 6x Right-angle male headers (usually sold as 40-pin strips)
  • Around 122 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


Notes

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.

The three I2C connectors, R1 and R2 resistors can also be avoided when you are certain you won't be using I2C.

Ground and Vcc lines are redundant. That means current can take two different paths. You can re-route the circuit and avoid redundant lines, your board would be simpler, but the circuit electrical response will be a bit worse.

There is an independent power connector. You can avoid it because you will probably not use it, but you also have enough room for placing your own extra power connectors if you want.

There is some empty room at the corners so you can clamp your MBP40 somewhere.

Construction

MBP40 MBP40 MBP40 MBP40 MBP40 MBP40 MBP40 MBP40 MBP40

Test

The following code can be compiled using SDCC.

/*==================================================================
* Sample program for MBP40 with Curuxa libraries
*
* 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: RE3 (pin 1) is an input-only pin
*
* http://curuxa.org
*=================================================================*/
 
#include <MBP40.h>
 
ConfigBits1(_CP_OFF & _DEBUG_OFF & _FCMEN_OFF  & _IESO_OFF & _CPD_OFF & _LVP_OFF & _BOR_OFF & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _INTOSCIO);
 
void main() {
	//set all pins as digital, instead of analog inputs
	AdcDisable();
 
	//set all digital pins as outputs
	TRISA=AllDigitalOutputs;
	TRISB=AllDigitalOutputs;
	TRISC=AllDigitalOutputs;
	TRISD=AllDigitalOutputs;
	TRISE=AllDigitalOutputs;
 
	while(1) {
		//set all digital output pins at Vcc
		PORTA=0b11111111;
		PORTB=0b11111111;
		PORTC=0b11111111;
		PORTD=0b11111111;
		PORTE=0b11111111;
	}
}

Another very good example for blinking LEDs on all pins can be found as an LTIND-A example.

Retrieved from "http://curuxa.org/en/MBP40"