#byte State_L = 0xF81 // PORT B; PORT A = 0xF80
#bit Status_LED = State_L.2
the example reference LAT BIT.
Code:
#byte Port_B = 0xF8A
#bit Status_LED = Port_B.5
I used the PORT BIT when testing weather the PORT BIT is High or Low,
Can I assume that LAT BIT controls the BIT high or low.
ANdrew _________________ What has been learnt if you make the same mistake?
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
Posted: Mon Dec 11, 2006 8:25 am
Read the PORT bit, write the LATch bit. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
Posted: Mon Dec 11, 2006 3:13 pm
Thanks
I found this after my post, your help is clearer than the extracted quote below
(as extracted from the microchip pdf file "39564c.pdf")
Quote:
Each port has three registers for its operation. These
registers are:
� TRIS register (data direction register)
� PORT register (reads the levels on the pins of the
device)
� LAT register (output latch)
The data latch (LAT register) is useful for read-modify-
write operations on the value that the I/O pins are
driving.
The Data Latch register (LATB) is also memory
mapped. Read-modify-write operations on the LATB
register reads and writes the latched output value for
PORTB.
extracted from "9.0 I/O PORTS"
ANdrew _________________ What has been learnt if you make the same mistake?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum