Keil Logo

8051 Port 0 I/O

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Author
vibin c t
Posted
6-Sep-2018 06:42 GMT
Toolset
C51
New! 8051 Port 0 I/O

8051 Micro controller

Upon reset all port pins and port registers are high.
I follow these instructions...

P0=0x00;
P0=0xFF;

Now ,the result is - All P0 registers are high & all P0 pins are low.

Q1) Does this low P0 pins indicate high impedance floating load in the case of P0?

Now, I start the program with the following instruction only.

P0=0xFF;

But All P0 registers and pins remain high.

Q2)What is the difference here? What's happening inside circuitry in both cases?

Author
H'ed Slap
Posted
6-Sep-2018 08:34 GMT
Toolset
C51
New! RE: 8051 Port 0 I/O

What part of the 8051 documentation are you stuck with?

Author
Andrew Neil
Posted
6-Sep-2018 09:00 GMT
Toolset
C51
New! RE: the 8051 documentation

In the old days, the key documentation set was commonly known as the "bible" for the 8051.

It is getting harder to find these - there should be a clue in that - but here are some archived copies:

Chapter 1 - 80C51 Family Architecture:
http://ecee.colorado.edu/~mcclurel/p8051arc.pdf
https://community.nxp.com/docs/DOC-334648

Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set:
http://www.keil.com/dd/docs/datashts/philips/p51_pg.pdf
http://ecee.colorado.edu/~mcclurel/p8051pg.pdf
https://community.nxp.com/docs/DOC-334650

Chapter 3 - 80C51 Family Hardware Description:
https://courses.cs.washington.edu/courses/cse477/02sp/docs/famhdwr.pdf
https://community.nxp.com/docs/DOC-334649

Keil still list some books: http://www.keil.com/books/8051books.asp

And, of course, you should be studying the manufacturer's documentation for the particular part(s) you are using.

But you should really be asking yourself whether the 8051 is an appropriate place to be starting in this day and age ...

Author
erik malund
Posted
6-Sep-2018 15:39 GMT
Toolset
C51
New! RE: the 8051 documentation

if you are using one of the older derivatives that fully adhere to the original standard P0 dces not have "weak pull-up" as P1, p2 & p3

Author
Vibin C t
Posted
7-Sep-2018 02:32 GMT
Toolset
C51
New! RE: the 8051 documentation

Why keil debugger shows different results? Either way P0=0xFF; is the last instruction.But ,in the first case P0=0x00; prior instruction makes the results different.Any idea?

Author
Andrew Neil
Posted
7-Sep-2018 11:32 GMT
Toolset
C51
New! RE: keil debugger (sic?)

Do you really mean the debugger; ie, a thing connected to real hardware?

Or do you actually mean the simulator; ie, no real hardware - just running on your PC?

Author
vibin c t
Posted
7-Sep-2018 13:11 GMT
Toolset
C51
New! RE: keil debugger (sic?)

Yes, Keil software debugger. C51 IDE

case 1)

main()
{P0=0x00;
 P0=0xFF;
 while(1);
}

case 2)

main()
{
 P0=0xFF;
 while(1);
}

Check port registers in peripheral window. Why different behaviour?

Author
Andrew Neil
Posted
7-Sep-2018 13:35 GMT
Toolset
C51
New! RE: Keil software debugger

That's just as vague as before!

You mean the Simulator ?

That is, you are not using any real target hardware?

Author
Vibin C t
Posted
8-Sep-2018 04:37 GMT
Toolset
C51
New! RE: Keil software debugger

Keil IDE C51. Check with debugger available in keil C51.

Author
erik malund
Posted
8-Sep-2018 13:43 GMT
Toolset
C51
New! RE: Keil software debugger

that is a SIMULATOR and it SIMULATES based on whatever version Keil choose

Author
vibin c t
Posted
10-Sep-2018 06:13 GMT
Toolset
C51
New! RE: Keil software debugger

Can you check this out.

https://stackoverflow.com/questions/52236025/keil-c51-8051-port-0-i-o
Author
Westonsupermare Pier
Posted
10-Sep-2018 17:30 GMT
Toolset
C51
New! RE: Keil software debugger

Links are posted like this http://stackoverflow.com/questions/52236025/keil-c51-8051-port-0-i-o

So gleaned from the new thread this is an AT89S52, still not clear if the respondent is actually using a debugger, and if so how and to where it is attached. Or if the part is being simulated, and if so poorly.

Super selective screen shots. No images of the hardware or board.

Perhaps a more realistic test would be to drive alternate values on P0 and scope the thing to look at the signals presented on the pins.

Look at the listing file for the code generated.

If you think there is a defect with the software, perhaps converse with support, via their direct contact details.

Author
vibin c t
Posted
12-Sep-2018 05:47 GMT
Toolset
C51
New! RE: Keil software debugger

answer: https://stackoverflow.com/a/52287632/9751865

Author
erik malund
Posted
12-Sep-2018 13:27 GMT
Toolset
C51
New! RE: Keil software debugger

anyhow: why do you give a hoot what the simulator shows, what does your actual circuit do?

a simulator is, by definition, imperfect especially when trying to cover the 4711 variants of the .51

Author
Vibin C t
Posted
12-Sep-2018 13:40 GMT
Toolset
C51
New! RE: Keil software debugger

I was trying to interface active high switch to port 0. Since only P0 have the open drain I/O pin in the case of 8051.

Author
Andrew Neil
Posted
12-Sep-2018 14:01 GMT
Toolset
C51
New! RE: only P0 have the open drain I/O pin in the case of 8051

No, that's not true - all 8051 IO pins are open-drain!

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.