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.

8051 Power Up Issue

Status
Not open for further replies.

wuchy143

Member
Hello All,

I'm using an 8051(Actually Atmel's 89S52 Micro) in a +5v RS422 system. The micro spits out TTL data from it's serial port(tx) to an RS422 driver(SN65179) which eventually connects to a host and is received as data input into the host.

Problem: With host already powered, you plug in my device, then the host receives an 0xFF for no reason. The device should not send anything at this point and it is. At this point I was guessing a glitch on the TX line on power up.


Upon power up of the 8051 I am seeing some odd behavior at Port 3.1(TX pin). When I look with my oscilloscope when compared to +5V I see the first picture below. In blue +5v ramps up very quickly to +5v. You can see that the TX line of the micro(8051 tx line sits high and transmits by dropping to "0" volts) stays low for just over 1ms and then it is pulled high as that shows the 8051 has taken control of the port.

I'm guessing from the data the host receives I can come to one conclusion. The TX line is staying low on power up that is decoded as a start bit and the rest are all +5v so those would be all 1's creating a spurious 0xFF output at the host.

My intuition told me to put a hard pullup resistor from +5v to the Tx line in order to have that line track the +5v rail so it isn't decoded as a start bit. When I do this I still have the 8051 sinking current because you can see that on power up +5v(blue) goes right to +5v. The Tx line(yellow) tries to get pulled up but the 8051 appears to be not allowing that to happen. I change resistor values and can't seem to rid the issue as I have to put such a hard pullup that the data not cannot be decoded.

Any thoughts as to exactly why this is happening? Also, I was thinking of putting some type of logic gate in line with the Tx line or a transistor so that line will always be high on power up. Any ideas?
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    1.6 MB · Views: 343
  • photo (4).jpg
    photo (4).jpg
    2.1 MB · Views: 341
Last edited:
The SN65179 is a old part. I think you can find a similar part with a 'tri-state' or 'disable" pin. This way you can disable the part until things are up and working.

ALSO

I have seen the termination resistors made so that the (not) wire is pulled down a little and the (true) wire is pulled up a little.
 
Thanks Ron. I am pretty sure I will either use that approach or stick with some type of logic gate in between the 8051 and the RS422 driver.

In regards to the termination resistors I'm not sure if that will work in my case because if the TX line of the 8051 sends data(in this case it isn't data meant to be sent but it is still "sending data" on power up) that RS422 is still just going to pass that signal up stream and will definitely transmit the TX+ and TX- of the RS422.

My biggest thing is understanding the 8051's behavior. I'm ok with putting in some electronics to deal with the problem. I just want to to understand the problem completely so this doesn't come back to bite me in the future.
 
You can use a P-mosfet to remove the power form the SN65179 until the 8051 is up and running. The mosfet could be connected to one of the port pins.

I do see your idea of an OR gate.
 
You can use a P-mosfet to remove the power form the SN65179 until the 8051 is up and running. The mosfet could be connected to one of the port pins.

I do see your idea of an OR gate.

I like the idea of switching power to the RS422 driver but there is one issue. I have observed that the 8051 port pins don't go to +5v the second power is applied to the chip. It takes 250ms for the 8051 to come out of reset. During this time the port pins are low for a small chunk of time then are asserted "high" due to being in reset. Sine I don't have full control of the port pins I see that it could accidentally turn on the driver when coming up and still have the same issue.

I gotta think about this one...
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top