7 segment display reverse digits

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Message
Author
User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: 7 segment display reverse digits

#51 Post by jph »

Hi Keith the tm1637 6 digit is NOT wired 543210 :shock:
using a convention of the left digit to right digit - 2,1,0,5,4,3 .... I don't think this has clicked yet ?

Manipulating strings is not just reversing as you know. If you know how the output would appear then you can rearrange the string to suit.
You can remove the decimal place first if you wanted to and then manipulate the string, or, stuff it into an array - table or whatever lua calls it - and do a sort on the individual characters to build the new one. Just treat each incoming number as 8 digits, including spaces and allowing a pointer for the DP, then you can shuffle the numbers as you like in LUA then reform them.

As it is, I don't / won't bother at all as I have absolutely no plans to send any formatting information from am. For example, a frequency in the format of 123.45 would be sent directly as received from X-Plane dataref as a float (32 bits) (not as a formatted string) with a UID for the device - for example, all my displays in the pedestal may be numbered from 0 to 21 (by display I mean an actual complete block display like nav1 active or nav 1 stby) , and mapped to start at, say, ID 100 so I have 100 to 121. It is all customisable and you have 65536 UIDs per MP Channel so plenty to go off. For a lot of things you only need to send a UID which is mapped to an acton - as in toggle active STBY nav1.

ALL the displays in one area - say the pedestal, are simply mapped to a UID as above. When the dataref changes all AM needs to do is send the actual number with no conversion along with the unique identifier of the device (ie 101 for NAV1 STBY) and the PICO does the rest. AM code is simpler and the PICO code is also simple. Both ends have 'constants' defined for the UID mapping that are appropriately named to follow ZIBO / XP naming convention directly from ZIBO documentation so it is mostly a copy paste. Yes, the code has to be set up in the PICO and in AM but it is fairly simple. You know from the UID what to expect and where it goes and you simply route it there.
I estimate that 1 pico can probably run the whole pedestal unit. That is the true power of AM when used in a fully customised way with messageport - ALL messageport for something like the Zibo, along with modern processors and custom interface cards of course but the processors are cheap and the interface cards you make yourself. For normal 'single' led outputs I am planning on using the TLC954x series 16 output PWM serial controlled led drivers and for any other outputs the TPIC6B595 which is like a ULN2803A but in a serially controlled shift register (SIPO) - both devices can be daisychained and operate from Hardware PWM so dont even tickle the PICO as it is offloaded to internal compute units. You can have as many outputs as you need, literally .. all capable of high power and PWM. Same with inputs but using the 74HC165 PISO units. These are less less than 2 dollars each - GENUINE ! - from mouser - not Chinese copies. The only chinese ICs will be using are the 7219 units as you don;t want to be paying 25 dollars :shock: :lol: EACH for the 'real' ones lol Here you see the real power of AM - but, we are going off topic. ........ Let me ponder your larger schematic...
I have ordered a new microscope for smd PCB work, I thought I might have to wait for it to arrive for the last schematic :) :)
Joe
Joe. CISSP, MSc.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: 7 segment display reverse digits

#52 Post by jph »

Hi Keith, I have a migraine so it's probably me ;) .. but your schematic appears to have the displays wired in the wrong order. D0 of 7219 u2 for example, should that not go to the appropriate 3digit display G3 ? - not G1 ? .
The standard max module is, I believe, wired with D0 to the right hand side digit ('Least Significant Digit' lets call it) so the order on the common module is 7.6.5.4.3.2.1.0
If AM is happy with this then would it not be better for you to keep the same standard then no conversion is needed with AM, just normal formatting / padding. ?
your module should therefore be wired - assuming 2 x 3 digit with G1,G2 and G3 from LEFT to RIGHT - with 7219 D0 to 3 digit module 2 G3, D1 to 3 digit module 2 G2 and D2 to 3 digit module 2 G1... etc ?
Joe
Last edited by jph on Mon Aug 29, 2022 10:48 am, edited 1 time in total.
Joe. CISSP, MSc.

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: 7 segment display reverse digits

#53 Post by Keith Baxter »

Joe,

I am not doubting your TM1637 6DIG board is wired as you say.

This TM1637 6 GIG seems to be wired 012-345. There is no schematic but if you look at the PCB tracks.

https://www.mpja.com/download/35057tebasic%20manual.pdf

So it seems that there are various ones.

I will recheck the schematic and revert.

I am using these displays. The pinout is at the bottom of the page.
https://www.aliexpress.com/item/1005003 ... 72328766_2

Keith

EDIT: Sorry I might be confusing you. GRIG1 GRIG2 GRIG3 - GRIG4 GRIG5 GRIG6
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: 7 segment display reverse digits

#54 Post by jph »

Keith Baxter wrote: Mon Aug 29, 2022 10:40 am Joe,

I am not doubting your TM1637 6DIG board is wired as you say.

This TM1637 6 GIG seems to be wired 012-345. There is no schematic but if you look at the PCB tracks.

https://www.mpja.com/download/35057tebasic%20manual.pdf

So it seems that there are various ones.

I will recheck the schematic and revert.

