avr-libc-corelib
[Top][All Lists]
Advanced

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

RE: [Avr-libc-corelib] The SPI implementation


From: Ron Kreymborg
Subject: RE: [Avr-libc-corelib] The SPI implementation
Date: Wed, 23 Sep 2009 23:46:17 +1000

> > Well the master call would call the slave call in the library after
> setting
> > the delay flag, so no duplication.
> >
> I might just not get what you ment then.

The calls are almost identical except the master has one more parameter.
Within the library the master function would handle that extra parameter,
and then pass the rest onto the slave call.

> > No spi clock Fosc/2 as many spi slaves are only guaranteed to work at
> > Fosc/4.
> 
> This I don't get: spi slave are only guaranteed to work at Fosc/4. As
> far as I understand it the slave work at a maximum SPI clock. I'm not
> sure what you meant by that, but that does not prevent the ATmega from
> working at Fosc/2. Here are two examples.
> 
> 1 An ATmega plug to an SD/MMC card. those support up to 25MHz SPI
> clock. Way faster than even the 20Mhz/2 of some ATmega
> 
> 2 An ATmega plug to a CANBus transceiver CP2515 who has it's own
> external clock and work at SPI 10Mhz.
> 
> My opinion is that it falls on the developers burden to make sure that
> the SPI clock it uses is slower or as fast as what the device can work
> with.
> 
> If not including the SPI_CLK2, at least I think it is appropriate to
> have a separate function like:
> spi_set_double_clock_rate(), or something alike.
> 
> My opinion
> --
> Frédéric Nadeau ing. Jr

Yes, you are correct about an AVR as master. I must admit I was thinking
about AVR to AVR, and that is where the no Fosc/2 for a slave came from. So
assume Fosc/2 is part of the SPI library.

Ron







reply via email to

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