Setting I/O ports on 16f629


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Posts
    6

    Default Setting I/O ports on 16f629

    I have been programming a 16f876 for various control/signal generation applications for years using the TRISA=? line to set the ports to input or output.
    I was hoping to use a smaller (8 pin) chip such as 16F629 to generate a asymmetrical squarewave to regulate a clock but the datasheet is set out very differently to the 876.
    Does anyone know if I can use similar code to set the ports, and if not how is it done?
    thanks.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Hi Optech. The command you're looking for is TRISIO. Use it just as you would TRISA. The 1's are inputs, 0's are outputs.

    CMCON = 7 'comparators off
    trisio = %11111111 'set all as inputs
    DEFINE OSCCAL_1K 1 ' Set OSCCAL for 1K device

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Optech View Post
    I have been programming a 16f876 for various control/signal generation applications for years using the TRISA=? line to set the ports to input or output.
    I was hoping to use a smaller (8 pin) chip such as 16F629 to generate a asymmetrical squarewave to regulate a clock but the datasheet is set out very differently to the 876.
    Does anyone know if I can use similar code to set the ports, and if not how is it done?
    thanks.
    16F629?
    Maybe a 12F629...
    Yes, they are practically the same, but different.
    The PBP manual explains the difference between Ports and GPIO's, TRISIO, etc.

  4. #4
    Join Date
    Jan 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Red face

    Thanks for the info. I have now found the relevant section in the pbp manual although it refers to the 12f675. Also skimask, you were right it is 12f629 - just a typo - or brainfade - not quite sure which...

Similar Threads

  1. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 14:01
  2. Replies: 4
    Last Post: - 17th April 2009, 08:56
  3. RA6 & RA7 I/O setting on the 16F88
    By PICante in forum mel PIC BASIC Pro
    Replies: 35
    Last Post: - 23rd August 2008, 19:32
  4. Setting Up Adc Ports
    By GEEZER in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 22nd August 2005, 03:04
  5. managing the I/O ports of the 16F84A
    By skyler_91600 in forum mel PIC BASIC
    Replies: 7
    Last Post: - 28th April 2005, 03:52

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