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
TRISD=0b00000001;
Delay10KTCYx(70);
TRISD=0b00000000;
Delay10KTCYx(70);
TRISD=0b00000010;
Delay10KTCYx(70);
TRISD=0b00000000;
I am new from C code... thanks for the helping
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
TRISD=0b00000001;
Delay10KTCYx(70);
TRISD=0b00000000;
Delay10KTCYx(70);
TRISD=0b00000010;
Delay10KTCYx(70);
TRISD=0b00000000;
I am new from C code... thanks for the helping
Last edited: