123testing
Newbie level 5
8051 and C address Ports
I am trying to write a test program in "C" for the 8051.
1) set all P0 to output
2) All P0 lined high
3) Wait 2 secs
4) All P0 lines low
5) Wait 2 secs
6) Go to 2)
I want to address ALL P0 in one go. (I do not want to do P0.0, P0.0...).
Then in the body I want to set then high or low.
Is there a command (in C) that will apply to All ports?
Thank you.
I am trying to write a test program in "C" for the 8051.
1) set all P0 to output
2) All P0 lined high
3) Wait 2 secs
4) All P0 lines low
5) Wait 2 secs
6) Go to 2)
I want to address ALL P0 in one go. (I do not want to do P0.0, P0.0...).
Then in the body I want to set then high or low.
Is there a command (in C) that will apply to All ports?
Thank you.