Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

RE: [AVR-Chat] Re: fast controller

RE: [AVR-Chat] Re: fast controller

2012-08-22 by Tim Mitchell

----Original Message----
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com
[mailto:AVR-Chat@yahoogroups.com] On Behalf Of bonzadog
Sent: 22 August 2012 15:59 To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Re: fast controller

> Could you please give an example. I do find it hard to
> believe a 100Mhz 
> system is being overperformed by a
> much lower speed 16Mhz. Perhaps the HW (UI,UART,CAN etc) 
> on the 16Mhz 
> is perhaps faster or offers more
> possibilities?

OK - the task was to pulse width modulate a number of LEDs in software by wiggling pins, while receiving serial data commands. I was surprised to find that the AVR can do 8 bit PWM faster. In fact in many bit-twiddling applications you can get better speed out of an AVR.

I came to the conclusion it was mostly down to the instruction pipelining on the ARM devices which is very inefficient when jumping around code (I was using an ARM7 device, the Cortex-M3 devices are better). Basically every time you do a jump it wastes 6 cycles loading the next instruction. Also the AVR port bit set/clear instructions only take 1 cycle whereas the ARM takes 4 or 6.

If the PWM is more than 8 bit then the ARM was faster (just).

-- 
Tim Mitchell

RE: [AVR-Chat] Re: fast controller

2012-08-22 by farshid alipour

perhaps it is possible to use AVR i'll try it .i made a up/down counter by a mega16 for counting an encoder it was 2048 pulse when i rotate it slowly there was no any problem but when i rotate it over 500rpm it lost some pulses finally i made it by TTL ICs and now it work at 11000rpm.AVRs isnot fast enough for this project.
i want to make a position loop (like cnc machine) i already tried it by a mega16 i could not be successful the motor start to shake when the axis arrived to the destination. perhaps the last loop in program which check the position is too long and if i improve the program the motor would shake less, any way if i use faster controller it will work properly.in some servo drives like Fanuc and Mitsubishi is used DSPs like TMS320C25 for positioning control they are very fast but  expensive
--- On Wed, 8/22/12, Tim Mitchell <tim@sabretechnology.co.uk> wrote:
Show quoted textHide quoted text
From: Tim Mitchell <tim@sabretechnology.co.uk>
Subject: RE: [AVR-Chat] Re: fast controller
To: AVR-Chat@yahoogroups.com
Date: Wednesday, August 22, 2012, 8:23 PM
















 



  


    
      
      
      ----Original Message----

From: AVR-Chat@yahoogroups.com

[mailto:AVR-Chat@yahoogroups.com] On Behalf Of bonzadog

Sent: 22 August 2012 15:59 To: AVR-Chat@yahoogroups.com

Subject: Re: [AVR-Chat] Re: fast controller



> Could you please give an example. I do find it hard to

> believe a 100Mhz 

> system is being overperformed by a

> much lower speed 16Mhz. Perhaps the HW (UI,UART,CAN etc) 

> on the 16Mhz 

> is perhaps faster or offers more

> possibilities?



OK - the task was to pulse width modulate a number of LEDs in software by wiggling pins, while receiving serial data commands. I was surprised to find that the AVR can do 8 bit PWM faster. In fact in many bit-twiddling applications you can get better speed out of an AVR.



I came to the conclusion it was mostly down to the instruction pipelining on the ARM devices which is very inefficient when jumping around code (I was using an ARM7 device, the Cortex-M3 devices are better). Basically every time you do a jump it wastes 6 cycles loading the next instruction. Also the AVR port bit set/clear instructions only take 1 cycle whereas the ARM takes 4 or 6.



If the PWM is more than 8 bit then the ARM was faster (just).



-- 

Tim Mitchell





    
     

    
    






  










[Non-text portions of this message have been removed]

RE: [AVR-Chat] Re: fast controller

2012-08-22 by farshid alipour

