Yahoo Groups archive

AVR-Chat

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

Thread

Help with Attiny project

Help with Attiny project

2006-09-12 by Richard Cooke

Hi Folks,

I'm just starting this project where I'd like to use an ATtiny13 (for
cost and size reasons) to monitor an IR receiver chip.  When the
processor sees three pulses it will energize a relay.

I'll just have it sit in a loop waiting for the first pulse.  The 1st
pulse is 2000us then no pulses for 27800us, another pulse of 400us, no
pulse for 1500us then one more pulse of 400us.

I just have to detect the pulses (no data is being transmitted) so
does it look like I can use the internal osc?  This app will normally
be used at a temp of 10C to 30C.  I don't want to re-invent the wheel
so if anybody has any ideas where to start I'd appreciate it.

I've come up with two ways to attack this.  First would be to setup
the timer and actually time the pulses and second would be to just
sample the input and the midpoint of the pulses and gaps to verify
that they occurred.  Since there will only be these 3 pulses with
these timings this should simplfy matters.

What do you think?

Thanks,

Richard Cooke
Lake Forest, CA

Re: Help with Attiny project

2006-09-12 by Richard Cooke

Thanks for the info.  I've looked at the ATtiny13 datasheet and I'm a
bit confused on how you'd connect an external crystal.  On the
Attiny11 and 12 you sacrifice 2 pins to use the crystal (PB3 & PB4). 
How does that connect to the '13?  I haven't used a ceramic resonator
before - can I just connect it to PB3?  Does it require any additional
components?  Sorry all of the bacic questions but it's been awhile
since I've done work on such small parts.

Thanks,

Richard

--- In AVR-Chat@yahoogroups.com, "David VanHorn" <microbrix@...> wrote:
>
> The internal timer isn't that accurate over temperature.
> 
> You might be able to get away with something like this:
> 
> Sit in a loop, waiting for something.
> Pulse detected.
> Wait about 3/4 of the delay, a pulse in here fails.
> Wait about 1/2 the delay, no-pulse in here fails.
> Resync on each detected pulse, and then be pretty tolerant about
when pulses
Show quoted textHide quoted text
> can come in.
> 
> Otherwise, a resonator or crystal is a better bet.
> 
> 
> [Non-text portions of this message have been removed]
>

Re: [AVR-Chat] Help with Attiny project

2006-09-12 by David VanHorn

The internal timer isn't that accurate over temperature.

You might be able to get away with something like this:

Sit in a loop, waiting for something.
Pulse detected.
Wait about 3/4 of the delay, a pulse in here fails.
Wait about 1/2 the delay, no-pulse in here fails.
Resync on each detected pulse, and then be pretty tolerant about when pulses
can come in.

Otherwise, a resonator or crystal is a better bet.


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

[QUARANTINE] [AVR-Chat] Re: Help with Attiny project

2006-09-12 by Richard Cooke

Thanks Larry.  That's a good idea and as soon as Jameco coughs up my
'13 chips I give that a try.


--- In AVR-Chat@yahoogroups.com, "Larry Barello" <yahoo@...> wrote:
>
> Look for ceramic resonators with built in capacitors (three terminal
> devices) at digikey.  They work pretty well.
> 
> It seems with a little thought that the pulses could be
discriminated using
> the internal oscillator.  Use the first pulse to "calibrate" the
clock with
> upper and lower bounds for "valid" and then use the calibrated values to
> measure the remaining pulse on/off periods.  The internal oscillator
will be
> extremely stable over a couple second period.  
>

Re: Help with Attiny project

2006-09-12 by Richard Cooke

Hi Mark,

So basically I would start the timer when the first pulse comes in
stop it when it goes low.  That will give me a rough idea how many
timer "ticks" elasped for the first 2000us pulse.  I then use that
value for the rest of the pulses.  

I'm not familar with RC5 but I'm happy to hear it can be done with an
Tiny11.  I like the cost of that chip but my assembly is pretty rusty
and I can use C on the Tiny13 for not too much more money.

Thanks,

