making ports outputs on a 12F629


Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Nov 2004
    Location
    Saskatchewan Canada
    Posts
    189

    Question making ports outputs on a 12F629

    I don't think this is a required command since I am only using HIGH and LOW on the ports which I understand automatically set the port to input or output, but that doesn't stop me from wanting to understand doing this better.

    If I look at the chip data sheet I see that the gpio register starts at 5h and the trisio starts at 85h. <b>Physical</b> pins are as such:

    1 - +5v
    2 - port 5 I/O
    3 - port 4 I/O
    4 - port 3 / MCLR
    5 - port 2 I/O
    6 - port 1 I/O
    7 - port 0 I/O
    8 - ground

    So, I want to make ports 0,1,2,4 and 5 as outputs, port 3 either as MCLR or not used at all. Pins 1 and 8 obviously serve there own purpose. Here is a graphic of the registers:



    I believe I should be able to use POKE $85, <b>?</b> to set the I/O to output on the pins I need, but at the same time not interfere with the other ports. In my mind, since I want all but the MCLR to be outputs it would look like: <b>POKE $85,%0001000</b> or even <b>POKE $85,%00000000</b> since some are ignored and setting pin 3 to MCLR=ON in my programmer it will select the proper bit on it's own.

    Am I somewhat close on my logic? Using the PBC manual this seems reasonable.

    Thanks.

    Bart
    Last edited by bartman; - 12th November 2004 at 04:44.

Similar Threads

  1. Replies: 4
    Last Post: - 17th April 2009, 08:56
  2. Replies: 1
    Last Post: - 29th September 2007, 18:05
  3. Servo control with 12F629
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd June 2005, 23:34
  4. PIC16F62X outputs
    By Deadeye in forum General
    Replies: 6
    Last Post: - 31st May 2005, 21:20
  5. Making Array of two ports
    By John7 in forum General
    Replies: 3
    Last Post: - 5th March 2005, 02:20

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts