STM32F407 Based W5500 Ethernet Controller CAN Bus Board and Testing

Tell us about your projects. Update us regularly.
Post Reply
parkview
Guru Maker
Posts: 618
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

STM32F407 Based W5500 Ethernet Controller CAN Bus Board and Testing

Post by parkview » Thu Feb 13, 2025 2:07 pm

None of us at the Uni had had much experience of working with a CAN Bus. We wanted to use this Comms technology to transfer data back and forth from a laptop to up to 25 motor modules. Could the data be transferred fast enough for our needs?

We determined that we could use Ethernet as the main Comms path to a master Ethernet to Can Bus controller board to transfer data back and forth. To test this idea out, I designed up a STM32F407 (we used this MCU for everything) based W5500 Ethernet transceiver and a SN65HVD230 Can Bus controller IC.

First off I designed up a board that we could add on a TaoBao purchased W5500 Ethernet module board. This worked well, so the next board I had a go at integrating the W5500 IC directly onto the main board. At the time, I found three competing W5500 designs online, so fingers crossed behind my back, I picked one and added the design onto my board. The red DIP switch helped set the Ethernet Address, as we needed 14 or so of these boards on one network via DHCP.

At first it didn't want to work properly, so I soldered some fine magnet wire to the SPI bus pins on the W5500 so I could monitor what was going on. This helped conclude there was a software issue, not a hardware one:
W5500-debugging2.jpg
W5500-debugging2.jpg (122.18 KiB) Viewed 4807 times
I thought designing this board was rather cool. Close up of the board under test:
W5500-debugging.jpg
W5500-debugging.jpg (92.31 KiB) Viewed 4807 times
Last edited by parkview on Thu Feb 13, 2025 2:30 pm, edited 1 time in total.

parkview
Guru Maker
Posts: 618
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: STM32F407 based W5500 Ethernet Controller CAN Bus board

Post by parkview » Thu Feb 13, 2025 2:29 pm

So we could test the CAN Bus under a data load, I designed up a small STM32F407 board that up to 25 of them could be plugged into a 600mm long CAN Bus PCB. Each computing module board had a few LEDs, and if needed, some inputs etc. These where all assembled by JLCPCB as I didn't want to have to hand assemble 25 of these. BUT I made a stuff up and forgot to place the bootloader jumpers, so I had an manually solder them onto the relevant pins of the STM32F407 MCU - ouch!
CAN_Bus_STM32F407_Test_PCB_sml.jpg
CAN_Bus_STM32F407_Test_PCB_sml.jpg (97.68 KiB) Viewed 4806 times
Here is a photo of the bus board with 10 of them in place:
CAN-Bus_Testing.jpg
CAN-Bus_Testing.jpg (116.99 KiB) Viewed 4806 times
It all looked quite specky with the boards LEDs toggling away with CAN packets coming and going. This all turned out to be very handy tool as it gave us a compact method of being able to write and test out program while only taking up a relatively small desk space.

Post Reply