Yahoo Groups archive

AVR-Chat

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

Thread

Alternative to using ICP for decoding PWM

Alternative to using ICP for decoding PWM

2004-03-14 by Adam Bradley

Not 100% sure but it looks like using ICP on the Butterfly is out, 
whats a useful alternative for decoding PWM? External Interrupt pin? 

I hope I'm answering my own question correctly - would designating a 
pin as an external interrupt be appropriate? 

From datasheet from ATMEGA169. Given - 
"The INT0 interrupts can be triggered by a falling or rising edge or 
a low level. This is set up as indicated in the specification for the 
External Interrupt Control Register A – EICRA. When the INT0 
interrupt is enabled and is configured as level triggered, the 
interrupt will trigger as long as the pin is held low." 

This doesn't look a whole lot different to using ICP? 
Anyone? 

Thanks in advance, 
Adam

RE: [AVR-Chat] Alternative to using ICP for decoding PWM

2004-03-14 by Larry Barello

I have used INT0, INT1, ICP and the Analog Comparator for decoding four
channels of PWM at the same time (each one has selectable positive and
negative edge triggers).  If you use the analog comparator, of course, you
need to set the other half to vcc/2 so it takes two pins...

You can see the project here: www.barello.net/uRRC20

cheers!
Show quoted textHide quoted text
-----Original Message-----
From: Adam Bradley

Not 100% sure but it looks like using ICP on the Butterfly is out,
whats a useful alternative for decoding PWM? External Interrupt pin?

I hope I'm answering my own question correctly - would designating a
pin as an external interrupt be appropriate?

>From datasheet from ATMEGA169. Given -
"The INT0 interrupts can be triggered by a falling or rising edge or
a low level. This is set up as indicated in the specification for the
External Interrupt Control Register A – EICRA. When the INT0
interrupt is enabled and is configured as level triggered, the
interrupt will trigger as long as the pin is held low."

This doesn't look a whole lot different to using ICP?
Anyone?

Thanks in advance,
Adam

Re: Alternative to using ICP for decoding PWM

2004-03-14 by Adam Bradley

Larry,

Thanks for your feedback on this.  One comment, I've never seen C 
look so much like assembly :)

Adam

--- In AVR-Chat@yahoogroups.com, "Larry Barello" <yahoo@b...> wrote:
> I have used INT0, INT1, ICP and the Analog Comparator for decoding 
four
> channels of PWM at the same time (each one has selectable positive 
and
> negative edge triggers).  If you use the analog comparator, of 
course, you
> need to set the other half to vcc/2 so it takes two pins...
> 
> You can see the project here: www.barello.net/uRRC20
> 
> cheers!
> 
> -----Original Message-----
> From: Adam Bradley
> 
> Not 100% sure but it looks like using ICP on the Butterfly is out,
> whats a useful alternative for decoding PWM? External Interrupt pin?
> 
> I hope I'm answering my own question correctly - would designating a
> pin as an external interrupt be appropriate?
> 
> >From datasheet from ATMEGA169. Given -
> "The INT0 interrupts can be triggered by a falling or rising edge or
> a low level. This is set up as indicated in the specification for 
the
Show quoted textHide quoted text
> External Interrupt Control Register A – EICRA. When the INT0
> interrupt is enabled and is configured as level triggered, the
> interrupt will trigger as long as the pin is held low."
> 
> This doesn't look a whole lot different to using ICP?
> Anyone?
> 
> Thanks in advance,
> Adam

RE: [AVR-Chat] Re: Alternative to using ICP for decoding PWM

2004-03-14 by Kathy Quinlan

> -----Original Message-----
> From: Adam Bradley [mailto:adam_j_bradley@yahoo.com] 
> Sent: Sunday, 14 March 2004 4:49 PM
> To: AVR-Chat@yahoogroups.com
> Subject: [AVR-Chat] Re: Alternative to using ICP for decoding PWM
> 
> 
> Larry,
> 
> Thanks for your feedback on this.  One comment, I've never seen C 
> look so much like assembly :)
> 
> Adam

My ASM looks like that too ;o) I prefer to write in modules and have
lots of include files. My Main routine is just flag checking, branches
and calls :o)

I do not like C as it is too loose, I love to know what the state of the
uC is every step of the way, plus a lot of my projects are tight on
space and time ;o)

But I am being forced to use C :o( Atmel does not provide ASM files for
their USB chips just C (bloody Atmel)

Regards,

Kat.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.618 / Virus Database: 397 - Release Date: 9/03/2004

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.