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.
Bill of materials:
Printable version: Single, Double
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 I2C connector, R1 and R2 resistors can also be avoided when you are certain you won't be using I2C.
The following code can be compiled using SDCC.
/*================================================================== * Sample program for MBP18 using a PIC16F88 * * 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: RA5 is an input-only pin * * http://curuxa.org *=================================================================*/ #include <pic16f88.h> typedef unsigned int config; config at _CONFIG1 __CONFIG = _CP_OFF & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO; void main(){ //set all pins as digital, instead of analog inputs ANSEL=0; //set all digital pins as outputs TRISA=0; TRISB=0; while(1){ PORTA=0b11111111; PORTB=0b11111111; } }
/*================================================================== * Sample program for MBP18 using a PIC16F88, 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: RA5 (pin 4) is an input-only pin * * http://curuxa.org *=================================================================*/ #include <MBP18.h> ConfigBits1(_CP_OFF & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO); void main() { //set all pins as digital, instead of analog inputs AdcDisable(); //set all digital pins as outputs TRISA=AllDigitalOutputs; TRISB=AllDigitalOutputs; while(1) { //set all digital output pins at Vcc PORTA=0b11111111; PORTB=0b11111111; } }