'Setting Port_D on PIC16C662'
I'm trying to use Port_D on a PIC16C662 as an input register to receive
switch pulses but I'm having difficulty sending tris commands to Port_D to
set it as inputs.
This is the first time I've used the 662 and I'd like a little advice on
this particular aspect.
Thanks, James Evans
James Evans wrote:
> I'm trying to use Port_D on a PIC16C662 as an input register to
> receive switch pulses but I'm having difficulty sending tris commands
> to Port_D to set it as inputs.
Doesn't it default to inputs?
This appears to be the (only) gotcha to the bizarre "don't use TRIS"
campaign by MicroChip. IIRC, TRIS doesn't work on port D - you have to
set up the TRIS *register* the hard way (using register "banking").
Viewed from another perspective, if you want to manipulate TRIS as
part of normal program operation, you do so for ports A, B, and C.
Ports D & E are intended as "set and forget" as far as TRIS goes; that's
the design philosophy.
More... (looser matching)
- Last day of these posts
- In 2000
, 2001 only
- New search...