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.

89C2051 Microcontroller Timer issue

Status
Not open for further replies.

Js_Ong

Member level 4
Joined
Jan 15, 2007
Messages
68
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
1,796
All,

I am using 89C2051 to write a timer program, output is 5 seconds SETB P1.2, and 10 seconds CLR P1.2. The timer works just well when I connect a L.E.D to the blink, but when I connected to TIP120 Transistor for a motor, the motor is not running for 5 seconds, even I change the SETB P1.2 to 3, 5, 10,15 Seconds, the motor just turn ON for a while. I do not understand why? Please help.



Thanks.
 

If your program is running correctly with LED the issue (most likely) is with “spikes” produced by the motor when it is switched on (or off).
You have to “silence” the supply that you feed the microcontroller with by adding usual stuff, that is 100nF cap very close to Vcc-GND pins, and/or a RF-choke (~100uH) on the +5V supply line ..

:wink:
IanP
 

Can you post a schematic and the code of your project?

Have you implemented any Back/Counter EMF protective circuitry?

BigDog
 

Hi All,

Thanks to your previous reply. I stopped this investigation and now coming back to it. I had solved the problem now. The circuit is actually very simple from output pin of uC with 1K resistor connected to the Base of NPN Transistor, but it doesn't work. I found that I need a pull up resistor at the Transistor Base to get the motor run axactly the timing I programme, but not sure why pull up is needed at the transistor base. Why the output current from uC is not enough to trigger the Transistor?
 

U can also use 8.2V zener diode in series with 1K Resistor to the base of the transistor, but its only required when you use PNP Transistors...i dont think its required in npn configuration.. with NPN you can directly switch on/off using 1K base resistor to the microcontroller output pin...
 

Have you reviewed the 89C2051 datasheet to ensure you are not attempting to drive the NPN transistor with an open collector/drain output?

Open collector/drain outputs can only sink current, not source current, which is why a pullup resistor is often used in conjunction with an open collector/drain output pin.

If I remember correctly, P1.0 and P1.1 of the 89C2051 are open collector/drain and if so, would require pullup resistors to drive the base of an NPN transistor.


Also depending on the specific NPN transistor in use, a 1kΩ resistor maybe too high a value.

You'll need to carry out the calculations for the required base current to determine the appropriate value.


BigDog
 

Hi bigdogguru,

Correct that P1.0 and P1.1 are open drain. But I am using P1.2 and P1.3 which has internal pull up. I had tried to do the calculations for the resistor values even direct connection from uC pin to Base but all still not working. However, finally an external pull up makes my motor run and all the component does not get heat. I post this to share my experience but not yet figure out why it needed to be connected so.
 

What is the part number of the NPN transistor?

I've never used an 89C2051 in a design, therefore I'm not readily familiar with its specs.

What other devices are you driving with outputs from the 89C2051 which would require it to source current?


BigDog
 

Have you implemented any Back/Counter EMF protective circuitry?

Hi Bigdogguru,
Can you provide some detail on it?
I've got stuck on a part of a project with similar to this problem.
What should I do?
Motor is getting on for a while & then it gets off.
I've used L293d (the common circuit without any modification) with p89v51rd2.
I've used before sometime, It was running. But for now (with new circuit components but the same schematic), it is not working. The program is correct.
 

Hi Bigdogguru,

I am using TIP120, I have tried using BC945, from direct connection until try using 1K, 2.2K...10K resistor, both not working. The different TIP120 and BC945 is TIP120 at least give me a one shot pulse, but BC945 not working at all. I never face the pull up problem before, only pull down at the output of LM324.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top