You will also need to set up the tris registers. This sets the direction of data on your I/O lines. Setting an individual TRIS bit to zero creates an output pin, a 1 would create an input pin. Other than that you are on the right track. --Lawrence Lile Project Solutions Engineering www.projsolco.com >From: "ecollins" >Reply-To: "Microcontroller discussion list - Public." >To: >Subject: [PIC] 12f508 help needed >Date: Tue, 22 Feb 2005 17:24:43 -0500 > >Help! I am trying to program a 12f508 using C2C+. I am not an expert but >not a beginner either. I have experience programming 16f84 as well as >16f72. I am used to writing to "porta" or "trisb" but the 12f508 >apparantly uses a register called "gpio" and "tris". I have read the data >sheet and I am still confused on how to control these ports. I do not know >assembly language. Here is my code snippet: > >unsigned char gpio@0x06 ; > >void main (void) >{ > gpio = 0xff ; >} > >this compiles successfully and assembles successfully. but when I load the >hex file into mplab and step through, the gpio register doesn't change. By >the way, I am using 12c508.inc which is selected as menu option in the C2C+ >program. Thanks for any help. >-ethan >-- >http://www.piclist.com PIC/SX FAQ & list archive >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist