PORTA.0 works, PORTB.7 or .6 do not


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1

    Default PORTA.0 works, PORTB.7 or .6 do not

    Hi all

    Usually it's the other way around - trouble with PORTA . . .
    I have 1K pull-ups connected to PORTA.0 and PORTB.6 and PORTB.7
    Also have pullups enabled for Port B., so probably do not need another external one.

    When I ground the input, I want to simply change some values, and it works as hoped for using PORTA.0, but not with PORTB.6 or PORTB.7

    At first I thought it might be due to having the Pickit2 attached, which uses PORTB.6 and 7, but disconnecting the Pickit had no effect.

    Perhaps it's in how I have the CONFIGS set up - I am totally stumped.
    PORTB.6 and 7 are not used anywhere else in the program.

    Some of the code is attached below - at least what I THINK is appropriate for review. If need be I can post the entire program, it's kind of long, and probably could use a lot of refinement - but that is for later.

    include "modedefs.bas"
    OPTION_REG.7 = 0
    ADCON1 = %00000110
    INTCON = %00000000 '''DISABLE ALL INTERRUPTS
    DEFINE OSC 4
    TRISA = %00000111
    TRISB = %11111111 'PORT B ALL INPUTS
    TRISC = %01010000
    Tx VAR PORTC.6


    START:
    IF PORTA.0 = 1 THEN CHK_AXIS '''IF NOT GROUNDED, BYPASS


    ''' '************************************************* *
    ''THIS IS WHERE THE VALUES ARE CHANGED
    ''WORKS GREAT FOR PORTA.0
    ''DOES NOT WORK WITH PORTB.7 OR 6
    ''************************************************ *********

    Z_LIMIT = Z
    Z1H = Z_LIMIT DIG 1
    Z2L = Z_LIMIT DIG 0
    '************************************************* ********************
    ''************************************************ ***********

    CHK_AXIS:

    IF PORTB.1 = 0 then Chk_x
    if PORTB.2 = 0 then Chk_Y
    if PORTB.3 = 0 then Chk_Z


    '*************************
    ' MORE UNRELATED CODE FOLLOWS

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi ozarkshermit,
    I cannot tell doodlysquat without knowing which PIC you are using, on account of I Need to view the Data sheet.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Sorry:

    It is a 16F876A
    Ken

  4. #4


    Did you find this post helpful? Yes | No

    Default

    I hope this is not a double post - anyway - PROBLEM SOLVED

    It was a faulty jumper in my hardware. I guess I should have looked harder to begin with.

    Ken

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    OK, glad you got it working.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. LCD works at 4MHz, but not 12 or 16MHz
    By Max Power in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th June 2008, 01:23
  2. AD works in Porta.0 but not in porta.1
    By ruijc in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 19th February 2008, 20:22
  3. Replies: 42
    Last Post: - 14th January 2008, 11:38
  4. Replies: 11
    Last Post: - 13th July 2005, 19:26
  5. Serin2 Timeout, how it works?
    By Fossil in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th March 2004, 10:09

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