Arduino STM32 Ethernet
1.0.0
Arduino STM32 ตัวอย่างสำหรับโมดูล Ethernet W5X00
โครงการนี้ใช้ห้องสมุดนี้
Platformio จะติดตั้งไลบรารีที่ต้องการโดยอัตโนมัติตามไฟล์ INI
ยอดเยี่ยม!
แพลตฟอร์ม
$ python3 --version
Python 3.7.3
$ sudo apt install python3-pip python3-setuptools
$ python3 -m pip -V
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
# pip installed by apt is old, so update to the latest.
$ python3 -m pip install -U pip
$ python3 -m pip -V
pip 20.3.1 from /home/orangepi/.local/lib/python3.7/site-packages/pip (python 3.7)
# Update wheels.
$ python3 -m pip install -U wheel
$ pip3 install -U platformio


มันถูกเลือกโดยอัตโนมัติภายในห้องสมุด
| phy | STM32 | |
|---|---|---|
| Mosi | PA7 | |
| มิโซะ | PA6 | |
| SCLK | PA5 | |
| เอสเอส | PA4 | *1 |
| ครั้งแรก | รีเซ็ต | *2 |
| 3.3V | 3.3V | *3 |
| gnd | gnd | *3 |
(*1)
คุณสามารถระบุพินใด ๆ ใน platformio.ini
(*2)
ดึงขึ้นเมื่อไม่มีหมุดรีเซ็ต
(*3)
บอร์ด BluePill หรือ Blackpill ไม่สามารถจัดหากระแสได้มากเกินไป มันมีเสถียรภาพมากขึ้นเมื่อมาจากแหล่งพลังงานภายนอก
+----------+ +----------+ +----------+
|BluePill | |ST-LINK | |HOST |
|BlackPill | | [------------] |
| |------------|SWD-IO [ USB ] |
| |------------|SWD-CLK [------------] |
| |------------|GND | | |
| |------------|3V3 | | |
| | +----------+ | |
| | | |
| | +----------+ | |
+----------+ | PA9|------------|RX | | |
| |---(MOSI)---| GND|------------|GND | | |
| |---(MISO)---| | | | | |
| |---(SCLK)---| | | | | |
| |---(SS)-----| | | USB-TTL [------------] |
| |---(RESET)--| | | [ USB ] |
| | | | | [/dev/ttyUSB0] |
| PHY | | | | [------------] |
| | +----------+ | | | |
| | | | | |
| | +----------+ | | | |
| |---(3V3)----|5v->3.3V |----(5V)----| | | |
| |---(GND)----|Regulator |----(GND)---| | | |
+----------+ +----------+ +----------+ +----------+
+----------+ +----------+ +----------+
|BluePill | |ST-LINK | |HOST |
|BlackPill | | [------------] |
| |------------|SWD-IO [ USB ] |
| |------------|SWD-CLK [------------] |
| |------------|GND | | |
| | | | | |
| | +----------+ | |
| | | |
| [------------------------------------] |
+----------+ | [ USB ] |
| |---(MOSI)---| [------------------------------------] |
| |---(MISO)---| | | |
| |---(SCLK)---| | | |
| |---(SS)-----| |-------+ | |
| |---(RESET)--| |---+ | | |
| | | | | | | |
| PHY | | | | (GND) | |
| | +----------+ (5V) | | |
| | | | | |
| | +----------+ | | | |
| |---(3V3)----|5v->3.3V |---+ | | |
| |---(GND)----|Regulator |-------+ | |
+----------+ +----------+ +----------+
+----------+ +----------+ +----------+
|BluePill | |USB-TTL | |HOST |
|BlackPill | | [------------] |
| |----(5V)----| [ USB ] |
| |----(GND)---| [------------] |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
+----------+ | PA9|------------|RX | | |
| |---(MOSI)---| | | | | |
| |---(MISO)---| | | | | |
| |---(SCLK)---| | | | | |
| |---(SS)-----| |-------+ | | | |
| |---(RESET)--| |---+ | | | | |
| | | | | | | | | |
| PHY | | | | (GND) | | | |
| | +----------+ (5V) | | | | |
| | | | | | | |
| | +----------+ | | | | | |
| |---(3V3)----|5v->3.3V |---+ | | | | |
| |---(GND)----|Regulator |-------+ | | | |
+----------+ +----------+ +----------+ +----------+
+----------+ +----------+
|BluePill | |HOST |
|BlackPill [------------------------------------] |
| [ USB ] |
| [------------------------------------] |
| | | |
| | | |
| | | |
| | | |
| | | |
+----------+ | | | |
| |---(MOSI)---| | | |
| |---(MISO)---| | | |
| |---(SCLK)---| | | |
| |---(SS)-----| |-------+ | |
| |---(RESET)--| |---+ | | |
| | | | | | | |
| PHY | | | | (GND) | |
| | +----------+ (5V) | | |
| | | | | |
| | +----------+ | | | |
| |---(3V3)----|5v->3.3V |---+ | | |
| |---(GND)----|Regulator |-------+ | |
+----------+ +----------+ +----------+
serial.print goto pa9
git clone https://github.com/nopnop2002/Arduino-STM32-Ethernet
cd Arduino-STM32-Ethernet/DhcpAddressPrinter
pio run -t upload -e bluepill_f103c8
serial.print เป็นเอาต์พุตไปยังพอร์ต COM เสมือน USB
/dev/ttyacm0 อาจเปลี่ยนแปลง
git clone https://github.com/nopnop2002/Arduino-STM32-Ethernet
cd Arduino-STM32-Ethernet/DhcpAddressPrinter
pio run -e bluepill_f103c8_usbcon -t upload && pio device monitor -b 115200 -p /dev/ttyACM0
ดูที่นี่