+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2018
    Location
    Azores Islands
    Posts
    4

    Default 16F628A Configuring all pins for digital I/O ?

    Hello. Help please! I have a very basic noob question:
    On my 16F628A, How do I configure all my pins as digital I/O ?
    I have been reading all sorts of confusing info about how very important it is to configure default analog ports to digital at the start of a program but zilch on how to actually do this!
    It says "...you must find and set a register to select digital mode for the pins." OK, but the 16F628A doesn't seem to have ANSEL or ADCON registers and I can't find anything in the data sheet on how to turn off analog pins.
    It is very difficult for a noob to find out fundamental things like this... help appreciated!

  2. #2
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    203

    Default Re: 16F628A Configuring all pins for digital I/O ?

    Though I never worked with that PIC, looking over the data sheet it would appear there is no analog option; all PORT Pins are digital...always.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    1,337

    Default Re: 16F628A Configuring all pins for digital I/O ?

    except for the comparator , read the data sheet porta section
    This is more entertaining than Free to Air TV

  4. #4
    Join Date
    Jan 2005
    Location
    France
    Posts
    85

    Default Re: 16F628A Configuring all pins for digital I/O ?

    hello I am not a super specialist, but I have used this 16F628 in a DTMF decode function
    here is the beginning (I use CMCON to have digital input)
    '************************************************* ***************
    '* Name : prefetch V6.bas *
    '* Author : F1CHF *
    '* Date : 1/06/2007 *
    '* LED ENB ON sur codes ordinaires *
    '* mais pas sur ABCD et code Zero *
    '************************************************* ***************
    @ device pic16f628, pwrt_on, protect_off
    define osc 3 'car le quartz fait 3.58 Mhz
    CMCON = 7 'modif pour PIC 16F628
    'définition des entrées
    STB var PORTA.4 '1 si réception d'un code DTMF valide(STROBE du 8870)
    E1 var PORTA.0 'Q1 du 8870
    E2 var PORTA.1 'Q2 du 8870
    E3 var PORTA.2 'Q3 du 8870
    E4 var PORTA.3 'Q4 du 8870
    ' definition des sorties
    DTMFA var PORTB.2
    DTMFB var PORTB.4
    DTMFC var PORTB.3
    DTMFD var PORTB.5

    hope this help you
    Francois

  5. #5
    Join Date
    Aug 2003
    Location
    Australia
    Posts
    973

    Default Re: 16F628A Configuring all pins for digital I/O ?

    CMCON = 7 is it,
    then it’s immediately compatible with any 16F84 source.

Similar Threads

  1. trouble getting certain pins to act as digital on 18F2550
    By missouri100 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th December 2015, 14:04
  2. Configuring 16F916 for digital I/O
    By tekart in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th October 2011, 17:51
  3. 18F2520 - problem configuring fuse for port B as digital port.
    By hwhisperer in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th October 2010, 11:41
  4. PIC - 8 Pins - 6 Output Pins ?
    By DanPBP in forum Off Topic
    Replies: 0
    Last Post: - 22nd October 2007, 00:23
  5. Analog pins for digital input
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th September 2005, 00:32

Members who have read this thread : 15

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