Thursday 28 February 2013

Week 6

When i am succeed do in the basic program, i move on the second step that's i tried to program the motor like i do in the previous week. i try n try.. but i failed.. i'm so disappointed. :'(

Sunday 17 February 2013

Week 5

In this week, i still try my best in programming. i do from the basic and got it!


Tuesday 5 February 2013

Week 4

On this week, i can't start continue my work on doing a programming for my final year project because i got a problem with my MPLAB software.. :'( so, i try to find another software that have same function with MPLAB and it's PICBASIC PRO compiler.. i got this idea to use it from the book that i brought from MPH MidValley about "Running small motors with Pic Microcontrollers".. i download it from the pbp3.com/downloadtrial/ .. even it's trial version only available on 30 days, i still want to try and i hope there is no problem in using it because before this i never learn about it..

Friday 1 February 2013

Design Simulation Circuit in Proteus


Stage 1: 

In the first step, I need to design the schematic of the circuit like in the figure. I’m using the Proteus software to design this schematic. Before start my project, I need to define what is type of pic? How many button that needed in my project? And what is an output that I want to show? So, an all of this thing is show like in combination of this schematic.

The simulation circuit consists a PIC16F877A microcontroller's chip, four push button, four resistor, 3 motor and two motor driver. The circuit supplied with 5V and grounded. The PIC16F877A is setting up the clock frequency of 20MHz.

The prototype board has two momentary push-button that may be used as the input of the program. The input pin is connected to 1.5K ohm pull-up resistor to +5V and the button, when pressed, will connected to the ground.The switches are connected as Active Low.

 I've selected the Motor Driver pinouts as following:

#define LEFT_CONTROL_1A        RC1//1A
#define LEFT_CONTROL_2A        RC2//2A
#define LEFT_CONTROL2_1A      RC3//1A
#define LEFT_CONTROL2_2A      RC4//2A
#define LEFT_MOTOR                   RD1//1,2EN
#define RIGHT_MOTOR                RD2//3,4EN
#define LEFT_MOTOR2                 RD3//1,2EN
#define RIGHT_CONTROL_3A    RD4//3A
#define RIGHT_CONTROL_4A    RD5//4A


Schematic 1
Schematic 2



Program of Microcontroller (2)

In this project, I uses PIC16f877A microcontroller. It has 40 pins consists of 5 ports which are Port A, Port B, Port C, Port D and Port E. I only use Port A, Port B and Port C. Port B as the input while Port A and Port C as the output for motor and LED. The chip has two pairs of power pins (VDD__5 V nominal and Vss _ 0 V), and either pair can be used.

PIC16F877A

Program of Microcontroller

Before setting up the program, I needed the three main softwares to be used for programming the microcontroller. The softwares used are MPLAB IDE v8.85 (download from microchip website), Proteus 7 Professional and PICkit 2 v2.61.

MPLAB IDE v8.85 – used for writing or creating the program. In this software, I used Hi-Tech compiler.

Proteus 7 Professional (ISIS) – used for designing the schematic diagram and simulate the circuit based on the program created. ISIS is the schematic capture and interactive simulation software used to create the circuit drawing and to test the circuit prior to building the real hardware.

PICkit 2 v2 – Import the hex file from the program created and transfer it to the microcontroller. So this software enables the microcontroller write the program with connecting of the USB interface.
The PICkit™ 2 Microcontroller Programmer Kit contains the following items:
1. The PICkit™ 2 Microcontroller Programmer
2. USB cable