Connecting things to a Windows PC is sometimes a bit of a challenge. I am in urgent need of a CAN-X adapter. These things cost and if I add my request for a Wired Ethernet, Wireless Ethernet as well as USB prices start to have several digits. The amount of software needed and the component cost is however not that big a job, so I can as well make one myself for the fun of it.
I will use STM32F405RG as MCU this time. This is an overkill, but I fancy doing something with this small M4 and it only cost 5.- USD.
- – 32bit ARM M4 168Mhz, 1Mb Flash, 192+4Kb SRAM
- – BasicPI SWD connector
- – Issolated RS485
- – Issolated CAN HS
- – NRF24L01+
- – 10/100Mbps Ethernet
- – Wifi
- – USB
This is my first Ethernet design and I am cheating big time. The F405 don’t have a Ethernet connector so I am adding a Wiznet W5500 chip. This provide a hardwired TCP/IP stack that we interface to through SPI. The smaller version of this W5100 should be well known for hobby makers.
As for Wireless we use ESP8266. Either ESP-3, ESP-12 or similar. This is a cheap solution that will work well in this case.
I am doing the same trick on USB. This MCU actually have a USB connection, but I am cheating and using a CH340 to get a serial over USB connection. I have used this for years and I never have any fuzz with this one. Programming a serial port is also much easier than programming USB drivers.
The rest of the code is a small router. I will not be doing any clever code on the CAN. I simply want to provide a dumb remote I/O and let software on the PC do the rest.