#The digit reversal function on the TM1637 is not working

1 messages · Page 1 of 1 (latest)

lethal glade
#

Hi, I'm working on my RMP panel, but my 7-segment display is inverted. Any idea how to fix this? It's a TM1637.
When I use the reverse digit, it gives me 001228

#

The function seems to work only for the Max7219; when I use it, I get the impression that Mobiflight is trying to reverse 8 digits rather than 6.

covert needle
#

@blissful helm can you help?

#

Out of curiosity, why do you knowingly choose to wire the digits in reverse order, which forces you to use the reverse digits option?

lethal glade
#

I didn't make that choice; they're wired in the normal order according to the TM1637 datasheet, but I didn't know they were supposed to be wired in the opposite direction.

blissful helm
#

Post a screenshot of the output config display tab

lethal glade
blissful helm
#

Ok you have all digits enabled

#

Not sure what's up, that reverse digits was added before tm support if I remember right

lethal glade
#

That was the theory we had—the function would only work on the Max7219, which has 8 digits.

covert needle
lethal glade
covert needle
#

No, most digit cluster manufacturers number their digits from left to right, so in a three digit cluster they are numbered 1 2 3, but for the TM1637 GRD1 is the rightmost position.

lethal glade
#

Oh, I see, but then I should have gotten 321654 if we follow that logic

covert needle
#

So, GRD1 should be wired to position 3, not 1.

#

No

lethal glade
#

Oh, right, sorry 654321

#

I just figured out the problem

covert needle
#
Digit cluster  1 2 3   1 2 3
TM1637 GRD     6 5 4   3 2 1
lethal glade
#

Yeah, that's clearer. I see where the problem is. Well, I guess I'll just have to reorder the PCBs.

#

Should it work now?

covert needle
#

I think you have the digit clusters reversed now... GRD1 is the rightmost position, that is D3 of the right group

#

your diagram says GRD1 goes to D3 but of the left group

lethal glade
#

With my old PCB, all the numbers were reversed, so normally if I reverse the wiring, it should be right

covert needle
#

You should breadboard your design before committing it to PCB. I still think the digit groups are reversed. You have them like
3 2 1 6 5 4

lethal glade
#

I'm going to set up a breadboard tomorrow to test it out, and I'll let you know how it goes.

lime pike
#

well, the reverse digits ought to work the same on both MAX and TM chips

#

in any case, since the option exists, regardless of what the "correct" digit order is. Because these mistakes happen easily, and we have the option for MAX.

Edit: Ok, I see what the problem is, with the split 3 + 3 digits both being independently reversed.

#

But if I understood correctly this case where you have split digits reversed on 3 + 3 digit modules you would maybe need to split the frequencies into two output configs (MHz and kHz parts) and display them as two separate display configs with reverse digits I guess? Would that work?

#

like MMM / kkk

but with reverse digits it would perhaps beM3 M2 M1 / k3 k2 k1

Would that work?

lethal glade
#

After conducting several tests on a breadboard, I found that to get the 7-segment displays oriented correctly, you need to wire them in this order:

#

So, to get a reverse-digit function that works, you would need to swap GD4/GD5/GD6/GD1/GD2/GD3 with GD3/GD2/GD1/GD6/GD5/GD4

#

or the frequency would just need to be displayed as an inverse value

lime pike
#

if you do new pcbs migth as well go non-reverse

#

so 6 5 4 3 2 1

#

on the physical digits, and the pins in the digit modules are likely 1 2 3 1 2 3

lethal glade
#

The correct wiring order for the modules from the chip TM1637 is:
TM GRD3 > M1 D1
TM GRD2 > M1 D2
TM GRD1 > M1 D3
TM GRD6 > M2 D1
TM GRD5 > M2 D2
TM GRD4 > M2 D3

M1 for left and M2 for right

lime pike
#

hmm wait what?

#

GRD is TM chip pins?

lethal glade
#

YES

#

GRD = GRID

lime pike
#

the datasheet diagram is not helping much

#

yea its common anode I think

lethal glade
#

Yes, the TM1637s are common-anode compared to the Max, which is common-cathode.

lime pike
#

so if you breadboard it with "reverse digits" OFF, how is the wiring then? I would expect it to be just

GRID6 -> M1D1
GRID5 -> M1D2
GRID4 -> M1D3
GRID3 -> M2D1
GRID2 -> M2D2
GRID1 -> M2D3

So is there some inconsistency with reverse digits or am I understanding wrong?

#

the modules being [ M1 ] [ M2 ]

lethal glade
#

Here's the pattern if it helps

lime pike
#

as in [123][456]

#

so is this with "reverse digits"?

#

because it feels like it doesnt make sense? or I need more coffee 🙂

lethal glade
#

When I don't enable the reverse digit option, it displays 008221, but with the reverse digit option enabled, it displays two blanks followed by 1228

lime pike
#

yea so without reverse digits, swap the digit wiring around?

#

in the breadboard I mean

lethal glade
lethal glade
lime pike
#

