Re: Digital touch Screen Combination lock
So if you use for example the "if"
if LATB.0 = 0
that mean that we make the port as input? If that so, then what is the way to read the status of the port...."high" or "low" or even the value of the port?
combined with this continually showing up in your code
TRISA = %00000000 'use TRISA to specify which pin is (1 = input) and which (0 = output) (ALL pins are output)
TRISB = %00000000 'use TRISB to specify which pin is (1 = input) and which (0 = output) (RB7 PORTB.7 is the RX input pin of the EUART, the rest are output)
TRISC = %10000000 'use TRISC to specify which pin is (1 = input) and which (0 = output) (RC7 PORTC.7 is the RX input pin of the EUART, the rest are output)
'in PORTC the RC3 attached is an LED.
Code:
'------------------------------------------------------------------------|
'--------------------------- TRIS A B C ---------------------------------|
'------------------------------------------------------------------------|
' PORTA.7 PORTA.6 PORTA.5 PORTA.4 PORTA.3 PORTA.2 PORTA.1 PORTA.0 |
' bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 |
' 0 0 0 0 0 0 0 0 |
'------------------------------------------------------------------------|
'------------------------------------------------------------------------|
' PORTB.7 PORTB.6 PORTB.5 PORTB.4 PORTB.3 PORTB.2 PORTB.1 PORTB.0 |
' bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 |
' 0 0 0 0 0 0 0 0 |
'------------------------------------------------------------------------|
'------------------------------------------------------------------------|
' PORTC.7 PORTC.6 PORTC.5 PORTC.4 PORTC.3 PORTC.2 PORTC.1 PORTC.0 |
' bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 |
' 1 0 0 0 0 0 0 0 |
leads me to think there is fundamental lack of understanding here of pic i/o architecture
and the relation ship between ansel,port,lat and tris registers and their effect on
pin operations.
i would recommend a few led flashing exercises to become comfortable with i/o concepts
Warning I'm not a teacher
Bookmarks