avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] infra remote


From: David Kelly
Subject: Re: [avr-gcc-list] infra remote
Date: Tue, 14 Nov 2006 20:07:38 -0600

On Tue, Nov 14, 2006 at 09:17:29PM +0100, Bohus Tam?s wrote:
Hi!

I'm a newbie in avr-gcc. I would like to build an automatic gate
opener, with remote controller. The remote comunicates with the
central controller on infra, with 36, or 38 kHz modulation.

infra == infrared, I presume.

This is to be operated outside? IR doesn't work very well under those
conditions.

Have anybody a complete infra transmitter, and reciever for this
project in gcc. And can somebody tell me about timing in gcc, cause i
don't know the time of each instruction like in asm, and i don't know
how to do it.

One of the reasons C code is desired and supportable is for exactly the
opposite direction you are headed. If one has to know how long a C
instruction takes to execute then the problem is factored incorrectly.

Pls.  anybody help me, with some usable code.  (The central controller
is an Atmega32, the remote controller will be an Attiny 15, or 2313.)

This sounds like a class assignment. Unless you have reason to suspect
you will be building thousands, use the ATmega32 on both ends. Will make
your task much easier and if someone comes along throwing money at you
then the smell of money will make it easy to revise the CPU selections
for optimal cost. Easier in fact, because by that time you will know how
much of the CPU you need.

Spend a lot of time reading Atmel's datasheets before coding. Print the
darn things and make lots of notes in the margins while reading. Small
Post-It(tm) Notes are great for this task. Concentrate on the timer
module chapters. I think you will want to configure a hardware timer to
toggle an output pin each time the timer overflows, then self-reset the
timer and do it all over again. Once the timer is configured it will run
forever without further attention from the CPU or your code. Set this
timer for half of a 38 kHz period and you have your basic TX carrier.

Then use another timer to measure when the carrier timer should be
turned on or off to form your IR codes. Then again I suppose there are
IR TX modules which provide the base carrier frequency internally. IR
RX modules usually specify a carrier frequency and might do the
detection and carrier removal internally. Haven't looked in a long time.

Reception is much more difficult.

--
David Kelly N4HHE, address@hidden
========================================================================
Whom computers would destroy, they must first drive mad.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]