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.

NPN proximity switch interface to 89c51

Status
Not open for further replies.

eshan7

Newbie level 3
Joined
Mar 27, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
I have to interface an NPN proximity switch to uC 89C51...

Please help me with a schematic on how to connect the sensor and how to code it..

The sensor is NPN and takes 5 to 24V input supply. And it gives the same at o/p..
 

The attached picture shows connection between a proximity sensor and 8051 microcontroller without isolation via. Interrupt_0 pin ..

These switches have usually N/O [normally-open] output, that is when nothing is in the proximity of the sensor the output is in high-impedance stage and the voltage is determined by the pull-up [4.7k] resistor ..

On power-on the 8051-derivative has the Interrupt_0 active on the falling edge, so when something triggers the sensor the voltage drops down and the Interrupt_0 will become active ..

In the beginning of your code define a flag as:
Code:
Flags		DATA	20h
Proximity_1	BIT	Flags.0

And then set it in the ISR[Interrupt Service Routine]:
Code:
Int_0:
	SETB		Proximity_1
	RETI

Rgds,
IanP
:D
 

    eshan7

    Points: 2
    Helpful Answer Positive Rating
The attached picture shows connection between a proximity sensor and 8051 microcontroller without isolation via. Interrupt_0 pin ..

These switches have usually N/O [normally-open] output, that is when nothing is in the proximity of the sensor the output is in high-impedance stage and the voltage is determined by the pull-up [4.7k] resistor ..

On power-on the 8051-derivative has the Interrupt_0 active on the falling edge, so when something triggers the sensor the voltage drops down and the Interrupt_0 will become active ..

In the beginning of your code define a flag as:
Code:
Flags		DATA	20h
Proximity_1	BIT	Flags.0

And then set it in the ISR[Interrupt Service Routine]:
Code:
Int_0:
	SETB		Proximity_1
	RETI


Do we have to write this code in the program as it is?

---------- Post added at 19:41 ---------- Previous post was at 19:31 ----------

And can you pls explain is how it works....
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top