16F819 to 16F877

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

Reply to
indras
Loading thread data ...

Hi. You are at the wrong forum. This is electronics. Miguel

Reply to
Externet

"Externet" wrote in news:1103661008.928037.109260 @f14g2000cwb.googlegroups.com:

Give the guy a break...it's not like PIC's are made of chocolate!

Sorry I couldn't help ya Indra. I'd certainly review the Spec Pages on the

877 to see what the differences are. Also...keep an eye on the fact that you are using a different port on the 877 than you were on the 819. Check that the tris command is still legitimate and such.

swift

Reply to
PicMan

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.