Richard
--- In AVR-Chat@yahoogroups.com, "Mark Jordan" <enki@...> wrote:
>
> 
> 	I have used that approach to decode RC5 frames from an IR receiver 
> on a Tiny11 running with the 1.2MHz internal oscillator.
> 	Worked 100%.
> 
> 	Mark Jordan
> 
> 
> On 12 Sep 2006 at 15:59, Larry Barello wrote:
> 
> > Look for ceramic resonators with built in capacitors (three terminal
> > devices) at digikey.  They work pretty well.
> > 
> > It seems with a little thought that the pulses could be
discriminated using
> > the internal oscillator.  Use the first pulse to "calibrate" the
clock with
> > upper and lower bounds for "valid" and then use the calibrated
values to
> > measure the remaining pulse on/off periods.  The internal
oscillator will be
Show quoted textHide quoted text
> > extremely stable over a couple second period.  
> > 
> >

RE: [QUARANTINE] [AVR-Chat] Re: Help with Attiny project

2006-09-12 by Larry Barello

Look for ceramic resonators with built in capacitors (three terminal
devices) at digikey.  They work pretty well.

It seems with a little thought that the pulses could be discriminated using
the internal oscillator.  Use the first pulse to "calibrate" the clock with
upper and lower bounds for "valid" and then use the calibrated values to
measure the remaining pulse on/off periods.  The internal oscillator will be
extremely stable over a couple second period.  


| -----Original Message-----
| From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
| Of Richard Cooke
| Sent: Tuesday, September 12, 2006 1:46 PM
| To: AVR-Chat@yahoogroups.com
| Subject: [QUARANTINE] [AVR-Chat] Re: Help with Attiny project
| Importance: Low
| 
| Thanks for the info.  I've looked at the ATtiny13 datasheet and I'm a
| bit confused on how you'd connect an external crystal.  On the
| Attiny11 and 12 you sacrifice 2 pins to use the crystal (PB3 & PB4).
| How does that connect to the '13?  I haven't used a ceramic resonator
| before - can I just connect it to PB3?  Does it require any additional
| components?  Sorry all of the bacic questions but it's been awhile
| since I've done work on such small parts.
| 
| Thanks,
| 
| Richard
| 
| --- In AVR-Chat@yahoogroups.com, "David VanHorn" <microbrix@...> wrote:
| >
| > The internal timer isn't that accurate over temperature.
| >
| > You might be able to get away with something like this:
| >
| > Sit in a loop, waiting for something.
| > Pulse detected.
| > Wait about 3/4 of the delay, a pulse in here fails.
| > Wait about 1/2 the delay, no-pulse in here fails.
| > Resync on each detected pulse, and then be pretty tolerant about
| when pulses
| > can come in.
| >
| > Otherwise, a resonator or crystal is a better bet.
| >
| >
| > [Non-text portions of this message have been removed]
| >
| 
| 
| 
| 
| 
| 
| 
| Yahoo! Groups Links
| 
| 
| 
| 
| 
| 
| 
| 
|

Re: Help with Attiny project

2006-09-12 by Mark Jordan

I have used that approach to decode RC5 frames from an IR receiver 
on a Tiny11 running with the 1.2MHz internal oscillator.
	Worked 100%.

	Mark Jordan
Show quoted textHide quoted text
On 12 Sep 2006 at 15:59, Larry Barello wrote:

