Maker Pro
Maker Pro

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
 
E

Externet

Jan 1, 1970
0
Hi.
You are at the wrong forum. This is electronics.
Miguel
 
P

PicMan

Jan 1, 1970
0
Hi.
You are at the wrong forum. This is electronics.
Miguel

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
 

Similar threads

B
Replies
16
Views
2K
BrunoG
B
N
Replies
9
Views
3K
Johan
J
R
Replies
5
Views
2K
Michel Catudal
M
R
Replies
1
Views
2K
Howard Henry Schlunder
H
Top