PDA

View Full Version : Help with an 16f876a



gusanoloco
- 20th March 2004, 01:47
Hi to all,
i was working on a program and i had it running ok on an 16f628 but i need a
little more output pins and have migrated to an 16f876a and from now i cant
do work anything
i have tried this code with anything connected to pic (well, there is a
cristal, condensers, reset resistor an a led on portc2)

DEFINE OSC 4
trisc.2=0
ProgramStart:
high portc.2
pause 10000
low portc.2
GOTO ProgramStart

and this don't work
what i'm doing wrong?

Cheers Juanjo

NavMicroSystems
- 20th March 2004, 21:58
Assuming you are using a 4 MHz crystal:

Have you set "XT OSC" when programming the device?

if so

Do the capacitor values match your crystal?

One of the most common problems is: the oscillator does not start.

rgds

gusanoloco
- 21st March 2004, 20:52
Hello again, problems are solved, some changes on define sentences and everything is up again

Anyway thanks for the attention

Regards.

Naslund
- 19th March 2005, 02:48
Hi.

I’m also trying to go from a 628 to an 876A.

Could someone give me an example of working pbp2 code that makes
PortA.0-3 output
PortB.1-5 output
PortC.0-3 input
PortC.4-7 output
All digital.

I’m trying to set the TRISX but it won’t work.
Is it some DEFINE that has to be set?
I liked the simple 628….

Regards
David

I’m using
Pbp 2.42
PM assembler 4.04

4Lewis
- 12th April 2006, 22:58
Hello:

I am having similar problems, what did you change in the code to make it work?

''
Hello again, problems are solved, some changes on define sentences and everything is up again

Anyway thanks for the attention

Regards.''