16F628 PortA pin connections - wierd


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    john meiers's Avatar
    john meiers Guest


    Did you find this post helpful? Yes | No

    Default

    Doesn't the ALL_DIGITAL = TRUE command take care of that? I even tried replacing that with CMCON command, but still no worky. With the PORTA.0 pin tied high through the 10k, I still read practically 0v on the pin with the VMM. Here is the code preface:

    Device = 16F628A
    XTAL = 4

    ALL_DIGITAL = TRUE
    PORTB_PULLUPS = On
    TRISB = 0

    Symbol SW1 = PORTA.0
    Symbol LED1 = PORTB.0
    Symbol LED2 = PORTB.1

    Dim CounterA As Byte

    TRISA = $F0
    PORTB = 0

    Any ideas?

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Any ideas?
    Yes, you're on the wrong forum. This one is for compilers that work...

    But if your pin is showing 0v... it looks like the pin is switched to OUTPUT and not INPUT. TRIS statements take care of that in the MeLabs compilers... but from your code it doesn't look like you've one of those.

    Oh... looking again... your TRISA=$F0 has PortA.0 as an OUTPUT.

  3. #3
    john meiers's Avatar
    john meiers Guest


    Did you find this post helpful? Yes | No

    Default

    ouch..having a bad day? I'm using the Proton IDE Lite compiler...it works great and its free. But fixing that TRIS statement did the trick, so thank you for your help!

Similar Threads

  1. My code for TV remote and MIBAM for RGB control
    By idtat in forum Code Examples
    Replies: 4
    Last Post: - 12th January 2013, 21:52
  2. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 14:55
  3. DS1820 with 16f688
    By jessey in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 23rd May 2009, 06:07
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 18:27
  5. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 18:07

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