Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Is there a command (in C) that will apply to All ports?

Status
Not open for further replies.

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

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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top