So I've seen many projects be showcased in their various stages of development. Instructables, Youtube Videos, websites and blogs etc. All of them starting on a breadboard or a soldering components on perfboards but all of these projects were small, just about a size of a cellphone for the most of them. And most of them not dealing with many inputs. A sensort here, or display there, never anything of grander scale, that I've seen that is.
So what about larger projects? Such as the image above. Multiple massive Button arrays, leds, display and not to mention the background circuitry meant for running a bare-bone controller. How do you go about testing and prototyping the circuits of these devices?
Is this what I have to look forward to with this sort of a project?
I'm just about looking at Aliexpress, about to buy 20 Breadboards and a butt load of patch wires. Would like to see if there's a more appropriate method of prototyping these larger designs. I'm laying out the schematic in Eagle right now but that can only get me thus far... Perhaps instead print the design via JLCPCB, solder the components and then debug an errors?
Depends what you mean by big . I’d always question a project with vast arrays of buttons etc - there must be a better way ( keyboard ?)
My approach has always been to divide the project down into manageable chunks. Write each chunk as a function and get it working , then combine them .
Void loop ()
{
Task1();
Task2();
Task3();
}
disclaimer !! NOT REAL CODE ! And use meaningful descriptive names !! .. ..
At some point you need to take a punt that you are on the right track and get a PCB made .
You also need a plan of how it’s going to work that you follow and also control versions of your code.
I wouldn’t buy lots of prototyping boards , that will end in frustration and wires falling out .
You could also look at visual
Studio ( I only use it for printing lol) , in which I hear you can set breakpoints etc
Realistically too there is only so much you can reasonably do with an Arduino, you could split the project over two devices or move to a different platform . Not many people try to control a nuclear submarine with a single Arduino , for good reason !
I think that the circuits and their representation is closely related. If you have many wires running across various modules, try to reduce that number in the first steps. E.g. control an array by row/column shift registers, so that it connects with only 3 wires to the controller. Then the shift registers or port expanders can be located near the many items they control, instead of having many wires going from the controller to arbitrary places far away.
PCBs can help, but they introduce another problem: if a component on a breadboard is defective, it can be replaced almost easily. A soldered component can not normally be replaced in-place, instead the entire PCB should be replaced or at least disconnected for repair. You see what a mess you'll have with PCBs connected with many wires? So you may want to have multi-pin connectors on every PCB, so that it can be disconnected easily, leaving all wires connected to the matching connector.
TobiasRipper:
So what about larger projects? Such as the image above. Multiple massive Button arrays, leds, display and not to mention the background circuitry meant for running a bare-bone controller. How do you go about testing and prototyping the circuits of these devices?
I think there are two separate issues - the physical construction and the software.
IMHO the physical construction should be designed as a series of identical small modules. Then testing and proving one module will prove the design for all of them.
A possible issue for the software is whether the Arduino is fast enough to respond to all the inputs (and outputs) in real time. I suspect with a bit of thought enough data can be collected from a single hardware module to allow a good estimate or simulation of the software performance with the complete system.
I guess in the back of my mind is the assumption that a modular hardware design will be matched by a modular software design so that if it works with one module it can be assumed to work with several - subject to the performance question already mentioned.
If data acquisition speed becomes a problem, the dumb shift registers or modules can be replaced by more intelligent ones. Like the LCD display receives data from the controller, then does whatever required to show the related text. Similarly an input matrix can have its own controller, and optionally all inputs alert the master controller only if something changed, so that the master has time for other activities. Unlike shift registers, most port expanders already have such notification outputs, which can be tied to interrupt inputs of the master controller.
In a modular design the code for a specific I/O module should reside in a dedicated subroutine. When the module later is replaced by an intelligent one, that subroutine is moved to the slave controller, and the master code is converted into the slave communication.
I'm looking to either use an atmega2560 controller at 16mhz or go to an STM32f4, however with that one I'd have to switch to Keil and using any libraries (display library) would become a bit tricky as now I either have to find a display library for stm32s or dive into the display datasheet and start writing my own
But as for the large button array, it's at the core of what this device is. Instead of menus and limited controls, I wanted to have freedom, speed and dedicated inputs for many often used parameters. I was going to mux the inputs to gather all the input data first.
On a side note:
How compatible are the arduino libraries when you use Arduino IDE with STM32s? I know that you can run the blue pill AND you can find STM32F4 family in the board manager, so how compatible are they with the various libraries available for AVR based arduinos? Like the Wire library, Display libraries from Adafruit for various displays, etc? I feel that things like predefined LEDs, Serial Ports in Arduinos are really nice and make it easy for many of us but this ride can't last forever and I feel like there's bound to be incompatibilities between libraries when you venture outside of AVRs.
In a Nutshell - How much do you forfeit by using Arduino IDE as a programming environment for STM32f1 - f4 series controllers as opposed to using Keil or any other environment specifically designed for working with STM32s?
How compatible are the arduino libraries when you use Arduino IDE with STM32s?
Not at all. Eventually most of the Arduino libraries talk to the hardware in some way and that is fundamentally different. Unless you want to spend your time making hardware abstraction layers that look like the Arduino's then forget it.
In the electronics industry I haven't seen anyone use a breadboard, perfboard, or wire wrap, etc. for a long time... Usually, they go straight for a PC board The board is never perfect the 1st time and there are usually some cuts & jumps, and sometimes tacked-on components. In some cases the first "Rev 0" board can't be made to work and it gets scrapped.* It's an expensive process, but "product development" isn't cheap.
For complex chips there is usually a development board** that can be used for the "breadboard"/prototyping along with any special/custom circuitry/boards.
For the prototype phase, multiple-modular boards might be made even if the final product will be more condensed.
If I was doing a "big project", I'd modularize it as much as possible. And to whatever extent possible, I'd breadboard & test the modules separately before having boards made and putting everything together.
If your project has a large number of multiplexed or matrixed buttons, you may be able to test-out the design with a smaller number of buttons, and then commit to a PC board.
I remember one case where the company I was working for was in a big hurry and the data bus got left-off the board! ...I think the boards were actually assembled before anyone realized there was a problem.
** The Arduino doubles as the development board which is a big advantage over using a random microcontroller.
I remember one case where the company I was working for was in a big hurry and the data bus got left-off the board
Well I worked at one where the 16 bit address got laid out backwards and it was my job to reverse the connectors. Not easy with a 0.8mm pitch chip and track separation. It took about half a day per board to correct.
in such a task, I would look to how many switches on one shift register.
then lay out a board with the number of shift registers and buttons as would make a nice module.
since I expect there would be pleanty of room, add extra holes for things like pull up and pull down resistors
caps and a place to jump to other pins on the shift registers.
and since I like the idea of modules, I usually add things line both I2c and SPI pads for future alterations so that they can plug together. move the pins far back onto the board so the female pins and male pins can plug in and the board can touch.
you might find a 16 button board just perfect.
then have a batch made.
if you got it right, then you project moves faster, if you laid it our wrong, you have lots of extra holes to make jumping things around much easier.
I just use plated Via's with no solder mask as in my software they do not count as pins against my total limit.
if it works, then you spend about the same for that as for 10 decent proto boards.
and when I say decent, that means flared entry points . I have some that are not flared to guide the wire and are worthless.