Jan 12, 2008 #1 1 123testing Newbie level 5 Joined Dec 22, 2007 Messages 9 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,332 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.
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.
Jan 17, 2008 #2 P pankajrangaree1 Junior Member level 2 Joined Jan 8, 2008 Messages 24 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,368 Re: 8051 and C address Ports this book will help u
Jan 17, 2008 #3 SISWANTO Advanced Member level 4 Joined May 14, 2001 Messages 107 Helped 6 Reputation 12 Reaction score 6 Trophy points 1,298 Location Nirwana Activity points 877 8051 and C address Ports In 8051 series You did not need to set I/O as input or output, it is do not have I/O control register like in AVR or Rabbit as i have tried. You just read from I/O or just set the I/O to Hi/Low. All P0 High --> P0=0xFF; All P0 Low --> P0=0x00; what kind the compiler do you used? Salam Siswanto
8051 and C address Ports In 8051 series You did not need to set I/O as input or output, it is do not have I/O control register like in AVR or Rabbit as i have tried. You just read from I/O or just set the I/O to Hi/Low. All P0 High --> P0=0xFF; All P0 Low --> P0=0x00; what kind the compiler do you used? Salam Siswanto