assembly | |
My boardhouse boards arrived from JLCPCB. Time to solder a million components! | |
This board was basically a larger version of the multi-controller touchpad prototype I made. I started from there and adapted it for more touchpads. | |
The big problem with these boards was the time it took to measure touch response and send them over serial to the master board. If a touch board was measuring the touchpads while the master board asked for its state, it would miss the communication. So, I initially had the slave boards constantly waiting for the master board to ask for its state, then it would quickly scan the touchpads and send the result back over serial. This obviously took far too long, so I started having the main loop compute the state of the touchpads. This would be interrupted by a change on the MOSI pin. I ran into problems at first where the MOSI pin value would change, triggering the interrupt, but no character would be relayed on MOSI (ie when the master board first powers on). The slave board code would initially wait forever to read a character. To fix this, I simply added a timeout while reading a serial character. Timing when working with multiple boards was definitely my largest problem. It made me realize how useful it is to have an OS that does time scheduling and process management! The final serial code can be found here. | |
I eventually got the boards to talk to each other amicably. | |
While fiddling with the board, I decided to prepare it to be enclosed in the wooden chassis I'd been working on. | |