Guest
I would like to convert the following codes, so it works on 16F877.
Before converted:
'Set up the IR HPWM modulation frequency
Device = 16F819
XTAL = 4
Symbol SER_DATA = PORTB.1
Symbol MODULATE = PORTB.2
DelayMS 500 'Wait for the PICmicro to stabilise
ALL_DIGITAL = True 'Enable PORTA as all digital
TRISB.2 = 0 'CCP1 (PortB.2 = Output)
PR2 = 25 'Set PWM Period for approximately 38KHz
CCPR1L = 13 'Set PWM Duty-Cycle to 50%
CCP1CON = %00001100 'Mode select = PWM
T2CON = %00000100 'Timer2 ON + 1:1 prescale
After converted:
Device = 16F877
XTAL = 4
Symbol SER_DATA = PORTC.4
Symbol MODULATE = PORTC.2
DelayMS 500
ALL_DIGITAL = True
TRISC.2 = 0
PR2 = 25
CCPR1L = 13
CCP1CON = %00001100
T2CON = %00000100
The converted one that I did does not work.
Could you help me make it work?
Thank you.
Indra
Before converted:
'Set up the IR HPWM modulation frequency
Device = 16F819
XTAL = 4
Symbol SER_DATA = PORTB.1
Symbol MODULATE = PORTB.2
DelayMS 500 'Wait for the PICmicro to stabilise
ALL_DIGITAL = True 'Enable PORTA as all digital
TRISB.2 = 0 'CCP1 (PortB.2 = Output)
PR2 = 25 'Set PWM Period for approximately 38KHz
CCPR1L = 13 'Set PWM Duty-Cycle to 50%
CCP1CON = %00001100 'Mode select = PWM
T2CON = %00000100 'Timer2 ON + 1:1 prescale
After converted:
Device = 16F877
XTAL = 4
Symbol SER_DATA = PORTC.4
Symbol MODULATE = PORTC.2
DelayMS 500
ALL_DIGITAL = True
TRISC.2 = 0
PR2 = 25
CCPR1L = 13
CCP1CON = %00001100
T2CON = %00000100
The converted one that I did does not work.
Could you help me make it work?
Thank you.
Indra