Re: TI-H: More AVR Qs


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

Re: TI-H: More AVR Qs




From: Grant Stockly <gussie@stockly.com>
> >Would the internal RC clock get me that kind of accuracy (withing a
couple
> >of seconds a month)?
>
> If you keep the temperature of the AVR THE SAME.

Hmm, that could be a problem.  Constant temp would be difficult.  I'll just
forget
about the internal timer and use a crystal.

> >For my timing project I'll be measuring durations of around 25 seconds,
with
> >precision of better than 1 millisecond.  I figure I'll run that one at 12
> >Mhz. Does this sound like a reasonable goal?
>
> What kind of logging do you need?  Analog?  it takes about 39 instructions
> to use the SAR method (fastest).  That would mean you would need at least
a
> 500kHz clock (saves power and gives you a little processing power)

No, in this case it will be digital.  Specificly I have two
phototransistors, one sensing ambiant light, one sensing ambiant + the light
from a 2-5mW laser pointer at about 15M.  The ambiant light sensor is
bypassed with a resister, output of the sensors is fed into a comparator,
the output of which will be read by the AVR.

This gives me 4 parts for the sensors, two phototransistors, a quad
comparator and a resistor.
Since the 1200 has an onboard analog comparator, and my phototransistors
pass 20 mA at saturation, would it work to connect the emiters of the
phototransistors to the 1200's comparator input, and the collectors to one
or more port B or D pins?  The docs say that those pins can source some
current, but not how much.
This would eliminate the need for the external comparator chip.

> >>Use a Mega103L if you need 4k.
> >
> >Cost and size are important factors here, I'm using the SOIC version of
the
> >AT90S1200, the Mega versions are both too big and too expensive.
>
> $10 too expensive?

Its an unnecessary cost if the $2 1200 can handle the same task.  The Mega
in addition to cost, size is a factor, the mega is significantly larger than
the 1200.

> You can put SRAM on a 1200 though it only has a 3 layer stack.

How do you communicate with an SRAM chip?

> >For my data logging application it would typicaly be cleared every month
or
> >every week at the most, so that won't really be a problem.  The timer
> >project won't need any memory for data storage (results will be sent
> >directly to a computer via serial port).
>
> EEPROM would work fine as long as you don't need it to run for 8,333 years
> error free.  :)

Thats what I figured :)  Would I be correct in assuming that SRAM is more
expensive?

> I2C.

Is that the communication protocol that would be the simplest to use with an
external EEPROM?

> >The commercial versions in 20 pin DIP from insight electronics are:
> >AT90S1200   2.09
> >AT90S2313   3.09
> >AT90S2323   2.73
> >AT90S4414   5.72
> >AT90S4434   6.71
> >AT90S8515   7.45
>
> The 4414,4434,8515,8535 are not 20Pin.

D'oh, thats correct.  Editing error on my part, I originaly was including on
the price for the 1200's.

> >Is it difficult to communicate with the computer via a serial cable?
>
> No.

Perhaps I should rephrase that, since you think building a mini-webserver
with an AVR is not difficult :)

Would it simply be a matter of hooking up the MAX232, connecting it to some
pins on the AVR and pasting in some already written AVR code?  Or am I going
to have to write AVR code to handle receiving bits myself?

> MAX232 works fine.  Get them free from maxim-ic

Thanks for the refrence, I was acutally having trouble finding them locally.

Another question, other than the fact that it is a HLL, do you have any
information about the E-LAB Pascal compiler product?  It is a pascal
compiler that will compile code for the AVR2313 and up (and several PIC
micros).
Obviously the code it generates will not be as efficent as hand-coded ASM,
but since few of my projects will require that kind of efficency, I'm
considering using it where possable.
The problem is that it doesn't work on the 1200 (I'm making a guess that it
needs the onboard SRAM).  I was kind of hoping that someone might know of a
way I could use the code it generates anyway, or of another free HLL for the
AVR (I prefer pascal but micro compilers are all pretty easy to learn, so
thats not a requirement.  Free or usable demo is a requirement.  E-LAB
pascal is limited to <4k code in the demo, but thats not a problem for me).

Thanks again.
DK



Follow-Ups: References: