pl help to translate asm to micro C

Status
Not open for further replies.

kulanga

New Member
hi

I have a problem about translation pic 18f452 cord form assembler to Micro C .if anyone knows a converter or pl help me to translate this code.

code in asm
ISR_HIGH
btfsc PIR1,TMR2IF ;Timer2 to PR2 match?
bra TIMER2_PR2_Match
btfsc PIR1,TMR1IF ;Timer1 overflow Interrupt?
bra TIMER1_OVERFLOW
btfsc INTCON,TMR0IF ;Timer0 overflow Interrupt?
bra TIMER0_OVERFLOW ;Yes
RETFIE FAST

;******************************************************************
TIMER2_PR2_Match
bcf PIR1,TMR2IF ;
tstfsz PWM3_DUTYCYCLE ;If Software PWM duty cycle=0, then
bra PWM3_NOT_0 ;no need to set the PWM3 port pin
RETFIE FAST
PWM3_NOT_0
movlw 0xFF ;Higher byte of Timer1 loaded with FFh
movwf TMR1H
movff PWM3_DUTYCYCLE,TMR1L ;Lower byte of Timer1 loaded with Duty cycle
bsf PWM3_PORT,PWM3_PORT_PIN ;PWM3 pin set high
RETFIE FAST
;******************************************************************
TIMER1_OVERFLOW
bcf PWM3_PORT,PWM3_PORT_PIN ;PWM3 pin cleared after the duty cycle time expires
bcf PIR1,TMR1IF
RETFIE FAST

;******************************************************************
TIMER0_OVERFLOW ;TMR0 overflow ISR
movff FREQ_REF_H,TMR0H ;Load the Higher byte of SpeedCommand to TMR0H
movff FREQ_REF_L,TMR0L ;Load the Lower byte of SpeedCommand to TMR0L

bsf FLAGS,TIMER0_OV_FLAG
bcf INTCON,TMR0IF ;Clear TMR0IF

RETFIE FAST
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…