|
|
| Author |
Message |
FFMan
Joined: 09 Jan 2010
Posts: 217
|
|
Posted: 28 January 2010, 21:14 PM Post subject: Processing a 38khz IR signal - how much cpu is left ? |
|
|
I made a project a while ago using a BX24 to make a race laptimer for use in a race car. This detects a coded IR signal from the pit wall on each lap and displays the lap time etc in the car. This project had 2 parts, the BX24 to do the timing and control the display and user buttons, and a parallax SX processor to front end the IR decoding with a simple signal to the bx24 when the correct beacon was detected.
Now i'm a zx24 convert, i was planning a new version using a zx24. I wondered with the zx24s superior speed whether I could decode the 38khz signal and still have enough cpu cycles in between pulses to control the display of the lap time and race duration.
Is this achievable or will I still need a front end processor ? |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2493
Location: Portland, OR
|
|
Posted: 28 January 2010, 23:37 PM Post subject: Re: Processing a 38khz IR signal - how much cpu is left ? |
|
|
| FFMan wrote: | | I wondered with the zx24s superior speed whether I could decode the 38khz signal and still have enough cpu cycles in between pulses to control the display of the lap time and race duration. | The ZX-24a is a bit more than twice as fast as a BX-24P so, depending on how you implement it, it can probably be done. There is an application note on IR decoding - see Input Capture and Multi-tasking for IR Remote Controls.
If it is tight, you might consider moving to a ZX-24n which is nearly 40x the speed of a BX-24P. |
|
| Back to top |
|
 |
dlh
Joined: 15 Dec 2006
Posts: 265
Location: ~Cincinnati
|
|
Posted: 29 January 2010, 1:14 AM Post subject: |
|
|
Having done similar things (but with RF), I recommend using an n and interrupts. I would post my code but I lost it when a network HDD went south on me wiping out more than 2 months work.
The IR protocol will influence how much time you have. |
|
| Back to top |
|
 |
stevech
Joined: 23 Feb 2006
Posts: 656
|
|
Posted: 29 January 2010, 20:16 PM Post subject: Re: Processing a 38khz IR signal - how much cpu is left ? |
|
|
| FFMan wrote: | I wondered with the zx24s superior speed whether I could decode the 38khz signal and still have enough cpu cycles in between pulses to control the display of the lap time and race duration.
Is this achievable or will I still need a front end processor ? |
You're using an IR receiver module, right? One that has a bandpass filter/amp for 38KHz, and who's output is the bit rate, say, 800bps.
So this isn't much of a CPU load at all. |
|
| Back to top |
|
 |
FFMan
Joined: 09 Jan 2010
Posts: 217
|
|
Posted: 29 January 2010, 21:10 PM Post subject: |
|
|
yes i'll use a Vishay ir module, so of course you are right. The three pulses which are the signature of this beam come over a duration of 4.65ms which in zx24 terms is an age considering not much code needs to run in the interim.
thanks |
|
| Back to top |
|
 |
stevech
Joined: 23 Feb 2006
Posts: 656
|
|
Posted: 30 January 2010, 20:06 PM Post subject: |
|
|
| You can use, as a model/starting point for IR decode/encode, some of the projects on AVRfreaks.net's Projects section. One there is TWIRP. |
|
| Back to top |
|
 |
mikep
Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX
|
|
Posted: 30 January 2010, 20:56 PM Post subject: |
|
|
| FFMan wrote: | | The three pulses which are the signature of this beam come over a duration of 4.65ms which in zx24 terms is an age considering not much code needs to run in the interim. | Particularly if you make use of the multi-tasking in ZBasic then you can let the AVR timer do its thing while still doing other processing - see the application note that Don referred to. |
|
| Back to top |
|
 |
|