so reverse kind of splits the digits oddly in half?

#

@unkempt ravine this is curious, I wonder what the firmware vs connector does in this case?

lethal glade
#

Either it treats it as a 4-digit TM1637 and only displays the first digit, or it treats it as a MAX and tries to display grid 7 and grid 8, which do not exist on the chip

lime pike
#

yeah

#

good find, too bad it hit your foot to find the issue

lethal glade
#

It's no big deal 😉; it helps us find small bugs, which is helpful.

lime pike
#

yeah, thanks for reporting this

#

the reverse feature dates back to when there was just MAX, and not many people have actually built with TM1637 on their own PCB I guess. I know Rowsfire panels use TM chips on the segment display, but they dont have reverse digits enabled

lethal glade
#

I ordered some new PCBs—with the right order this time

covert needle
#

I am sorry, I still don't understand. Do you mean the correct wiring sequence to get the numbers in correct order is like this?

Digits   1 2 3   1 2 3
TM Grid  3 2 1   6 5 4
Value    1 2 2   8 0 0
#

If so, it really makes no sense to me

#

Unless the value is being split into two separate output configs, which I believe is not the case.

unkempt ravine
#

It can be seen in the log what get displayed

lethal glade
#

Without reverse
Debug 04/13/2026 18:55:31 MobiFlightLedModule.Display(): Command: SetModule <1,0,0,123456,0,63;>.

#

With reverse
Debug 04/13/2026 18:55:39 MobiFlightLedModule.Display(): Command: SetModule <1,0,0,654321,0,252;>.

unkempt ravine
#

Hmhm, let me check the code...

lime pike
#

I only have a 4 digit tm1637 module

unkempt ravine
#

The mask is different between both commands in the log:
63 is 0011 1111, means the two left most get not displayed
253 is 1111 1100, means the both right most get not displayed.
For 8 digit this is OK, but for 6 (or 4) digit TM1637 I am not sure what exactly happens. Need to have a much deeper look into the code tomorrow.

covert needle
#

In this particular case, it seems to me the digits reverse function does not take into account only 6 possible digits for TM1637.

covert needle
unkempt ravine
covert needle
lime pike
#

so the TM option does not have the number of digits option I think? would that setting default to 8 for example and make something off by two?

unkempt ravine
lime pike
#

hmm

#

let me test

#

you select it at device creation time at least

#

yes you can choose it seems

#

funny why not 1 or 2?

#

oh @lethal glade what is your setting here?

#

though I would guess 6 because thats how many digits there are

#

duh, disregard

lethal glade
covert needle
#

I would speculate that if the mask is stored in the mfproj file, maybe hand editing the mask to use the same 63 as in the regular non-reversed would correctly reverse a six digit display.
It seems pretty clear that the reverse function is using an 8-digit field.

lethal glade
#

Is it possible to change the mask manually from mobiflight?

lime pike
#

check what the mfproj file has? not sure

#

with a text editor, make backup first

#

no idea at all if it has something for this

covert needle
lime pike
#

there is 2891

#

anyway, night!

covert needle
#

Ohh didn't see that one. I will close mine.

lethal glade
lime pike
#

yea ok

lime pike
#

mfproj has the selected digits, maybe the mask is formed at runtime if it is more compact way of defining them in the serial protocol?

lethal glade
#

I'm back. Here's what's in my mfproj file regarding the TM1637 output:

lime pike
#

I wonder what happens if you reorder those digits?

lethal glade
#

Where exactly do you want me to change the order of the numbers?

lime pike
#

I mean I dont know,

#

but if you want to experiment, no idea if it works. I think @unkempt ravine and @half fulcrum need to look how those are handled for reverse digits

lethal glade
#

I think that in the mfproj, the file directly calls a “DisplayLedReverseDigits” code block from an external source, so I don't think it can be modified from within the mfproj

#

You should look directly at the code for the DisplayLedReverseDigits function; the question is, where is it located?

half fulcrum
#

it wont work

lethal glade
#

Oh, well, my theory goes out the window 😂😂

half fulcrum
#

i really think we should take reverse mode out of the displays and into a modifier

lethal glade
#

It can be a solution. If I understood correctly, would the modifier just reverse the output order of the value read from the simulator? The "reverse digit" function acts on the selection of values assigned to each digit of the TM or MAX chip.

lime pike
#

we should have some way to make more modifiers easier too

#

they should be the primary way to configure things perhaps?

#

to format data

half fulcrum
#

tbh. i am not sure right now why i insisted on doing it on device level.

#

i believe neil had done the simple approach at some point with just flipping the content... but the decimal points didnt line up correctly then.

#

so not only the content.. also the decimal point config has to swap around and we have masking in place... because you can disable individual digits.

covert needle
#

IIRC the decimal point position and selected digits still needs to be changed when using the invert option.

half fulcrum
#

not if you enable "reverse digits" on the device/.

lethal glade
#

But the decimal point we can "ignore it in itself" if we use the "decimal point" box instead of the decimal point returned by the simulator? This would avoid complicating the logic of the function.