perhaps it is possible to use AVR i'll try it .i made a up/down counter by a mega16 for counting an encoder it was 2048 pulse when i rotate it slowly there was no any problem but when i rotate it over 500rpm it lost some pulses finally i made it by TTL ICs and now it work at 11000rpm.AVRs isnot fast enough for this project.
i want to make a position loop (like cnc machine) i already tried it by a mega16 i could not be successful the motor start to shake when the axis arrived to the destination. perhaps the last loop in program which check the position is too long and if i improve the program the motor would shake less, any way if i use faster controller it will work properly.in some servo drives like Fanuc and Mitsubishi is used DSPs like TMS320C25 forpositioning control they are very fast but  expensiveFarshid Alipour.


--- On Wed, 8/22/12, Tim Mitchell <tim@sabretechnology.co.uk> wrote:
Show quoted textHide quoted text
From: Tim Mitchell <tim@sabretechnology.co.uk>
Subject: RE: [AVR-Chat] Re: fast controller
To: AVR-Chat@yahoogroups.com
Date: Wednesday, August 22, 2012, 8:23 PM
















 



  


    
      
      
      ----Original Message----

From: AVR-Chat@yahoogroups.com

[mailto:AVR-Chat@yahoogroups.com] On Behalf Of bonzadog

Sent: 22 August 2012 15:59 To: AVR-Chat@yahoogroups.com

Subject: Re: [AVR-Chat] Re: fast controller



> Could you please give an example. I do find it hard to

> believe a 100Mhz 

> system is being overperformed by a

> much lower speed 16Mhz. Perhaps the HW (UI,UART,CAN etc) 

> on the 16Mhz 

> is perhaps faster or offers more

> possibilities?



OK - the task was to pulse width modulate a number of LEDs in software by wiggling pins, while receiving serial data commands. I was surprised to find that the AVR can do 8 bit PWM faster. In fact in many bit-twiddling applications you can get better speed out of an AVR.



I came to the conclusion it was mostly down to the instruction pipelining on the ARM devices which is very inefficient when jumping around code (I was using an ARM7 device, the Cortex-M3 devices are better). Basically every time you do a jump it wastes 6 cycles loading the next instruction. Also the AVR port bit set/clear instructions only take 1 cycle whereas the ARM takes 4 or 6.



If the PWM is more than 8 bit then the ARM was faster (just).



-- 

Tim Mitchell





    
     

    
    






  










[Non-text portions of this message have been removed]

Re: [AVR-Chat] Re: fast controller

2012-08-22 by Philippe Habib

I've been playing with the PSoC chips from Cypress which give you an 8051 or an ARM plus some CPLD like programmable hardware logic all on the same part and with a mesh to connect pretty much anything to anything.  The supporting environment lets you have the HW portion generate interrupts or perform DMA with data right into your RAM space and so on.  For something where you need a little bit of something to happen very fast and be tightly coupled to your micro and firmware these are really nice.  Cypress gives a free training every month or so where you get an overview and a dev kit.

I haven't done anything real with one yet, but they look very cool.
Show quoted textHide quoted text
----- Original Message -----
From: "farshid alipour" <farshid32001@yahoo.com>
To: AVR-Chat@yahoogroups.com
Sent: Wednesday, August 22, 2012 1:12:09 PM
Subject: RE: [AVR-Chat] Re: fast controller

perhaps it is possible to use AVR i'll try it .i made a up/down counter by a mega16 for counting an encoder it was 2048 pulse when i rotate it slowly there was no any problem but when i rotate it over 500rpm it lost some pulses finally i made it by TTL ICs and now it work at 11000rpm.AVRs isnot fast enough for this project.
i want to make a position loop (like cnc machine) i already tried it by a mega16 i could not be successful the motor start to shake when the axis arrived to the destination. perhaps the last loop in program which check the position is too long and if i improve the program the motor would shake less, any way if i use faster controller it will work properly.in some servo drives like Fanuc and Mitsubishi is used DSPs like TMS320C25 forpositioning control they are very fast but  expensiveFarshid Alipour.


--- On Wed, 8/22/12, Tim Mitchell <tim@sabretechnology.co.uk> wrote:

From: Tim Mitchell <tim@sabretechnology.co.uk>
Subject: RE: [AVR-Chat] Re: fast controller
To: AVR-Chat@yahoogroups.com
Date: Wednesday, August 22, 2012, 8:23 PM
















 



  


    
      
      
      ----Original Message----

