Gems of Wisdom
Electrical Tips:
- Take the time to ensure your design is wiring friendly. Plan how you are going to route your various cables so you aren't playing "guess which cable."
- Power indication LEDs are your friend! Having an LED on your board tied to your power rail gives you a quick check of whether or not your hardware is even powered.
- Check to make sure you soldered your capacitors in the right direction to prevent explosions.
- Star your grounds to reduce noise on your signal lines.
- Use heat shrink tubing & sleeves instead of electrical tape.
- A simpler, more robust design is favorable to a complex yet finicky design. It's not a bad idea to have a safe base design that could easily be built upon if time allows.
- Tolerancing for 3D printed parts will save time and avoid the headache of filing down surface or drilling out holes. For most FDM printers, increasing the diameter of a hole by 0.4-0.6 mm should be sufficient.
- If you're using tabs to connect laser cut pieces, it's helpful to keep a variable for thickness in your CAD that you can change after you buy and measure material. In Room 36, Duron pieces vary in thickness wildly, and if you use the nominal dimensions you might be left with wobbly tab connections!
- Turning holes into slots can make assembly a lot easier!
- Onshape is a great tool for collaborative CAD, and if you're a SolidWorks user, the learning curve isn't too steep.
- Changes in code should be done incrementally, too many changes without testing can be hard to debug.
- Have a separate service to test your hardware and event transitions in isolation using keystrokes. This can save you hours of debugging by being able to test your hardware and state machines separately.
- Always check your code against the datasheet to make sure you are manipulating the various registers correctly when setting up things like timers and PWM.
- Try to include some documentation above your functions that gives a high level description of what they do. Your teammates will thank you when they are using said functions in their own modules.
- Compiler directives (#ifdef, #ifndef) are your friend! Use them to quickly enable and disable debugging print statements or to test different implementations of your pseudo code.
- Be careful when you use pointers. If you aren't sure of how to use them, they can be more trouble than good.
- Keep state machine diagrams updated. That way anyone in the team can make changes without spending to much time understanding the code.