Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need help with the 8051

Status
Not open for further replies.

AceOfHearts

New Member
I am learning to program the 8051.

I have downloaded a simple program I wrote to drive 7 segment display...I need some explenations.

On the microcontroller, the outputs are inverted so that when I wanted a Logic 1, it ouputs a Logic 0 instead, and vice versa.

If I Do

MOV A, #10

that is moving the decimal 10 into the accumulator, which in binary is 00001010

If I then do the following:

MOV P0, A

I am explecting P0.1 and P0.3 to be at Logic 1, but it seems to be the other way round when I download it....

I could easily complement the values in the program, but this is not what I was expecting from what I learnt before.

Any help appreciated...
 
In case you missed it, and many people do, on most 8051 variants, Port 0 has open collector outputs. This means that a pullup resistor is required for the output to go to a high state.
 
Thanks for your input! I appreciate it very much. You were right about the pull-up resistors. I have connected those now. But I think they were not the problem.

I think the 8051 was sending the correct values to its pins, but the LEDs on my target board is inverted which was giving me wrong indications. Anyway, I think time will only clear this confusion up as I gain more experience.

Many thanks for your help.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top