
_main:

;MyProject.c,1 :: 		void main()
;MyProject.c,3 :: 		short duty1 = 16; //initial value for duty
	MOVLW      16
	MOVWF      main_duty1_L0+0
;MyProject.c,4 :: 		TRISD = 0xFF; //PORTD as input
	MOVLW      255
	MOVWF      TRISD+0
;MyProject.c,5 :: 		TRISC = 0x00; //PORTC as output
	CLRF       TRISC+0
;MyProject.c,6 :: 		TRISB = 0x00; //PORTB as output
	CLRF       TRISB+0
;MyProject.c,7 :: 		PORTB = 0x02; //Run motor in anticlock wise
	MOVLW      2
	MOVWF      PORTB+0
;MyProject.c,8 :: 		PWM1_Init(1000); //Initialize PWM1
	BSF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      249
	MOVWF      PR2+0
	CALL       _PWM1_Init+0
;MyProject.c,9 :: 		PWM1_Start(); //start PWM1
	CALL       _PWM1_Start+0
;MyProject.c,10 :: 		PWM1_Set_Duty(duty1); //Set current duty for PWM1
	MOVF       main_duty1_L0+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,12 :: 		while (1) // endless loop
L_main0:
;MyProject.c,15 :: 		if (PORTD.F0==0) //Checking the button pressed or not
	BTFSC      PORTD+0, 0
	GOTO       L_main2
;MyProject.c,17 :: 		Delay_ms(1);
	MOVLW      2
	MOVWF      R12+0
	MOVLW      75
	MOVWF      R13+0
L_main3:
	DECFSZ     R13+0, 1
	GOTO       L_main3
	DECFSZ     R12+0, 1
	GOTO       L_main3
;MyProject.c,18 :: 		duty1++; // increment duty cycle
	INCF       main_duty1_L0+0, 1
;MyProject.c,19 :: 		PWM1_Set_Duty(duty1); //Change the duty cycle
	MOVF       main_duty1_L0+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,20 :: 		}
L_main2:
;MyProject.c,22 :: 		if (PORTD.F1==0) // Checking the button pressed or not
	BTFSC      PORTD+0, 1
	GOTO       L_main4
;MyProject.c,24 :: 		Delay_ms(1);
	MOVLW      2
	MOVWF      R12+0
	MOVLW      75
	MOVWF      R13+0
L_main5:
	DECFSZ     R13+0, 1
	GOTO       L_main5
	DECFSZ     R12+0, 1
	GOTO       L_main5
;MyProject.c,25 :: 		duty1--; // decrement duty cycle
	DECF       main_duty1_L0+0, 1
;MyProject.c,26 :: 		PWM1_Set_Duty(duty1);
	MOVF       main_duty1_L0+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;MyProject.c,27 :: 		}
L_main4:
;MyProject.c,28 :: 		Delay_ms(10);
	MOVLW      13
	MOVWF      R12+0
	MOVLW      251
	MOVWF      R13+0
L_main6:
	DECFSZ     R13+0, 1
	GOTO       L_main6
	DECFSZ     R12+0, 1
	GOTO       L_main6
	NOP
	NOP
;MyProject.c,29 :: 		} }
	GOTO       L_main0
L_end_main:
	GOTO       $+0
; end of _main