> Look for ceramic resonators with built in capacitors (three terminal
> devices) at digikey.  They work pretty well.
> 
> It seems with a little thought that the pulses could be discriminated using
> the internal oscillator.  Use the first pulse to "calibrate" the clock with
> upper and lower bounds for "valid" and then use the calibrated values to
> measure the remaining pulse on/off periods.  The internal oscillator will be
> extremely stable over a couple second period.  
> 
> 
> | -----Original Message-----
> | From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
> | Of Richard Cooke
> | Sent: Tuesday, September 12, 2006 1:46 PM
> | To: AVR-Chat@yahoogroups.com
> | Subject: [QUARANTINE] [AVR-Chat] Re: Help with Attiny project
> | Importance: Low
> | 
> | Thanks for the info.  I've looked at the ATtiny13 datasheet and I'm a
> | bit confused on how you'd connect an external crystal.  On the
> | Attiny11 and 12 you sacrifice 2 pins to use the crystal (PB3 & PB4).
> | How does that connect to the '13?  I haven't used a ceramic resonator
> | before - can I just connect it to PB3?  Does it require any additional
> | components?  Sorry all of the bacic questions but it's been awhile
> | since I've done work on such small parts.
> | 
> | Thanks,
> | 
> | Richard
> | 
> | --- In AVR-Chat@yahoogroups.com, "David VanHorn" <microbrix@...> wrote:
> | >
> | > The internal timer isn't that accurate over temperature.
> | >
> | > You might be able to get away with something like this:
> | >
> | > Sit in a loop, waiting for something.
> | > Pulse detected.
> | > Wait about 3/4 of the delay, a pulse in here fails.
> | > Wait about 1/2 the delay, no-pulse in here fails.
> | > Resync on each detected pulse, and then be pretty tolerant about
> | when pulses
> | > can come in.
> | >
> | > Otherwise, a resonator or crystal is a better bet.
> | >
> | >
> | > [Non-text portions of this message have been removed]
> | >
> | 
> | 
> | 
> | 
> | 
> | 
> | 
> | Yahoo! Groups Links
> | 
> | 
> | 
> | 
> | 
> | 
> | 
> | 
> | 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 
> 
> 
>

Re: [AVR-Chat] Re: Help with Attiny project

2006-09-12 by Don AE5K

Richard Cooke wrote:
> Thanks for the info.  I've looked at the ATtiny13 datasheet and I'm a
> bit confused on how you'd connect an external crystal.  On the
> Attiny11 and 12 you sacrifice 2 pins to use the crystal (PB3 & PB4). 
> How does that connect to the '13?  I haven't used a ceramic resonator
> before - can I just connect it to PB3?  Does it require any additional
> components?  Sorry all of the bacic questions but it's been awhile
> since I've done work on such small parts.
> 
> Thanks,
> 
> Richard

Unless I'm terribly misguided, the tiny13 cannot use external resonator
or xtal.  Someone correct me if wrong.

Don

Re: Help with Attiny project

2006-09-12 by kernels_nz

Hi Guys,

The Tiny13 cannot use an external crystal or ceramic resonator. The
only way of getting an accurate clock is an external oscillator into
the CLKI pin. This would require building a oscillator around a
crystal. It really looks like the better long run option would be to
either use the internal oscillator and only examine parts of the
incoming IR signal as previously suggested or upgrade to a chip that
has a built in oscillator that a crystal or ceramic resonator can be
fitted to.

Cheers
Hein B
Auckland, New Zealand.

--- In AVR-Chat@yahoogroups.com, "Richard Cooke" <rcooke@...> wrote:
Show quoted textHide quoted text
>
> Hi Folks,
> 
> I'm just starting this project where I'd like to use an ATtiny13 (for
> cost and size reasons) to monitor an IR receiver chip.  When the
> processor sees three pulses it will energize a relay.
> 
> I'll just have it sit in a loop waiting for the first pulse.  The 1st
> pulse is 2000us then no pulses for 27800us, another pulse of 400us, no
> pulse for 1500us then one more pulse of 400us.
> 
> I just have to detect the pulses (no data is being transmitted) so
> does it look like I can use the internal osc?  This app will normally
> be used at a temp of 10C to 30C.  I don't want to re-invent the wheel
> so if anybody has any ideas where to start I'd appreciate it.
> 
> I've come up with two ways to attack this.  First would be to setup
> the timer and actually time the pulses and second would be to just
> sample the input and the midpoint of the pulses and gaps to verify
> that they occurred.  Since there will only be these 3 pulses with
> these timings this should simplfy matters.
> 
> What do you think?
> 
> Thanks,
> 
> Richard Cooke
> Lake Forest, CA
>

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.