[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-chat] will an avr be fast enough...
From: |
Alan Kilian |
Subject: |
RE: [avr-chat] will an avr be fast enough... |
Date: |
Fri, 03 Jun 2005 10:48:47 -0500 |
> I mean, can you possibly fit 16 channels worth of 10bit ADC data
> down a 38khz IR pipe???
You can fit 16 channels of 10-bit data down any sized data-stream
you want. You will need to choose the rate at which you sample the
data to match the maximum transmission-rate of the data stream.
So, let's be generous and say that a 38 KHz IR link can transmit
2,000 bits-per-second. It probably can't, but let's go with it
for now. (The data sheet for this product shows an 800 bit-per-
second data stream which is much more reasonable.)
http://www.hvwtech.com/pages/products_view.asp?ProductID=166
So, if you have 2,000 bits-per-second, and a data packet of
10 bits, you can transmit 2000/10 = 200 samples-per-second.
(I'm ignoring that you will need some headers and some inter-
sample start and stop bits, but we are just making an estimate
right now, so I think it's OK to do that)
Now, if we look at the original poster's information:
> 16-channel 10-bit A2D ... data out via an infrared link.
> The max SPI clock of the MAX1031 is 10mhz
> I need a sampling rate of around 20khz/channel.
We can start at "20 KHz per channel" and multiply by (let's say)
15 bits-per-channel to be reasonable, so we need to read the A/D
converter at 20,000 * 15 = 300,000 bits-per-second which is WELL
under the maximum SPI clock of 10 MHz, so that's just fine.
Now, what exactly does "20khz/channel" mean? Maybe it means EACH
of the 16 channels needs to be samples at 20 KHz. That means we need
to multiply our 300,000 bits-per-second by 16 channels to get
4,800,000 bits-per-second which is still well under the maximum
SPI clock for the A/D converter.
(Note that this is grossly greater than the 2,000 bits-per-second
that we optimistically estimated was possible with w 38 KHz IR link)
So, can any AVR set its SPI clock at 4.8 MegaHertz? If I look at the
data sheet for the Mega48/88/168, I see that the maximum SPI clock
in master-mode is the crystal divided-by 2, and the maximum crystal
frequency is 20 MHz, so we can indeed generate a 4.8 MHz SPI clock.
Last but not least, "data out via an infrared link". We saw that a
38 KHz IR link is not going to work, so how about IRDA?
I went to digikey.com and searched for IRDA and found that
microchip.com makes IRDA control ICs, so I looked there. I quickly
found an application note "Selecting an MCP21XX Device for IrDA®
Applications"
http://www.microchip.com/stellent/idcplg?
IdcService=SS_GET_PAGE&nodeId=1824&appnote=en012109
It says:
The IrDA standard SIR specification has a maximum
baud rate of 115.2 Kbaud. If both ends of the system
are controlled by the developer, this specification can
be ignored. The MCP2120 allows a maximum baud
rate of 312.5 Kbaud (although some work may need to
be done with the optical transceiver), while the
MCP2122 has a maximum of 115.2 Kbaud.
So it looks like standard IRDA can't even come close to 4.8 megabits
per second.
That's it for me.
Can anyone else come up with an IR transmission scheme that will
work?
-Alan
--
- Alan Kilian <kilian(at)bobodyne.com>
- [avr-chat] will an avr be fast enough..., Reza Naima, 2005/06/02
- RE: [avr-chat] will an avr be fast enough..., Robert Dunn, 2005/06/02
- RE: [avr-chat] will an avr be fast enough..., Derric Tubbs, 2005/06/03
- RE: [avr-chat] will an avr be fast enough...,
Alan Kilian <=
- Re: [avr-chat] will an avr be fast enough..., Richard Urwin, 2005/06/03
- Re: [avr-chat] will an avr be fast enough..., Bob Paddock, 2005/06/03
- Re: [avr-chat] will an avr be fast enough..., Matthew MacClary, 2005/06/03
- Re: [avr-chat] will an avr be fast enough..., Reza Naima, 2005/06/04
- Re: [avr-chat] will an avr be fast enough..., Galen Seitz, 2005/06/05
- Re: [avr-chat] will an avr be fast enough..., Curtis Maloney, 2005/06/05