Hello,
I want to share what I experienced in making the system
who implemented STM32F103C [STM32F103C8T6] stm32duino
in 2019,
Initially, I used the Arduino IDE v.1.5.x software
and using EThernet_STM.h
but because of the design needs that require A0-A9 as a digital input
10-bit absolute rotary sensor, then SPI must be moved from SPI-1 to SPI-2
in this condition I modify the W550.cpp to be like this
C: \ Users \ [your PC] \ AppData \ Local \ Arduino15 \ packages \ stm32duino \ hardware \ STM32F1 \ 2019.12.31 \ libraries \ Ethernet_STM \ src \ utility
#include <stdio.h>
#include <string.h>
#include <SPI.h> // add by riky
#include "utility / w5100.h"
#if defined (W5500_ETHERNET_SHIELD)
// W5500 controller instance
W5500Class W5100;
#define SPI_CS 10
// # define STM32_SPI_CS PA4 // edit by riky
#define STM32_SPI_CS PB12 // change by riky
// # define SPI2_NSS_PIN PB12 // add by riky
SPIClass SPI_2 (2); // add by riky
void W5500Class :: init (void)
....
..
etc
but after I upgraded the Arduino IDE 1.5.x to v.18.x
can no longer ... :(
so I have to do more, and pray to the Lord Jesus
... finally God showed me a directory and a file
and directs me to have to modify the variant.h file that's in
C: \ Users \ [yourPC] \ AppData \ Local \ Arduino15 \ packages \ STM32 \ hardware \ stm32 \ 1.8.0 \ variants \ PILL_F103XX
on the line: [the standard is SPI-1]
// SPI Definitions
#define PIN_SPI_SS PA4
#define PIN_SPI_MOSI PA7
#define PIN_SPI_MISO PA6
#define PIN_SPI_SCK PA5
change to: [SPI-2]
// SPI Definitions
#define PIN_SPI_SS PB12
#define PIN_SPI_MOSI PB15
#define PIN_SPI_MISO PB14
#define PIN_SPI_SCK PB13
Hallelujah ... Praise God
works ... :)
ok, hope it's useful
Lord Jesus bless you and your family so much - so much - so much
amen!
Halo,
saya mau berbagi apa yang saya alami dalam membuat system
yang menerapkan STM32F103C [STM32F103C8T6] stm32duino
pada tahun 2019,
awalnya, saya mengunakan software Arduino IDE v.1.5.x
dan mengunakan EThernet_STM.h
namun karena kebutuhan design yang membutuhkan A0-A9 sebagai digital input
10-bit absolute rotary sensor, maka SPI harus dipindahkan dari SPI-1 ke SPI-2
pada kondisi ini saya memodifikasi W550.cpp menjadi seperti berikut
C:\Users[your PC]\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2019.12.31\libraries\Ethernet_STM\src\utility
#include <stdio.h>
#include <string.h>
#include <SPI.h> //add by riky
#include "utility/w5100.h"
#if defined(W5500_ETHERNET_SHIELD)
// W5500 controller instance
W5500Class W5100;
#define SPI_CS 10
//#define STM32_SPI_CS PA4 //edit by riky
#define STM32_SPI_CS PB12 //change by riky
//#define SPI2_NSS_PIN PB12 //add by riky
SPIClass SPI_2(2); //add by riky
void W5500Class::init(void)
....
..
dan seterusnya
tetapi setelah saya upgrade Arduino IDE 1.5.x menjadi v.18.x
sudah tidak bisa lagi... :(
jadi saya harus ngoprek lagi, dan berdoa kepada Tuhan Yesus
...akhirnya Tuhan tunjukan ke saya suatu direktroy dan file
dan mengarahkan saya harus memodifikasi file variant.h yang ada di
C:\Users[yourPC]\AppData\Local\Arduino15\packages\STM32\hardware\stm32\1.8.0\variants\PILL_F103XX
pada baris: [standard nya SPI-1]
// SPI Definitions
#define PIN_SPI_SS PA4
#define PIN_SPI_MOSI PA7
#define PIN_SPI_MISO PA6
#define PIN_SPI_SCK PA5
rubah menjadi : [SPI-2]
// SPI Definitions
#define PIN_SPI_SS PB12
#define PIN_SPI_MOSI PB15
#define PIN_SPI_MISO PB14
#define PIN_SPI_SCK PB13
Haleluya...Puji Tuhan
berhasil...:)
ok, semoga bermanfaat
Tuhan Yesus memberkati anda sekeluarga berlimpah-limpah-limpah
amin!