From: AVR-Chat@yahoogroups.com

[mailto:AVR-Chat@yahoogroups.com] On Behalf Of bonzadog

Sent: 22 August 2012 15:59 To: AVR-Chat@yahoogroups.com

Subject: Re: [AVR-Chat] Re: fast controller



> Could you please give an example. I do find it hard to

> believe a 100Mhz 

> system is being overperformed by a

> much lower speed 16Mhz. Perhaps the HW (UI,UART,CAN etc) 

> on the 16Mhz 

> is perhaps faster or offers more

> possibilities?



OK - the task was to pulse width modulate a number of LEDs in software by wiggling pins, while receiving serial data commands. I was surprised to find that the AVR can do 8 bit PWM faster. In fact in many bit-twiddling applications you can get better speed out of an AVR.



I came to the conclusion it was mostly down to the instruction pipelining on the ARM devices which is very inefficient when jumping around code (I was using an ARM7 device, the Cortex-M3 devices are better). Basically every time you do a jump it wastes 6 cycles loading the next instruction. Also the AVR port bit set/clear instructions only take 1 cycle whereas the ARM takes 4 or 6.



If the PWM is more than 8 bit then the ARM was faster (just).



-- 

Tim Mitchell





    
     

    
    






  










[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

Re: fast controller

2012-08-22 by enkitec@gmail.com

On 22-Aug-12 17:12, farshid alipour wrote:
> perhaps it is possible to use AVR i'll try it .i made a up/down counter by a mega16 for counting an encoder it was 2048 pulse when i rotate it slowly there was no any problem but when i rotate it over 500rpm it lost some pulses finally i made it by TTL ICs and now it work at 11000rpm.AVRs isnot fast enough for this project.

     11000 RPM is just 184 RPS.  It is awfully slow for any AVR.  My 
guess your program is too slow, not the AVR.


> i want to make a position loop (like cnc machine) i already tried it by a mega16 i could not be successful the motor start to shake when the axis arrived to the destination. perhaps the last loop in program which check the position is too long and if i improve the program the motor would shake less, any way if i use faster controller it will work properly.in some servo drives like Fanuc and Mitsubishi is used DSPs like TMS320C25 forpositioning control they are very fast but  expensiveFarshid Alipour.
>

     Have you ever programmed a TMS320C25?  An AVR at 20MHz can do 
things faster, except for DSP routines.

     Mark

Re: [AVR-Chat] Re: fast controller

2012-08-22 by Philippe Habib

That's 184 RPS, but he said he has 2048 points per rotation.  I'm guessing a quadrature encoder that he has to read, determine direction and increment/decrement 374k times per second.  I can see why he moved that part to hardware.
Show quoted textHide quoted text
----- Original Message -----
From: enkitec@gmail.com
To: AVR-Chat@yahoogroups.com
Sent: Wednesday, August 22, 2012 2:30:35 PM
Subject: [AVR-Chat] Re: fast controller

On 22-Aug-12 17:12, farshid alipour wrote:
> perhaps it is possible to use AVR i'll try it .i made a up/down counter by a mega16 for counting an encoder it was 2048 pulse when i rotate it slowly there was no any problem but when i rotate it over 500rpm it lost some pulses finally i made it by TTL ICs and now it work at 11000rpm.AVRs isnot fast enough for this project.

     11000 RPM is just 184 RPS.  It is awfully slow for any AVR.  My 
guess your program is too slow, not the AVR.


     Mark



------------------------------------

Re: [AVR-Chat] Re: fast controller

2012-08-22 by David Kelly

On Aug 22, 2012, at 4:48 PM, Philippe Habib wrote:

> That's 184 RPS, but he said he has 2048 points per rotation.  I'm guessing a quadrature encoder that he has to read, determine direction and increment/decrement 374k times per second.  I can see why he moved that part to hardware.

He didn't say it was a quadrature encoder. If its a simple 2048 pulses per revolution then use that to drive the clock input to a timer/counter module. A 16 bit timer/counter will overflow 5.7 times per second which should be easy to catch in an overflow interrupt to extend the precision to 32 bits or more.

What the single bit pulse counter is not going to do is detect the direction of rotation.

I'm a little concerned about 2048 pulses per revolution at 11,000 RPM. My question is, "Why? Are you trying to control each phase of the motor?"

--
David Kelly N4HHE, dkelly@HiWAAY.net
============================================================
Whom computers would destroy, they must first drive mad.

Re: [AVR-Chat] Re: fast controller

2012-08-23 by farshid alipour

Sorry I don’t understand “controlling each phase of the motor”
I try to make a system for positioning control with accuracy about 10µm so I have to read all the pulses (A and B) so I can’t use overflow .11000rpm is not necessary for a servo motor for controlling an axis it is too high but for a spindle motor it is common and in some cases the position of the spindle motor is important for example when someone wants to make thread in the pipe or masonry screws but it is not the main problem when I try to read the encoder and send command for servo drive the servo pass the position and then AVR move back the servo and it pass the position again and it happen repeatedly or in the other word the motor start to shaking in the purpose position. I think if the controller read the position faster and make the command signal sooner it’ll solve.



--- On Thu, 8/23/12, David Kelly <dkelly@hiwaay.net> wrote:
Show quoted textHide quoted text
From: David Kelly <dkelly@hiwaay.net>
Subject: Re: [AVR-Chat] Re: fast controller
To: AVR-Chat@yahoogroups.com
Date: Thursday, August 23, 2012, 2:39 AM
















 



  


    
      
      
      

On Aug 22, 2012, at 4:48 PM, Philippe Habib wrote:



> That's 184 RPS, but he said he has 2048 points per rotation.  I'm guessing a quadrature encoder that he has to read, determine direction and increment/decrement 374k times per second.  I can see why he moved that part to hardware.



He didn't say it was a quadrature encoder. If its a simple 2048 pulses per revolution then use that to drive the clock input to a timer/counter module. A 16 bit timer/counter will overflow 5.7 times per second which should be easy to catch in an overflow interrupt to extend the precision to 32 bits or more.



What the single bit pulse counter is not going to do is detect the direction of rotation.



I'm a little concerned about 2048 pulses per revolution at 11,000 RPM. My question is, "Why? Are you trying to control each phase of the motor?"



--

David Kelly N4HHE, dkelly@HiWAAY.net

============================================================

Whom computers would destroy, they must first drive mad.





    
     

    
    






  










[Non-text portions of this message have been removed]

voltage on an AVR pin when powered off

2012-08-23 by Steven Hodge

I have a question which has been bugging me for some time.  The data sheet for an AVR, under absolute maximum ratings, usually says something like “voltage on any pin…-0.5V to Vcc+0.5V”.   So what happens if there is no Vcc, i.e., there is no supply power applied to the AVR, but at the same time there happens to be Vcc on, say, a digital input pin or a UART RX line?  Does the chip handle it just fine w/o any supply voltage or does it smoke?

 

The same question can, of course, be asked of most any IC, and I’d be interested in the answer to this generalization as well.

 

Thanks, Steve



[Non-text portions of this message have been removed]

Re: [AVR-Chat] voltage on an AVR pin when powered off

2012-08-23 by Kasper Pedersen

On 08/23/2012 10:21 PM, Steven Hodge wrote:
>  
> 
> I have a question which has been bugging me for some time. The data
> sheet for an AVR, under absolute maximum ratings, usually says something
> like “voltage on any pin…-0.5V to Vcc+0.5V”. So what happens if there is
> no Vcc, i.e., there is no supply power applied to the AVR, but at the
> same time there happens to be Vcc on, say, a digital input pin or a UART
> RX line? Does the chip handle it just fine w/o any supply voltage or
> does it smoke?
> 
> The same question can, of course, be asked of most any IC, and I’d be
> interested in the answer to this generalization as well.
> 
> Thanks, Steve
> 

This is all about the protection diodes.
On the IO pins, there are FETs for sourcing and sinking. Each of these
FETs has, effectively, a diode in parallel. On input-only pins, there
are dedicated diodes.
When you apply a voltage greater than VCC to the pin, current will flow
in the diode from IO pin to VCC, raising VCC. If VCC is raised enough,
the mcu will happily run powered through the diode.
Like any diode, this diode has forward voltage and maximum current. If
you exceed 0,5V, while shorting VCC to 0V, it will draw a lot of
current. If you supply enough current, you kill the diode, the FET it is
part of, and the surrounding area on the die.
For AVR parts, the 'suggested safe current' is 1mA. So if you intend to
short VCC to GND only on the avr, put ~4.5k in the RXD line to limit the
current to 1mA.

The reset pin is different. There is no diode to VCC. If you feed in a
few mA, it does not end well.

Some logic series, such as NC7SZ32 as an example, are different. Instead
of using clamping diodes to VCC they use zeners to GND. Thus, regardless
of VCC to the part, the input may be as high as 6V. They are quite
useful for 5->3.3V translation.

/Kasper Pedersen

RE: [AVR-Chat] Re: fast controller

2012-08-23 by Cat C

You may need a PID algorithm to decelerate before it reaches your needed position.

----------------------------------------
Show quoted textHide quoted text
> To: AVR-Chat@yahoogroups.com
> From: farshid32001@yahoo.com
> Date: Thu, 23 Aug 2012 11:35:24 -0700
> Subject: Re: [AVR-Chat] Re: fast controller
>
> Sorry I don’t understand “controlling each phase of the motor”
> I try to make a system for positioning control with accuracy about 10µm so I have to read all the pulses (A and B) so I can’t use overflow .11000rpm is not necessary for a servo motor for controlling an axis it is too high but for a spindle motor it is common and in some cases the position of the spindle motor is important for example when someone wants to make thread in the pipe or masonry screws but it is not the main problem when I try to read the encoder and send command for servo drive the servo pass the position and then AVR move back the servo and it pass the position again and it happen repeatedly or in the other word the motor start to shaking in the purpose position. I think if the controller read the position faster and make the command signal sooner it’ll solve.
>
>
>
> --- On Thu, 8/23/12, David Kelly <dkelly@hiwaay.net> wrote:
>
> From: David Kelly <dkelly@hiwaay.net>
> Subject: Re: [AVR-Chat] Re: fast controller
> To: AVR-Chat@yahoogroups.com
> Date: Thursday, August 23, 2012, 2:39 AM
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Aug 22, 2012, at 4:48 PM, Philippe Habib wrote:
>
>
>
> > That's 184 RPS, but he said he has 2048 points per rotation. I'm guessing a quadrature encoder that he has to read, determine direction and increment/decrement 374k times per second. I can see why he moved that part to hardware.
>
>
>
> He didn't say it was a quadrature encoder. If its a simple 2048 pulses per revolution then use that to drive the clock input to a timer/counter module. A 16 bit timer/counter will overflow 5.7 times per second which should be easy to catch in an overflow interrupt to extend the precision to 32 bits or more.
>
>
>
> What the single bit pulse counter is not going to do is detect the direction of rotation.
>
>
>
> I'm a little concerned about 2048 pulses per revolution at 11,000 RPM. My question is, "Why? Are you trying to control each phase of the motor?"
>
>
>
> --
>
> David Kelly N4HHE, dkelly@HiWAAY.net
>
> ============================================================
>
> Whom computers would destroy, they must first drive mad.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

Re: [AVR-Chat] Re: fast controller

2012-08-23 by Philippe Habib

Your talking about all the pulses (A and B) makes me think you may be reading quadrature scales.  There are micros, such as the Rabbits or the Xmegas that have quadrature decoding built into the hardware.  200k pulses per second using the micro's built in quadrature decoding HW should be very easy.

I agree with the other poster that you may want a PID, or at least a accel/deccel curve of some sort for your motors to avoid overshooting and chattering as the speed increases.
Show quoted textHide quoted text
----- Original Message -----
From: "farshid alipour" <farshid32001@yahoo.com>
To: AVR-Chat@yahoogroups.com
Sent: Thursday, August 23, 2012 11:35:24 AM
Subject: Re: [AVR-Chat] Re: fast controller

Sorry I don’t understand “controlling each phase of the motor”
I try to make a system for positioning control with accuracy about 10µm so I have to read all the pulses (A and B) so I can’t use overflow .11000rpm is not necessary for a servo motor for controlling an axis it is too high but for a spindle motor it is common and in some cases the position of the spindle motor is important for example when someone wants to make thread in the pipe or masonry screws but it is not the main problem when I try to read the encoder and send command for servo drive the servo pass the position and then AVR move back the servo and it pass the position again and it happen repeatedly or in the other word the motor start to shaking in the purpose position. I think if the controller read the position faster and make the command signal sooner it’ll solve.



--- On Thu, 8/23/12, David Kelly <dkelly@hiwaay.net> wrote:

From: David Kelly <dkelly@hiwaay.net>
Subject: Re: [AVR-Chat] Re: fast controller
To: AVR-Chat@yahoogroups.com
Date: Thursday, August 23, 2012, 2:39 AM
















 



  


    
      
      
      

On Aug 22, 2012, at 4:48 PM, Philippe Habib wrote:



> That's 184 RPS, but he said he has 2048 points per rotation.  I'm guessing a quadrature encoder that he has to read, determine direction and increment/decrement 374k times per second.  I can see why he moved that part to hardware.



He didn't say it was a quadrature encoder. If its a simple 2048 pulses per revolution then use that to drive the clock input to a timer/counter module. A 16 bit timer/counter will overflow 5.7 times per second which should be easy to catch in an overflow interrupt to extend the precision to 32 bits or more.



What the single bit pulse counter is not going to do is detect the direction of rotation.



I'm a little concerned about 2048 pulses per revolution at 11,000 RPM. My question is, "Why? Are you trying to control each phase of the motor?"



--

David Kelly N4HHE, dkelly@HiWAAY.net

============================================================

Whom computers would destroy, they must first drive mad.





    
     

    
    






  










[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

Re: [AVR-Chat] voltage on an AVR pin when powered off

2012-08-23 by John Samperi

At 06:21 AM 24/08/2012, you wrote:
>So what happens if there is no Vcc, i.e., there is no supply power 
>applied to the AVR,
>but at the same time there happens to be Vcc on, say, a digital 
>input pin or a UART RX line?

The chip will try and draw power from that line. It's VCC (and the 
boards' VCC) will be the
voltage present at the pin less 0.5V.

So it is never a good idea to have power on pins of a chip which is off.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

RE: [AVR-Chat] voltage on an AVR pin when powered off

2012-08-24 by Steven Hodge

So the chip can actually be powered on, eh?  That explains a few mysterious
things.   Thanks, Steve
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of John Samperi
Sent: Thursday, August 23, 2012 2:30 PM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] voltage on an AVR pin when powered off

 

  

At 06:21 AM 24/08/2012, you wrote:
>So what happens if there is no Vcc, i.e., there is no supply power 
>applied to the AVR,
>but at the same time there happens to be Vcc on, say, a digital 
>input pin or a UART RX line?

The chip will try and draw power from that line. It's VCC (and the 
boards' VCC) will be the
voltage present at the pin less 0.5V.

So it is never a good idea to have power on pins of a chip which is off.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495
Website http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************





[Non-text portions of this message have been removed]

Re: [AVR-Chat] voltage on an AVR pin when powered off

2012-08-24 by Clark Martin

On Aug 23, 2012, at 7:45 PM, Steven Hodge wrote:

> So the chip can actually be powered on, eh? That explains a few  
> mysterious
> things. Thanks, Steve

Generally you can protect the chip and related circuitry by putting a  
resistor between the pin and power supplying circuitry.  On inputs  
this is usually pretty easy.  It gets more complicated with outputs

The parasitic diodes can be used to deal with external inputs that  
exceed 0-Vcc.  You put a series resistor (Rh) between the input pin  
and the higher voltage and another resistor (Rl) from the input pin to  
ground.  You size them so that with maximum input voltage the voltage  
at the pin will be about Vcc.  Rh should be high enough so that any  
current that does flow into the pin and the parasitic diode is well  
below the limit for the diode.

I use this method along with a 74LVC1G14 (a SMD single inverter  
version of the 74HC14 Hex Schmidt trigger) as an RS-232 receiver.   
That and another 74LVC1G14 as output inverter and it takes care of the  
serial interface.
Show quoted textHide quoted text
>
> From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On  
> Behalf
> Of John Samperi
> Sent: Thursday, August 23, 2012 2:30 PM
> To: AVR-Chat@yahoogroups.com
> Subject: Re: [AVR-Chat] voltage on an AVR pin when powered off
>
> At 06:21 AM 24/08/2012, you wrote:
> >So what happens if there is no Vcc, i.e., there is no supply power
> >applied to the AVR,
> >but at the same time there happens to be Vcc on, say, a digital
> >input pin or a UART RX line?
>
> The chip will try and draw power from that line. It's VCC (and the
> boards' VCC) will be the
> voltage present at the pin less 0.5V.
>
> So it is never a good idea to have power on pins of a chip which is  
> off.

RE: [AVR-Chat] voltage on an AVR pin when powered off

2012-08-24 by Steven Hodge

So, what if GND as well as Vcc to the chip are both turned off, i.e., all uC
power pins are isolated, but now from some other source a voltage is applied
to an I/O pin (but is floating with respect to the uC)?  Would that in and
of itself be better than if GND were still connected?  Steve
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of John Samperi
Sent: Thursday, August 23, 2012 2:30 PM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] voltage on an AVR pin when powered off

 

  

