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.

Unstable (Flickering) Serial output of AT 89C52

Status
Not open for further replies.

Rehan Yasin

Newbie level 4
Joined
Apr 16, 2010
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,324
I have a simple program that reads data from port 1 of AT89C52 and writes it to TX serial pin. Data bits corresponding to Pin 1,2, 5, and 8 of port 1 are stable but on pins 3,4,6 and 8 of port 1 flickering or unstable data bits are coming. I have tried many tests to kill the problem in which I have changed contollers, oscillator and power supply but the problem is still there.
Plz can any one solve the problem.
Thanks.
yasinrehan@yahoo.com
 

What's connected to P1 pins?
Do you have pullups, pulldowns, or anything else?

Rgds,
IanP
:|
 

for taking input from switches on port 1, IC 74LS245 is used.
i.e IC 74LS245 takes input from switches and sends these outputs to port 1 of microcontroller AT 89C52. Nothing else (push up or pull up) is used.

hmmmmmmmm! I think I should use pull up resistors to kill flickering??
IF it is yes what resistance value should be used.

If instead of switches feedback of relays are used, in that case should same pull up resistors be used????

Regards,
Rehan

Added after 25 minutes:

Hi IanP!

Whether flickering is due to no pull ups present in the circuit. Should there be used pull up resistors to prevent from flickering.

Regards,
Rehan
 

Say, DIR is connected to “H” and /G is connected to “L” - that defines transmission from A-to-B, but what do you have on the A - side, do you have a pull-up there?
Maybe that’s where the problem lays .. see attached picture ..

If you don’t treat 74LS245 as a tri-state buffer but have the control pins (/G and DIR) connected as mentioned above, the situation with undefined states is on the 74LS245 inputs/switches side ..

In any case, 10k pull-ups should do ..

Rgds,
IanP
:|
 

Yes, the problem got identified.
Thanks a lot for your kind help!!!
 

I have included the pull up resistance circuit as you sent. But the porblem still existing with some flickering.
Also when switches are on/off at random the flickering present but no flickering present when switches are ON in an order from switch 1 to switch 8 and vise versa OFF in reverse order from switch 8 to switch 1. What is the solution?? if any one can solve the problem...
 

The problem of flickered data of TX pin no. 11 is still existing even when pull up resistor circuit at Port P1 is attached. Is it hardware poblem or software problem???
can any one suggest me the solution.......
 

I have a simple program that reads data from port 1 of AT89C52 and writes it to TX serial pin
If every possible input is pulled-up to Vcc, you may try to add ≈100nF capacitors between each pin and GND - that's in case the inputs still pick-up something from somewhere, but I'd like to have a look at the code ..

IanP
:|
 

The code is show below.
Is there any error in code, please let me know.

#include<AT89X52.h>
#include<stdio.h>

SP_ISR(void) interrupt 4 {

unsigned char p2_data=0x01;

p2_data=P1;
SBUF=p2_data;
while(!TI);
TI=0;
}



char bdata pcond=0x00;
sbit p=pcond^7;


void main (void)
{
pcond=PCON;
p=1;
PCON=pcond;

TMOD=0x20;
IE=0x90;
SCON=0x40;
TH1=0xFD;
TL1=0xFD;
P0=0x00;
P1=0xFF;
P2=0x00;
REN=0;
P2_4=1;
P2_5=1;
TR1=1;
TI=1;

while(1);
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top