Physical Computing

A blog about Physical Computing

Wednesday, December 29, 2004

Useful Tips #1
By default the PIC 16F628 Port A pins are set as comparators, which means that by default you can not use the Port A pins for digital input.

In order to set the Port A pins to be used as digital inputs you need to disable the analog functions. For the 16F628 in JAL you would write



var volatile byte CMCON at 0x1F
CMCON = 7 -- set portA to normal digital IO



Port A.4 is an open collector pin which means you can't use it as an input without a pull-up resistor.

via Potemkin.org

0 Comments:

Post a Comment

<< Home