At 06:21 AM 24/08/2012, you wrote:
>So what happens if there is no Vcc, i.e., there is no supply power 
>applied to the AVR,
>but at the same time there happens to be Vcc on, say, a digital 
>input pin or a UART RX line?

The chip will try and draw power from that line. It's VCC (and the 
boards' VCC) will be the
voltage present at the pin less 0.5V.

So it is never a good idea to have power on pins of a chip which is off.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495
Website http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************





[Non-text portions of this message have been removed]

RE: [AVR-Chat] voltage on an AVR pin when powered off

2012-08-24 by Cat C

You put it in a funny way, but sure it's better :-)

It's (almost) like when people touch 400KV power lines and nothing bad happens because they are insulated from ground (it's actually a little more complicated but not far).

Cat

----------------------------------------
Show quoted textHide quoted text
> To: AVR-Chat@yahoogroups.com
> From: steve@terrafirma.us
> Date: Fri, 24 Aug 2012 07:32:36 -0700
> Subject: RE: [AVR-Chat] voltage on an AVR pin when powered off
>
> So, what if GND as well as Vcc to the chip are both turned off, i.e., all uC
> power pins are isolated, but now from some other source a voltage is applied
> to an I/O pin (but is floating with respect to the uC)? Would that in and
> of itself be better than if GND were still connected? Steve
>
>
>

