avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] tiny2313 spi slave


From: Anton Erasmus
Subject: Re: [avr-chat] tiny2313 spi slave
Date: Sat, 13 Dec 2008 22:28:58 +0200

On 12 Dec 2008 at 16:50, Steve Franks wrote:


> On Thu, Dec 11, 2008 at 4:17 PM, Michael Hennebry
> <address@hidden> 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.
> 

I agree with you 100%. Everything that can be easily done in hardware should be
done in hardware. Unless one is doing extremely high volumes where every cent
counts, it is counter productive to try and do everything possible in software. 
It is a
great pity that the tools for the FPSLIC is not freely available. An AVR core 
with even as
little as 32 EPLD macro cells would be an amazing combination.

Regards
  Anton Erasmus-- 
A J Erasmus





reply via email to

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