[En-Nut-Discussion] SPI master mode Ethernut 5

Harald Kipp harald.kipp at egnite.de
Mon Dec 8 20:27:16 CET 2014


Hi Sergej,

On 04.12.2014 12:36, Sergej Schmidt wrote:

> did anyone tested SPI transfer on ethernut 5 yet?

Without SPI, Ethernut 5 wouldn't be able to access its Dataflash and
even SD-Card access may be based on the SPI driver. So, in general I'm
quite sure, that is works.

Are you sure you are on the right bus, Ethernut 5 has 2 of them.


> The official ethernut spi support example described in http://www.ethernut.de/en/documents/ntn-6_spi.html
> is a bit old or i've made an error by using this example (low level mode). Nevertheless i've got no signal 
> on my MOSI and SPCK line. A code example would be very useful.

Although a bit old, it is still the way to go. For Ethernut 5 and EIR use

NutRegisterSpiDevice(&devSpiBlkAt45d0, &spiBus0At91, 0);

for the first SPI0 or

NutRegisterSpiDevice(&devSpiBlkAt45d0, &spiBus1At91, 0);

for the second SPI1. Only the latter is available at the expansion port.

Btw. the app/ediconf sample will print some useful information about
your SPI configuration. It's done for SPI0, but can be modified for SPI1
in order to see, what's actually configured.

I'm a bit short in time right now. If the above doesn't help, I can
create a simple example tomorrow.

Regards,

Harald





More information about the En-Nut-Discussion mailing list