Hi All, Let's clear this up. The PCM is the CCS compiler. In the header files You can take care of the port direction setup. Your code must contain in the header files something like that: #device PIC16C715 #use delay(clock=4000000) #nolist /////////////////////////////// I/O definitions for INPUT() and OUTPUT_xxx() #define PIN_A0 40 #define PIN_A1 41 #define PIN_A2 42 #define PIN_A3 43 #define PIN_A4 44 #use fixed_io(A_OUTPUTS=PIN_A2,PIN_A3) #byte port_A=5 If you want to make absolutely sure just change the code the way when the compiler will use the TRIS register. It will look like that: #device PIC16C715 #use delay(clock=4000000) #nolist /////////////////////////////// I/O definitions for INPUT() and OUTPUT_xxx() #define PIN_A0 40 #define PIN_A1 41 #define PIN_A2 42 #define PIN_A3 43 #define PIN_A4 44 #use standard_io(A) #byte port_A=5 Also make sure in the code You define a following one: setup_port_a(NO_ANALOGS); Have a nice weekend to everybody, and good luck Peter -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Martin Green Sent: Friday, August 21, 1998 2:07 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re[2]: Newbie Question Matt, David and Joshua. There is *nothing* in the header that defines the port direction to allow using them as outputs. Since all ports start up as inputs, writing values to them will have no effect. The #include statement only defines *where* the ports are, not how they are set up. I don't know the variety of C that David is using, but look for a function with "tris" somewhere in the name, since this is the instruction used on the 12bit PIC's to set the I/O characteristics of a port. Alternately, if your flavour of C allows #ASM statements, set the port up directly with PIC assembler. CIAO - Martin. P.S. - the #use pragma in the header *should* correctly set up the timer. ______________________________ Reply Separator _________________________________ ---------------------- Information from the mail header ----------------------- Sender: pic microcontroller discussion list Poster: Matt Bonner Organization: Sunada Technology Corp. Subject: Re: Newbie Question ---------------------------------------------------------------------------- --- David VanHorn wrote: > > I don't do C, but shouldn't you have some sort of chip setup code that > defines those pins as outputs, and maybe sets up a timer or something?? > > The frequency of the crystal also enters into it, else how to know when N > seconds have passed? All the chip knows is xtal clocks, which don't have a > finite relationship to realtime. David, The 2 issues you raise are likely being handled by the following lines in Joshua's code: #include <16c715.h> #use delay(clock=20000000) Joshua, I don't know the PCM compiler, but your code looks OK (if my comments above to David are correct). Can you describe your hardware? --Matt