PDA

View Full Version : Help starting a 876A



Naslund
- 20th March 2005, 01:27
Hi.

I’m 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

Melanie
- 20th March 2005, 09:25
Go look at COMPARATORS in the Datasheet (for example look at figure 12-1 to select bits 2-0 of the CMCON Register). Turn them OFF first setting those pins DIGITAL mode.

The go look at ADC's in your Datasheet (for example the Table associated with bits 3-0 of register ADCON1 as shown in 11-2). Set those to DIGITAL mode too.

Then go TRISx your Ports.

It is IMPORTANT that everyone READs THE DATASHEET of their chosen PIC to understand it's internal archetecture before blindly going and attempting to program it. Chances are, that with the more complicated PICs, it just isn't going to work until you understand and turn OFF all the things that might be standing in your way.