im using p18f4455 with C
If i wanna turn on all PORT D (RD0 to RD7)i should use "TRISD=0b00000000;" which 0 = output and 1 = input. If i wanna turn RD0 on it should be "TRISD=0b00000001;" But i found some other code on the internet which is "PORTD=0b00000000;"
what is the different between TRISD and PORTD? Are they doing the same things?
And now if i have to turn on RD0 for 5seconds then turn it off. turn on RD1 for 5 seconds and turn off. Should i do it like
I believe LATx is recommended when the PIN is output and PORTx is used for input pins. You can also use PORTx for setting High or Low a pin but not recommended.