I am writing a motor controller that has a couple of interfaces (buttons, Bluetooth, tactile buttons), which is a task that is constantly growing to be bigger than I thought. I tried to just go to it, starting with low-level modules (for example, writing code for talking on the I2C bus), and then above (code for talking to a specific device on the I2C bus ...), but too often I have to dive back into my lower modules to handle quirks that I haven't adapted. It either takes a lot of time or I get really hacked code.
My goal is an 8-bit MCU, so from the bottom up it seems that I can make better use of the hardware. If I go from top to bottom, I have no structure to build or test / debug.
I tried to make some general diagrams and them for certain levels / drivers, but I'm not sure how to structure them, so I can be very systematic and avoid the odd signal that should go through 2-3 layers.
I think this is the reason for the degree of CS? I am an electrical engineer: P
source
share