RE: [AVR-Chat] voltage on an AVR pin when powered off

2012-08-24 by John Samperi

At 12:32 AM 25/08/2012, you wrote:
>So, what if GND as well as Vcc to the chip are both turned off,

..and what about the rest of the pins? Draw a box with as many
I/O pins as the chip you are using has. Then draw 2 diodes, one to
the ground pin and one to the VCC pin just like they show in the
datasheet.

Then you can follow the current paths in and out of the chip.


Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: [AVR-Chat] voltage on an AVR pin when powered off

2012-08-24 by Philippe Habib

I once had a situation where I did not get a predictable POR because of the various paths from connected pins.  Of course, you can't always avoid all of those.
Show quoted textHide quoted text
----- Original Message -----
From: "John Samperi" <samperi@ampertronics.com.au>
To: AVR-Chat@yahoogroups.com
Sent: Friday, August 24, 2012 2:27:17 PM
Subject: RE: [AVR-Chat] voltage on an AVR pin when powered off

At 12:32 AM 25/08/2012, you wrote:
>So, what if GND as well as Vcc to the chip are both turned off,

..and what about the rest of the pins? Draw a box with as many
I/O pins as the chip you are using has. Then draw 2 diodes, one to
the ground pin and one to the VCC pin just like they show in the
datasheet.

Then you can follow the current paths in and out of the chip.


Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************



------------------------------------

Yahoo! Groups Links

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.