covert needle
#

It doesn't matter how many digits were selected in the display tab to begin with. For this reason we recommend to always specify 8 digits.

lethal glade
#

With the new PCB, it's works great

half fulcrum
#

great!

lethal glade
#

It's much better in order this time 🤣

covert needle
#

Is this with or without reverse digits on?

lethal glade
fathom latch
#

Hello everyone,
I'm stepping in this topic as I am unable to correctly display the clock UTC time using the TM1637 chip.

I will try to describe in detail (sorry if it is a bit long)...

I am using my own PCB design. This PCB holds all clock displays. (Chrono / UTC / E.T.)
The chrono and the E.T. are both using a 4 x segment displays driven by a TM 1637 SMD chip.
The device type used is "TM1637 - 4 digits"
Both diplays are correct and in the right order.

Things go wrong when using the 6 digit configuration
I use a 4 x digit display tube and a 2 digit display tube (smaller size) for the seconds.
Digits are numbered this way
|1|2|3|4| |5|6|
H H M M S S

Here, the device type used is "TM1637 - 6 digits"
Let's assume the UTC time is 15:08:43
I get the time displayed as follows :
|0|5|1|3|4|8|

When ticking "reverse display" (for custom PCB) I get
|5|0|8| | |1|

1st digit goes to 6th digit
2nd, 3rd and 4th are offset by 1 digit to the left
4th and 5th digit are blank (seconds are not displayed)

Last, but not least, if I change the device type to a TM1637 - 4 digit I get a correct display of hours and minutes (seconds staying - of course - blank)

**Note **: I posted my issue with photos on 04/06/206 - 17:31 but without any helping or "me-being-stupid" feedback. 😀

I think this is the same issue as decribed by @lethal glade
Viewed from my side it seems there is a bug in the way the digits are sent to the chip when using the "TM1637 - 6 digits" device.

Can someone confirm this ? or do I have to rework my PCB design ?
Kind regards

covert needle
#

How are the digits wired to the TM1637? The correct order for wiring the digits was given here
#1492960981343666267 message

fathom latch
# covert needle How are the digits wired to the TM1637? The correct order for wiring the digits ...

Hello Jaime.
Thanks for your prompt reply.
This is how I wired up the displays. I designed my PCB based on both on the TITAN micro electronic datasheet you mentioned and the Arduino-FR-Site schematic.
Looking at what @lethal glade did, I would have to reverse the connexions 1 / 3 and 4 / 6 to get the 6 digit GMT correctly displayed.
But what about the 4 digit ones (Chrono and E.T) as they are working perfectly fine with the same wiring order ?
Do we need 2 different wiring depending on whether we use the 4 or 6 digits device ?
Again, using the "4 digits device" with 6 digits connected gives a correct display on the 4 first digits.

lethal glade
#

Hi @fathom latch , here’s the 4-digit diagram I use for my TCAS; it works fine

#

And here’s the 6-digit version

covert needle
#

I would not have any other explanation as to why the 4 digit cluster works OK.

#

If you apply 5v to pin 12 of the 4 digit cluster and GND to any segment, which led light up?

#

Assuming TM1637 uses common anode digits

fathom latch
# covert needle I would have to say it seems the digits in your schematic are wired backwards, u...

Pin 12 illuminates the right hand digit of the 4 digit tube.
In a 4 digit configuration, I can see that @lethal glade has the same wiring as I have except he's wired the reversed way (Right to left vs Left to right for me.)
With a six digit config, his wiring is different (e.g. : Grid 1 is linked to digit 3 in the 6 digit conf, but was linked to digit 4 in the 4 digit conf.)
What I can think of, looking at both schematics, is that the MF 6 digit device is driving 2 pseudo sets of 3 digits and not 1 single set of 6 digits.

covert needle
#

@lethal glade 6 digits config seems correct for 2x3 digits numbered from left to right on the digits side. The thing to remember is that, in this configuration, grid4 is connected to the rightmost position of the second display, which is totally different if using a 4 digit cluster, where grid4 would go to the left most position of a 4 digit cluster.
I don't know if that made sense.

#

And I am surprised that your 4 digit cluster lights up the rightmost position with pin 12. That indicates your particular 4 digit cluster is numbered from right to left, contrary to all digit clusters I have seen.

#

Clusters are most commonly numbered from left to right.

#

So pin 12 referring to Dig1 is usually the left most position, not the right.

#

Also please post a link to where you bought these digits as it would be good to know that this source sells digit groups wired differently.

covert needle
fathom latch
#

Jaime,
I gave you the answer too fast. Did the test again with my meter and pin 12 is indeed the left hand digit. My bad, apologies for this.
Well, to close this topic, I have to rework my schematic and order a new PCB for the 6 digit GMT display whilst keeping the 4 digits displays as they are.
Not very logical but I can live with that.😉
Thank you for your help.
Kind regards

fathom latch
lethal glade
#

Your welcome😁, yes I am French

fathom latch
lethal glade
#

à très bientot l'ami 👋