tm1638 spindle panel

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.

TM1638 spindle panel top view, with two keyed Gadgeteer sockets above the display and eight numbered keys below it.
Top view of the prototype. The keys, digits and indicators face the operator. KiCad electrical and layout checks pass. Bench testing is pending.

Get started

Smoothieboard V2 Prime J37 connected to the TM1638 panel Smoothieboard V2 Prime TM1638 spindle panel J37 IN One straight-through keyed ribbon cable Leave CHAIN empty for the first check.
Example connection using Prime J37. Confirm the pin assignments on your controller revision before connecting the panel.
  1. Switch off the controller before connecting the ribbon cable.
  2. Connect a compatible Gadgeteer GPIO socket to IN. Leave CHAIN empty for the first check.
  3. Identify the controller pin names at contacts 3, 4 and 5. Add those names to the Smoothieware V2 configuration below.
  4. Power up and check the 5 V indicator. Verify the display and each button with the machine stationary before using the electronic leadscrew.

The panel sends button presses to the controller. Use the machine’s separate controls for spindle power and emergency stopping.

Pinout

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.

Add a downstream prototype board

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.

Plugin order and GPIO mapping from the TM1638 panel to the perma-proto breadboard TM1638 spindle panel Perma-proto breadboard CHAIN Host input Panel IN 6, 7, 8, 9 → panel CHAIN and breadboard IN 3, 4, 5, 6 3.3 V, 5 V and ground retain contacts 1, 2 and 10.
The spare host GPIOs shift down at the panel. The second cable is wired straight through.

Configuration

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.

Display spindle speed and set pitch

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.

Check the panel before enabling movement

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.

Board tour

  • IN and CHAIN sit together above the display. Start with IN. The chain port carries the four spare host GPIOs, both supply rails and ground.
  • Digits 1–8 are split across two four-digit displays. The decimal points are individually addressable.
  • Keys and indicators share the same left-to-right numbering. The firmware assigns each key’s action and each indicator’s meaning.
  • 5 V is a separate power indicator beside the connectors. Each LED has an individual rear solder link that you can cut to disable it.

Mounting

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.

TM1638 spindle panel mounting hole pattern Four 3.2 mm holes on 110 mm horizontal and 40 mm vertical centers. The PCB is 118 mm wide and 48 mm high. 110 mm between hole centers 40 mm Ø 3.2 mm
Hole centers are inset 4 mm from the PCB edges. Use the dimensions rather than printing this figure as a template.

How it works

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.

Troubleshooting

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.

References

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.