PDA

View Full Version : 12c508 Gpio



oki_one
- 26th August 2003, 08:20
Hi,
I like to use 12C508 and assign GPIO 0-2 pins input GPIO 3-5 output. What's PBP code for this operation.

I Know i use 16F84 TRISA or TRISB but I don't know GPIO?
Please help.

Oki

Melanie
- 26th August 2003, 08:51
The baby PIC's use TRISIO in place of TRISA, TRISB etc... (it is in the PBP manual section 2.5.1 PICmicro MCU Specific Issues).

By the way, check the PIC's Datasheet too... you'll discover you can't have GPIO.3 as Output... it's an input ONLY pin.

So, setting GPIO 0, 1 and 2 as OUTPUT and 3,4 and 5 as INPUT (which is the other way around to your request) you execute...

TRISIO=%111000

Melanie