-
RTFMs
02/27/2025 at 19:30 • 0 commentsI read chapter 2.6.1 "Alternative function assignments" in the "Raspberry Pi Compute Module 5" manual _carefully_ before deciding on the GPIO pin assignment in my schematic. I decided on using SPI4, I2C0 and UART2. Too bad I didn't read the rest of the manual. Especially the table where the clearly states that SPI4 is "slave only"
Fortunately it seems that I can use SPI0 with the SPI4 pinout using some device tree magic. The following line in config.txt did the trick:dtoverlay=spi0-1cs,cs0_pin=8,sclk_pin=11,miso_pin=9,mosi_pin=8
Next up was defining the overlay for the MCP2515
dtoverlay=mcp2515-can0,oscillator=8000000,cs_pin=8,sclk_pin=11,miso_pin=9,mosi_pin=8
Do you spot the second brain fart already ? (The Xiaomi Cybergears default to a bitrate of 1000000)
Now I had to make sure that the mcp driver was loaded> echo "mcp251x" | sudo tee -a /etc/modules
After a quick reboot, i checked dmesg
hansj@cyber-1:~ $ dmesg | grep 2515
[ 4.277991] mcp251x spi0.0 can0: MCP2515 successfully initialized.Yaaaay - right...?
Now it was tTime to bring up can0
sudo ip link set can0 up type can bitrate 1000000
Error: bitrate error: 33.3% too high.Wooops...
Turned out I hadn't looked to carefully at the MCP2515 datasheet either, so I had selected a 8MHz crystal without thinking about the implications regarding the maximum bitrate the mcp could support given the frequency of the oscillator. I can do a bitrate of 500000, but not 1000000.
This is fixable by changing the Cybergear bitrate using communication type 22 via another tool, but I decided to order some 16Mhz crystals from Mouser instead (along with some 22pF capacitors). I guess they will arrive in a couple of days.
-
CM5 first light - Leeroy Jenkins style
02/24/2025 at 21:35 • 0 commentsThe Raspberry Pi IO Board has been sitting on my shelf for a few weeks now. This evening, I finally got around to flashing two of the compute modules. This process is supposed to be rather easy, but I actually struggled a bit before i got it up and running
It was rather nerve wracking powering up the controller board with the first CM5 mounted, but it did't blow up and I managed to get a shell via wifi. Happy days :) -
Manual PCBA
02/23/2025 at 18:11 • 0 commentsJust finished assembling two of the boards. So far, I have only tested the 5V power rail. Power LED lights up and no detectable current draw withouth the CM5 in place. This is a good sign, since there is no smoke coming out and no shorts between power and ground anywhere.
My biggest worry was the tolerances of the CM5 connectors, but the footprint / placement seems to be ok. The module snapped into place without any problems.
Next, I'll have to verify that the pinout is OK. Since I am going to use both SPI, I2C and UART + a couple of GPIO pins, it is entirely possible that I have made a mistake that will require a modification and a new revision (200 pins and mutually exlusive I/O function assignments is a recipe for future facepalms) -
Fresh PCBs !
02/17/2025 at 20:13 • 0 commentsJust got my prototype batch from JLC today. I decided to include support for dynamixel AX-12 and XL-320 as well as the Cybergears. Next up - assembly and testing. I am NOT looking forward to aligning the CM5 100 pin connectors, though :|