#The digit reversal function on the TM1637 is not working
1 messages · Page 1 of 1 (latest)
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.
@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?
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.
Post a screenshot of the output config display tab
Ok you have all digits enabled
Not sure what's up, that reverse digits was added before tm support if I remember right
That was the theory we had—the function would only work on the Max7219, which has 8 digits.
Not sure which datasheet is that. I found this one from Titan Micro Electronics showing GRID1 to the the rightmost digit.
So that's consistent with my wiring
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.
Oh, I see, but then I should have gotten 321654 if we follow that logic
Digit cluster 1 2 3 1 2 3
TM1637 GRD 6 5 4 3 2 1
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?
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
With my old PCB, all the numbers were reversed, so normally if I reverse the wiring, it should be right
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
I'm going to set up a breadboard tomorrow to test it out, and I'll let you know how it goes.
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?
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
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
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
Yes, the TM1637s are common-anode compared to the Max, which is common-cathode.
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 ]
Here's the pattern if it helps
as in [123][456]
so is this with "reverse digits"?
because it feels like it doesnt make sense? or I need more coffee 🙂
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
Yeah, that's right
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?
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
It's no big deal 😉; it helps us find small bugs, which is helpful.
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
I ordered some new PCBs—with the right order this time
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.
yes it's that
The FW does not know if the digits are reversed or not. The digits get displayed as they come from the connector.
It can be seen in the log what get displayed
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;>.
Hmhm, let me check the code...
I only have a 4 digit tm1637 module
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.
and the UI does not allow specifying 8 digits for TM1637
In this particular case, it seems to me the digits reverse function does not take into account only 6 possible digits for TM1637.
Ralf, could you please confirm if the chip wiring assumed by the firmware is like this (which makes no sense to me)
2x3 Digits 1 2 3 1 2 3
TM1637 Grid 3 2 1 6 5 4
They get be send one by one in a row, but not sure if from left to right or vice versa as standard for now.
that would be my expectation too, but the above sequence I showed is NOT consistent with sending one by one digits in a row.
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?
Can't it be choosen between 4 and 6?
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
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.
Is it possible to change the mask manually from mobiflight?
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
I opened a new bug report
https://github.com/MobiFlight/MobiFlight-Connector/issues/2902
Describe the bug Reported in Discord discussion link https://discord.com/channels/608690978081210392/1492960981343666267 The reverse digits option in 7-segment displays using TM1637 is apparently u...
Ohh didn't see that one. I will close mine.
I checked yesterday, but there's nothing about the mask in it. I'm at work, so I don't have access to it right away for a screenshot.
yea ok
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?
I wonder what happens if you reorder those digits?
Where exactly do you want me to change the order of the numbers?
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
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?
it wont work
Oh, well, my theory goes out the window 😂😂
i really think we should take reverse mode out of the displays and into a modifier
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.
we should have some way to make more modifiers easier too
they should be the primary way to configure things perhaps?
to format data
yes, the reverse logic on the 7-segment device side is a bit more complicated.
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.
IIRC the decimal point position and selected digits still needs to be changed when using the invert option.
not if you enable "reverse digits" on the device/.
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.
Don't know what you mean. If you have a 4-digit group connected to max7219 in positions 4 3 2 1, the reverse digits option sends those digits to positions 8 7 6 5, requiring you to change the digits and decimal point selected in the display tab
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.
yes. thats also true.
With the new PCB, it's works great
great!
It's much better in order this time 🤣
Is this with or without reverse digits on?
It's without the reverse digit function, the order of the digit is correct this time
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
How are the digits wired to the TM1637? The correct order for wiring the digits was given here
#1492960981343666267 message
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.
Hi @fathom latch , here’s the 4-digit diagram I use for my TCAS; it works fine
And here’s the 6-digit version
I would have to say it seems the digits in your schematic are wired backwards, unless your digit clusters are weird and are numbered from right to left.
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
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.
@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.
Mobiflight has nothing to do with this. It sends the digits in order for display though Grid 1 to 6 (Grid1 being the rightmost position). Where these terminals are wired to, is up to the circuit designer.
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
Hi Rio,
Thanks for your help. I have to modify my design and get me a new PCB😉
BTW, are you French ?
Your welcome😁, yes I am French
So i'm I. A bientôt peut-être pour de nouveaux problèmes 😁
à très bientot l'ami 👋