Microchip PIC based gate controller