I am using these displays. The pinout is at the bottom of the page.
https://www.aliexpress.com/item/1005003 ... 72328766_2

Keith

EDIT: Sorry I might be confusing you. GRIG1 GRIG2 GRIG3 - GRIG4 GRIG5 GRIG6
Hi Keith, no, I am absolutely 100% correct on the 6 digit TM1637 units.
The datasheet you link to doesn't use a TM1637. It, is an old design using a dedicated microprocessor, a Microchip PIC16F628A ...... Forget that one. Not even of the same type.

Be cautious on those aliexpress displays - in the area of - which colour do you want to order ? - They haven't got a true amber - presuming you want amber (orange) ? and the price is - not cheap - if you actually select the 'nearest' colour the price shoots up to 26 euros with postage... I can link you directly to the manufacturer for the correct amber ones if you like ?

oh, to add, no, not confused with the grid numbering. the datasheet for all the 3 digits are the digit numbering and layout convention,

Joe

ps, what a cracking drive yesterday eh? -Max is de nieuwe baas ! :mrgreen:
Last edited by jph on Mon Aug 29, 2022 11:06 am, edited 2 times in total.
Joe. CISSP, MSc.

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: 7 segment display reverse digits

#55 Post by Keith Baxter »

Joe,

You are correct. I have fixed it. Thankfully I have not had the boards made. Just 3D printed them to test.
Schematic_Com Radio Boeing 737_2022-08-29 (2).pdf
(160.58 KiB) Downloaded 60 times
IMG_5577.jpg
IMG_5577.jpg (29.35 KiB) Viewed 754 times
IMG_5578 (1).jpg
IMG_5578 (1).jpg (26.86 KiB) Viewed 754 times
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: 7 segment display reverse digits

#56 Post by Keith Baxter »

Aybo Joe,

This is what I see.
ice_screenshot_20220829-130257.png
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: 7 segment display reverse digits

#57 Post by jph »

Keith Baxter wrote: Mon Aug 29, 2022 11:04 am Aybo Joe,

This is what I see.

ice_screenshot_20220829-130257.png

Keith
thats not what the link on the page says :D
They are also huge displays, 0.56".. massive.. are they even available? not that they would be of much use unless you want a clock... 8-)

I will find some of my special stash of displays in a minute. :D
Joe. CISSP, MSc.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: 7 segment display reverse digits

#58 Post by jph »

That module is for an frequency with IF offset reading in a transceiver, it's a one off, perhaps it has both the pic and the tm?. Seems a crappy design as it could have all been done from the pic with mux and no TM if there is one... anyway, it is nor relevant as it is for a specific purpose ;) forget that one..
Joe. CISSP, MSc.

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: 7 segment display reverse digits

#59 Post by Keith Baxter »

Joe,

I did try and see if I could trace these but ihe image is too dark.

https://www.aliexpress.com/item/1005001 ... F8LI0a4u0N

There is a lot of useful info shared having these conversations.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: 7 segment display reverse digits

#60 Post by jph »

Keith Baxter wrote: Mon Aug 29, 2022 11:21 am Joe,

I did try and see if I could trace these but ihe image is too dark.

https://www.aliexpress.com/item/1005001 ... F8LI0a4u0N

There is a lot of useful info shared having these conversations.

Keith
:lol: you are determined I will give you that :D .. I have the same one here in pieces. I program it at it's base register level. I assure you that is the order.
The thing you may not be realising is that when you write the low level driver for the thing then it doesn't really matter what order they are in as you 'correct' it in the driver. It is the same with a 7219. you don't 'write' a number like 123 to the 7219, you tell it exactly which digit (same as the digit pin number) and what the binary value is for the segments, you then do that 8 times, in any order you want. That is the LOW LEVEL driver.
When you see, say, an Arduino library then all this is done for you. There is, for example, an arduino library for the TM1637 6 digit that takes care of the 'harry potter' digit ordering .... the user never sees what is under the hood.
I program the 7219 with that code I listed earlier. it is used to write a binary number to a specific digit, that is how the chip operates but again, the user never sees that if you bring it out to a library / class.
If you want to set a digit on second 7219 - at low level, then you send the appropriate 16 bit command which contains (simplified) the 8 bits for the segment and DP and 3 bits for the digit address and a No-oP (no operation) command. the data is then sent out MSB first - so backwards if you will and the first 7219 receives a No-oP so knows the data is not for itself and the second actions the data. You can only send data to one digit at a time on the 7219, so again, at low level driver level the concept of ordering is not really a big deal. It IS better to have them in order as the binary digit register can be incremented more easily but computers are very very VERY good at doing things incredibly fast so it doesn't matter. I mean, the pico is doing something like 240 million operations per second - and you have dual cores that can run independently of each other (more or less) so arranging a mere 8 digits is a matter of NANO seconds.
Have a look at the 7219 datasheet and the code I posted earlier. You can see the code follows the datasheet registers.
I do agree with you that these conversations are definitely really helpful, informative and great fun. ;) - it's a good job we both appreciate each others diverse sense of humour haha
Joe
Joe. CISSP, MSc.

Post Reply