PORTA = %00000000 read this as PORTA gets bits 00000000
This means, write 0 to each bit position of PORTA. Each 0 represents the bits in PORTA from bit 7 to bit 0. You could also write it as
PORTA = $00 read this as PortA gets Hex 0
TRISA = %00000000
This is the tristate register which tells your PIC to allow the values of PORTA to 'drive' the external world circuits. Same as above for the bit position part. If you set any 1 position to 1, that position will only be able to read (INPUT) from the external circuit.
Clear now? Don't hesitate to ask. See how many responses you got.
Bookmarks