The TM1638 spindle panel puts spindle speed, thread pitch and leadscrew controls on one panel. It has eight seven-segment digits, eight red indicators and eight numbered keys, with one keyed Gadgeteer cable to the controller.
The panel sends button presses to the controller. Use the machine’s separate controls for spindle power and emergency stopping.
| Contact | IN | CHAIN |
|---|---|---|
| 1 | Host 3.3 V | Host 3.3 V |
| 2 | Host 5 V | Host 5 V |
| 3 | STB | IN contact 6 |
| 4 | CLK | IN contact 7 |
| 5 | DIO, bidirectional | IN contact 8 |
| 6 | Spare GPIO | IN contact 9 |
| 7–9 | Spare GPIO | Unconnected |
| 10 | Ground | Ground |
Each forwarded GPIO has its own cut link on the back of the board. The downstream contacts inherit the capabilities of their original host pins. Check those capabilities and the shared power budget before adding a second device.
A perma-proto breadboard can bring the four spare signals out to labelled columns. Connect the panel’s CHAIN to the breadboard’s host input. With the Prime J37 example, the breadboard receives PG0, PJ3, PG1 and PJ2 on contacts 3–6. Its GPIO columns for contacts 7–9 have no controller signal in this arrangement. Use the breadboard’s pinout for the column numbers and keep the total load within the controller’s supply budget.
Use Smoothieware V2. The example uses Prime J37. Confirm the header pin assignments on your board revision and free these pins from any other firmware settings. For a different socket, substitute its GPIO names.
[tm1638]
enable = true
strobe_pin = PB1
clock_pin = PJ4
data_pin = PA4
For leadscrew use, configure the spindle encoder and enable the Lathe and Electronic Leadscrew modules. The left digits show encoder-derived spindle speed. The right digits show the selected pitch. See the Electronic Leadscrew guide for button assignments and the Lathe guide for encoder setup.
Use the encoder setting for your machine. Set up the remaining Lathe options as described in the Lathe guide.
[lathe]
enable = true
encoder_ppr = <encoder_ppr>
[els]
enable = true
With a compatible firmware build, the first three indicator LEDs show whether synchronization is running, whether an end position is set, and whether reverse is selected. The board labels the indicators by position so firmware can assign their meanings.
With the machine stationary and motion outputs disabled, verify the power light and confirm that the three firmware pin names match the socket contacts. On a build with Electronic Leadscrew enabled, check the pitch display while using the adjustment keys documented for that build. Confirm which firmware revision is installed before relying on any button that starts synchronized motion. Button behavior has changed between firmware revisions.
The prototype outline is 118 × 48 mm. The four 3.2 mm holes form a 110 × 40 mm rectangle, inset 4 mm from the edges. Use M3 standoffs and leave room behind the PCB for the display leads and rear components. Leave the ribbon connectors and keys accessible after mounting.
The controller drives the strobe and clock. It drives the data line when writing display and indicator values, then switches the same pin to input to read keys. The onboard translator connects the host’s 3.3 V signals to the 5 V TM1638. The chip multiplexes the eight digits and scans the keys between display updates.
| Symptom | Check |
|---|---|
| The 5 V light stays dark | Check cable orientation, host power and the rear link for the power light. |
| The 5 V light is on but the digits stay blank | Check the 3.3 V rail and the configured STB, CLK and DIO GPIOs. Also check that the firmware build includes the TM1638 module. |
| The digits work but keys do not respond | Check DIO and the Electronic Leadscrew configuration. Test keys one at a time. |
| The downstream board does not respond | Check the cut links and the shifted contact mapping. |