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.

PIC 16F877 latchup problem

Status
Not open for further replies.

laser

Junior Member level 3
Joined
Sep 26, 2001
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
212
pic latch up

Hi all.
I´m working on a project wich uses a PIC 16F877 to comunicate asynchronously on a long line of several hundred meters, between a master unit and several slave units.
The way used for communication is very similar to RS485, on wich a 3 wire system is used (two positive differential wires plus GND), to transfer data in a differential way.
The only diference in my case, is that my slave units use this same line as the power source, and the way they respond is by shorting the positive lines also in a differential way.
Now, the ideia is ok, and it works fine, but I have one little problem:
Everytime I plug a new slave unit to the line, on the already connected slave units, the pic inverts it´s I/O outputs for a period of time of 72mS or more, causing undesired results.
I´ve also notisted a similar behavior everytime I touch the OSC CLKIN pin with a screw driver.
Power Up Timer and Brown-out Detect are both on, and a reset would be welcome in a supply voltage drop situation, but not the inversion of the values on the I/O pins.
I read somewhere that this behavior is called Latchup, but what is the cause of this, and what can I do to avoid it?
I´ll apretiate any ideias.
Thanks.
 

sn75176 pic16f877

I have found similar problem with 16C(and F) 73 and 74 chip, I was stay many day with oscilloscope and the only solution that I have found is checking under Watchdog control the rx line status, if the line stay pemanent low watdog reset the chip, I have also saw that latchup problem happened with general I/O when you touch the pin with screew driver, I have tried to apply capacitor, inductor, filter without result
 

int_rda 16f877

I have also had problems that can cause this problem. In my case the decoupling was the problem .1uf close to the chip plus make sure that the powersupply is of good quolity.
Barrybear
 

latch up problem

In fact, the 70ms is the weak up time the PIC needs at power up, during this time, all pins are pulled down. It doesn't matter how you have setted the configuration bits (Power Up Timer and Brown Out Detect. etc)
Using RS485, your Tx/Rx iddle-state (TTL side) is +5V so every time you plug-in a new slave on line, you are producing a going down pulse that is interpreted as a start bit in the units that are listen the net.
You can´t ovoid such hardware behaviour, so your must work around this matter in your code and protocol.
Just my 20 cents, I solved this triggering a time-out every time the #INT_RDA was called.

Best wishes,

humber555
 

pic18f +latch up

Humber, the problem is a little diferent from that.
The pins are not all going down.
That would be just fine, but what is happening is that all I/O´s get inverted.
I mean, all ones became zeros, and all zeros became ones, on every I/O pin configured as an Output.
And that happens during a 72mS period, after wich they became normal again.
 

latch-up pic

I have tested the problem with ICE emulator (Softec DSE1674) that use Microchip Chip, the sw don't stopped, only the TRIS register invert from input to output, and if place for experiment a appropriate reinversion routine the rx pin gone in input state.
The mistey is that the phenomenus appears also with Max485 decoupler, with inductor or capacitor filter. Is repetitive when you make a short pulse on the rs485 line or directly on the rx pin
 

latchup problem

Long lines can pick up glitches or may have capacitance.

This could be the reason - try isolating the line with a small resitor - 47 Ohm or put a transorb accross the line.
 

pic 16f pin down

Laser,would you be prepared to post your source?
Or email it to me.
I will be able to help you.

I have worked extensively with pic comms.(rs485,rs232)
You should use something like sn75176 rs485 chip rather.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top