On Thu, Dec 11, 2008 at 4:17 PM, Michael Hennebry
<[email protected]> wrote:
> On Thu, 11 Dec 2008, Steve Franks wrote:
>
>> Anyone successfully done an spi slave on a tiny2313?  This unbuffered
>> shift register is junk.  I can't seem to empty it fast enough at 8MHz,
>> even removing all my debugging statements from mainloop, and running
>> the spi master at 100kHz, and reseting the edge counter on every
>> rising edge of CS.  Enough time debugging.  Time to use the uart
>> instead...
>
> It seems that the slave could use more time *between* bytes.
> What happens if the SPI clock rate is F_CPU/6
> and the time between bytes is 200 cycles?
> What is the slave CPU frequency?  Are you sure?

I assume you're exactly correct.  I just moved things over to a spare
uart and it was working in about 5 minutes, so I'll probably just
avoid the SPI on the 2313 in the future.  I have been developing a
theory lately that bosses are generally sold on the "software is cheap
and flexible" idea, so everything's supposed to be done in software.
However I've found I then often spend days fixing things with software
that could be fixed with a couple wires or a different chip in the
hardware in about 15 minutes.  What this generally means in practice
is to buy a much bigger processor than you need, so you're not fooling
around with stuff like this ;)  Even the mega4/8/168 has a "real" spi
interface on it, I believe.  Should've rtfm before I picked the part,
I assumed the SPI core was the same on all AVR's, that's all.

Steve


_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to