Monday, 27 February 2012

Run the programming of PIC

Week 5

Title of the project:  Run the programming of PIC
Objective: Record function of circuit
Content/Procedure:
-Check the connection of component
-Burn the program into PIC

Start run program

Setting the voltage reference and LM35

Check push button (increase and decrease)

SP=Set point

Time setting

Circuit Motor

Heater (Led show output to heater circuit)

Analysis:
In proteus, after construct the circuit, program writing will be burn into PIC. Before that, program should be compiling to make sure have no error, if still have an error; program cannot be burn and need some modification. In this case, software will show at which line has a problem, so it make easy to do some correction. If program already complete, circuit can be operate based on the step planning in program such as display name, rotation motor, time setting and input at the sensor(LM53).  


Conclusion:
Based on this work, assemble language play as important part to make the PIC function. Instruction giving refers step planning of circuit operation. It must be related for each circuit because when PIC start operates, each circuit will do their own operation. 

Tuesday, 14 February 2012

Study programming of PIC

Week 4

Title of the project: Study programming of PIC 
Objective: Make the PIC operate
Content/Procedure:

Study pin i/p and o/p

Define port:    A (sensor/heater)
                        B (LCD display)
                        C (Switch)
                        D (DC motor)

Program language:
;===============================================================
;PROJECT TITLE  : WASTE TO FERTILIZER CONVERTER
;===============================================================
                                                LIST P=16F877a
                                                ERRORLEVEL       -302
                                                ERRORLEVEL       -305
                                                #INCLUDE <P16F877a.INC>
                                                __CONFIG          0X3F32

;========================MACRO ==================================
BANK0                  MACRO                                ;CHANGE TO BANK 0
                                BCF                        STATUS,RP0                                                                      
                                BCF                        STATUS,RP1
                                ENDM                                  
BANK1                  MACRO                                ;CHANGE TO BANK 1
                                BSF                         STATUS,RP0
                                BCF                        STATUS,RP1
                                ENDM                  
BANK2                  MACRO                                ;CHANGE TO BANK 2
                                BCF                        STATUS,RP0
                                BSF                         STATUS,RP1
                                ENDM

                               
BANK3                  MACRO                                ;CHANGE TO BANK 3
                                BSF                         STATUS,RP0                                                                                                                                                                                                                                                                      
                                BSF                         STATUS,RP1
                                ENDM
CLOCK_E              MACRO                                                                                ;'E' RISE UP N FALL DOWN
                                BSF                         PORTD,07
                                CALL      t1m
                                BCF                        PORTD,07
                                CALL      t1m
                                ENDM
;===============================================================
;========== VARIABLE ===========================================
;DATA MEMORY ADDRESS =        20h - 7Fh (BANK0)
;                                                         A0h - EFh (BANK1)
;                                                               110h - 16Fh (BANK2)
;                                                               190h - 1EFh         (BANK3)
;===============================================================
;===============================================================
;========== RESET VECTOR =======================================
;===============================================================
ORG                       00
RESET                    GOTO    INIT
;===============================================================
;========== INTERRUPT VECTOR ===================================
;===============================================================      
ORG                       04          
INT                         GOTO    INIT
;===============================================================
;========== INITIALIAZATION ====================================
;===============================================================
ORG                       05
INIT                       
BANK0                               CLRF         PORTA
                                                CLRF      PORTB
                                                CLRF      PORTC
                                                CLRF      PORTD
                                                CLRF      PORTE  


BANK1                               movlw     b'00000101'                         ;PORTA analog input;right justifide;RA3 Vref
                                                movwf  ADCON1
                                                movlw  b'00011111'
                                                movwf  TRISA                                    ;PORTA AS INPUT/OUTPUT
                                                clrf          TRISB                                     ;PORTB AS OUTPUT
                                                movlw  b'10111111'
                                                movwf  TRISC                                     ;PORTC AS INPUT
                                                movlw  b'00000000'
                                                movwf  TRISD                                    ;PORTD AS INPUT/OUTPUT
                                                movlw  b'00000000'
                                                movwf  TRISE                                     ;PORTE AS OUTPUT
                                                               
BANK0
Mulain                               CLRF         PORTB
                                                clrf          PORTD


;=============== MAIN PROGRAM START HERE========================

Analysis:
To write a program, student should know the language of the software used and the expectation of circuit operation. In this work, before writing a program it should be define the step operation at input and output PIC. By referring data sheet PIC16F877A and ASM software, student can plan what are step need such as time setting, input sensor, push button and LCD display. It must be properly step setting because PIC cannot read if the wrong instruction given also the operation may be interrupt. In this case, student already done some adjusted of the program because PIC cannot run as expected. So, the program should be modified until it can run as step planning. After complete writing program, it should be compile to check where the wrong of language and if have no problem, it show the program successfully build.

Conclusion:
Writing the programming is the important part in PIC because it functions as heart to giving instruction of circuit operation. So, all the instruction must be properly write depend on step and transmit at pins which make it operate. 

Wednesday, 8 February 2012

Construct the circuit using proteus

Week 3
Title of the project:  Construct the circuit using proteus
Objective:  To make circuit operation
Content/Procedure:

PIC circuit
DC motor

Analysis:
Basically, using proteus software will make easy to design the actual circuit. The component used already install in software, so student should build all connection at the input and output pin at PIC. Circuit will design based on the block diagram refer step function. For the example at PIC 16F877A, it have Port A,B,C and D where each port have their own operation function. Student must define each port to make their operation based on the block diagram or planning.


Conclusion:
Using proteus software will help student understand to connect the circuit based on PIC performance.  In this work, connection between components is important to make circuit will operation smoothly when applying the program (ASM). If the connection have a problem, this software will show where the connection wrong.

Wednesday, 1 February 2012

Research component

Week 2
Title of the project:  Research component
Objective: To know the main component and connection of the circuit
Content/Procedure: Analyze the suitable component use in the circuit
Analysis:
List of the component:
PIC
Heater
Diode
MPX-X2
Led
MOC 3041/932Q
Push button
BT 137/PJA 0804
TIP 122,CC1EQ,C2878

PIC16F877A

Buzzer

LCD screen


Conclusion:
Component use is the important thing to make circuit operate. There are the combination between PIC, motor and heater circuit. Selection of main component should have in a market because some component needs to order from other company. So, by listing all components used will make easy to design the circuit.

Activity