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.

atmel mcu question

Status
Not open for further replies.

yctek

New Member
what happens when atmega8515 mcu port is configured as output and an input is applied? could this application damage the mcu?
 

yctek

New Member
protective diodes

Directly from the data sheet, they are saying each port has protective diodes. What does these diodes actually do? a circuit schematic from the data sheet is provided in the attachment.
 

Attachments

  • Doc2.doc
    36 KB · Views: 121
Last edited:

Blueteeth

Well-Known Member
The protection diodes on input pins clamp the input voltage to 0v-Vd, and VCC+Vd. Where 'Vd' is the forward voltage across the diode. usually 0.6-0.7V. So when an input of say -2V is applied, with respect to GND, the diode will conduct this to ground via the lower diode, with its forward voltage of 0.7V, you would read -0.7 on your multimeter.

Similarly, the top diode does the same with VCC. Say your MCU is powered by 5v, and you apply 6v to the input, the diode will clamp this at 5.7V, conducting the other 0.3v to VCC.

These diodes are really just protection from the more sensitive circuitry after the input, and I'm sure your MCU datasheet will specify the maximum diode current. Its usually 20mA or something.

This means that if your input to the I/O pin can provide more than 20mA, AND is less than -0.7V or above VCC+0.7 (say 5.7V) you will fry one of the diodes. And when diodes blow they usually short circuit meaning you input would be effectly tied to GND or VCC, making it useless. The advantage is that you only lose an I/O pin rather than the whole chip.

That said, if you can limit current to something sensible like 2mA, you can actually provide the I/O pin with voltages outside the specified range, like -10V, or 12V. If you connect these voltages to your I/O pins via a large value resistor to limit the current, then what you will read at the I/O pin will be -0.7 for negative input, and VCC+0.7 for postive.

Its generally not recommended though. I have only done it when connecting many many RS232 input lines to microcontrollers. (probably should have used a transistor).

In answer to your first question, yes, if a port/pin is configured as an output, and you apply another output to it (mistaking it for an input) you may have a situation where the voltages differ. That is, apply 0V to a 0v output, and theres no voltage difference, no current will flow, but apply +5V and you have 5v across the connection between these two pins. V=IR, I=V/R, V = 5v and R is VERY low (PCB tracks/wires generally have low resistance). This means the current that can flow is huge, and if not limited will most certainly destroy one or both of the devices. Best case would be it would only ruin the I/O pins.

Blueteeth
 

2f1c

New Member
a friend of mine tried this on a 8535 (this was a mistake, otherwise i would tag him as a true hacker heheh), the IO pins suffered an erratic behaviour, for short they were burnt

i saw this "technique" applied to some pic mcu's to prevent them being reread, kind of code protection

i also noticed that atmel mcu's are really tough , they can handle "shocks" more than other mcus (like pics), like placing Vcc on the Xtal output

cheers
 

Blueteeth

Well-Known Member
I've managed to blow the MCLR pin, and both xtal pins, through the wonderful gift of tiny metal shavings on a PCB :)

You can always use the internal oscillator, but when the MCLR went, it was shunted to ground. Ergo, permenant reset, and no programming :(

As far as the normal I/O's go, you're right, very tough. I wouldn't know if atmel's MCU's are tougher, I've done the above to those too.

-Blueteeth
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Top