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.

Initialization code for 89C51

Status
Not open for further replies.

sibs143

Newbie level 1
Joined
Sep 25, 2004
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
11
89c51.h

Hi all,

I am starting a project with 89C51 where I want to use entire 32 I/O lines as I/O ports. Do anyone have the initialization file for this?? (Either ASM or C).

Kindly send across to me.

Thanks in advance,
Sibi

mailto: sibi.mathew@yahoo.com
 

8951 port 2 io

You can easily configure any port to be input port by writing 1s to all it's bite (this is the initialization) then start read data from it
the code of intialization :
MOV p0,#FFH;
the to read data
MOV A,p0

For output port simply write on it directly to the output port
for example
MOV p1, A
 

    sibs143

    Points: 2
    Helpful Answer Positive Rating
assigning port values in c in 89c51

On Power On Reset 8051 internal registers are initialised with all interrupts and peripherals are disabled . So u dont need to initialise when all the 4 ports are used only as I/o lines.

given below is taken from atmel 89C51 datasheet
Ports 0 has open-drain outputs. Each I/O line can be independently used as an input or an output. (Ports 0 and 2 may not be used as general purpose I/O when being used as the ADDR/DATA BUS). To be used as an input, the port bit latch must contain a 1, which turns off the output driver FET. Then, for Ports 1, 2, and 3, the pin is pulled high by the internal pull-up, but can be pulled low by an external source.
 

    sibs143

    Points: 2
    Helpful Answer Positive Rating
89c51 compiler

As you can see from the attached table, you don't need to initialize anything as on power-on or after reset the ports' values are already configured as inputs , to FFh that is ..

Regards,
IanP
 

    sibs143

    Points: 2
    Helpful Answer Positive Rating
source code for 89c51

I couldn't understand your question.

I have used this microcontroller too many times. But, this IC does not need any initialization command. It works perfect for me.

If you need any help with this microcontroller, you can contact me.
 

    sibs143

    Points: 2
    Helpful Answer Positive Rating
free source code for 89c51

Try Keil compiler,

when add new project , you can add startup code for your project for initial your mcu after power-on or reset state.
 

compiler for 89c51

sibs143 said:
Hi all,

I am starting a project with 89C51 where I want to use entire 32 I/O lines as I/O ports. Do anyone have the initialization file for this?? (Either ASM or C).
What do u want to initialize?
If u want to declare Port,reg,pin that's in file 89c51.h (in some compiler folder for atmel )
If u want to initialize timer,serial it belongs to your purpose and there're alots examples in folder Examples of compiler you used.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top