Re: SPI Documentation

Nikolas Becker <[email protected]> Fri, 3 Apr 2020 14:18:48 +0000
Newsgroups gmane.comp.hardware.microcontrollers.ethernut
Message-ID <[email protected]>
Hi Uwe,

First: thanks! I will try that. =


Sorry, I didn't know there was something missing from the other issue! I su=
mmarize:

- All my mail addresses are not able to receive zip- or exe-files, so none =
of your compiled qnutconf-version reached me, sadly and I was not able to t=
ry it. Is there some kind of webspace to upload it to?

- The version of Thiago gives the same already known issue: the makedefs ca=
n not be found:

16:16:04: Creating Makefiles for  in D:/dev/trunk/Ethernut/ethernut_2020_03=
_30/ethernut50f/nutbld
16:16:04: Creating header files in D:/dev/trunk/Ethernut/ethernut_2020_03_3=
0/ethernut50f/nutbld
16:16:04: ----- Running 'make clean' -----
16:16:05: makefile:38: D:/dev/trunk/Ethernut/ethernut_2020_03_30/nut/Makede=
fs.: No such file or directory
16:16:05: makefile:51: D:/dev/trunk/Ethernut/ethernut_2020_03_30/nut/Makeru=
les.: No such file or directory
16:16:05: make[1]: *** No rule to make target `D:/dev/trunk/Ethernut/ethern=
ut_2020_03_30/nut/Makerules.'.  Stop.
16:16:05: make: *** [clean] Error 2

- By running nutconfigure from the console, Thiago found that I would build=
 my librarys for the wrong platform (AVR). But since I already chose the pl=
atform in nutconfigure with the -m command as arm-gcc, I don't know where I=
 can change any other parameters so the right platform is set?

Best regards,
   Nikolas


-----Urspr=FCngliche Nachricht-----
Von: en-nut-discussion-bounces-inJ12LbcDfezQB+pC5nmwQ@public.gmane.org [mailto:en-nut-discussion-bounces@=
egnite.de] Im Auftrag von bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org
Gesendet: Freitag, 3. April 2020 15:35
An: Ethernut User Chat (English) <[email protected]>
Betreff: Re: [En-Nut-Discussion] SPI Documentation

Nikolas Becker writes:
> Hi guys,
> =

> I'm working now with my ethernut5 and the TCP/IP-functionality is just so=
 nice working out of the box, very happy with it.
> =

> Now I need to read data from several ADCs via SPI. And here comes my prob=
lem: where can I find some documentation for the SPI device driver? =

> =

> In the Nut/OS Software manual
> http://www.ethernut.de/pdf/enswm28e.pdf
>  there are some lines regarding SPI on page 45, suggesting the use of Nut=
RegisterSpiDevice(), but not much more.
> =

> In the Nut/OS wiki, I found this article:
> http://www.ethernut.de/nutwiki/index.php/Documents/NTN-6_SPI
> Which gives some examples for using the SPI and are very similar to the u=
sage here:
> http://www.ethernut.de/nutwiki/index.php/SPI
> So I tried this:
> =

> #define NUMBER_OF_CHANNELS				4
> #define ADC_CONV_PIN 					3
> #define ADC_CONV_PORT 					NUTGPIO_PORTB
> =

> NUTSPINODE adc_node =3D {&spiBus0At91, NULL, 45158500, 0, =

> (NUMBER_OF_CHANNELS*32), 0};
Hello Nikolas,

the initialisation seem fishy. In 2020, is good habit to use modern C struc=
t initialization like:

NUTSPINODE spi_node =3D {
    .node_bus  =3D  &DEF_SPIBUS,
    .node_stat =3D NULL,
    .node_rate =3D 1000000,
    .node_mode =3D SPI_MODE_0,
    .node_bits =3D 8,
    .node_cs =3D 0,
    .node_dcb =3D NULL,
};

.node_bits seems not good in your code. Most SPI IP transfers in units of 8=
 bits. But even if the IP can do more, Ethernut device driver must support =
it and I am not sure about Atmel. I use Stm32.

Otherwise, I am still missing exact error output from the problem you had l=
ast week. We help you, you help us...

Bye
-- =

Uwe Bonnes                bon-1JbLm1bU5j5ZIx36JBfelj3+ndqKAYMe9FMPySWZwLkb1SvskN2V4Q@public.gmane.org

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 1623569 ------- Fax. 06151 1623305 --------- _________=
______________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion