16F819 to 16F877

Dec 21, 2004 2 Replies

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


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

"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

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required