Seeker Of Ways: Fix custom Raspberry pi Hat

 

1Raspberry Pi Hat Disaster Fix

PROBLEM: During testing, it became obvious that the onboard regulators of the custom Raspberry Pi Hat meant as upgrade for Seeker Of Ways B weren't working at all, having an output voltage ranging from 3V to 15V





2Problem: Flux

After much debugging, it turns out the problem was the new flux I used during soldering. MB. I didn't check the washability when I bought it. This new flux is harder to wash, leaving residues that unbalance slightly the value of components.

Debugging the issue was a nightmare, in the end I had to desolder, clean up the residue underneath and resolder pretty much every component on the board. If it wasn't for the good quality of PCB from Eurocircuit, I probably would have had to replace the whole board.

2.1Voltage Divider

The parasitic current caused by the flux was minor: on the order of 10 to 100uA. Such a current isn't a catastrophic problem in the majority of components, except where the exact values of components are needed. Aka the feedback voltage divider for the switching and the linear regulators.

After cleaning and resoldering the components, the onboard regulators were finally operating as intended with the SEPIC regulator generating 5.8V and the LDO generating a clean 5.0V for the Raspberry Pi and other 5V components on the board.

2.2Reset

With the board assembled, it was finally time to test the microcontroller. It didn't work.
This was a problem identified by previous tests and was caused by the transistor that allows the RPI to reset the microcontroller non doing its job and keeping the reset line asserted to 0V.

Solution was simply to replace the original IRLML2803 with a 2N7002.
With the reset line reading the correct 5V in the default condition, the programmer was able to correctly read the signature of the device and the status of the fuses.


2.3Crystal Oscillator

More problems with the microcontroller: device signature and basic programming went on without an hitch, but the device failed on programming larger binaries and became bricked after changing the clock from the internal 8MHz RC oscillator to the external 20MHz crystal.

Replacing he crystal didn't help. Replacing the microcontroller didn't help.
Injecting a 2.5MHz clock from a donor source was enough to bring the microcontroller back to life, restricting the problem to the crystal itself.

More through testing with an oscilloscope revealed that it was the crystal failing to start up. This usually happens when the capacitors are too big. I tried simply removing the capacitors altogether to rely on the parasitic capacitance to make the crystal work: success!



3Test Firmware

With the electronics apparently in working order, I made a small led blink program to test the microcontroller and programming. Success!

>>>Firmware<<<


4Test Raspberry Pi

Next step was to test whatever the hat was able to dock and power the Raspberry Pi and whatever the RPI and the custom OS image worked properly.
The power test went on without an hitch.

The same OS image that powers Maze Runner was flashed on an SD card and used to boot SoW-B taking care of moving the IP address from 192.168.0.202 to 192.168.1.203. Remote access to the raspberry pi via ethernet works like a charm. Success!


5Conclusions

The custom Raspberry Pi Hat looks like a disaster field after all the debug, the desolder and the resolder of the components.
This is not a problem for Seeker Of Ways B, since this board was always meant to root out all issues for the redesign of the next revision of the board planned for OrangeBot and the PiWars 2020.

6Follow Up

With the mechanical and electronic side of SoW-B sorted out, the next steps are:
  1. Add DC Motor+Encoder support to the firmware inside the At644
  2. Add Raspicam video streaming support to the NODE.JS streaming server running inside the Raspberry Pi
  3. Add access point functionality to the Raspberry Pi so that the robot can be controlled via Wi-Fi
This version of the RPI Hat is much closer to the version that might take part in the Pi Wars 2020 featuring two DC motors with encoders instead of servomotors.
A major difference is that the Pi Wars RPI Hat will run on the AT4809, the newest revision of the AT line of microcontrollers. Effort will be required to port the firmware to the new hardware.


No comments: