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
Bookmarks