Yet another TM1637 7 segment version. (Resolved)

Moderator: Benj

chad
Posts: 151
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 26 times
Been thanked: 32 times
Contact:

Yet another TM1637 7 segment version. (Resolved)

Postby chad » Sat Jan 11, 2020 4:30 am

Hello,

I picked up some of these from amazon.
https://www.amazon.com/diymore-Display- ... =UTF8&th=1

It uses the TM1637Display.h lib for Arduino.
https://github.com/avishorp/TM1637/blob ... 7Display.h

I Have tried all of the FC components and didn't have any luck. Could you take a look?
I couldn't find a schematic for it. I'll keep looking..

Thanks,

Chad
Last edited by chad on Tue Jan 14, 2020 10:53 pm, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 14655
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4644 times
Been thanked: 4267 times
Contact:

Re: Yet another TM1637 7 segment version.

Postby Benj » Mon Jan 13, 2020 11:25 am

Hi Chad,

There doesn't look to be anything untoward in that header file that isn't compatible with our components. Is there any other source files to go with that header?

I have some diymore ESP boards and these do work ok so presumably it should be ok?

If you find anything further then let us know. You could also maybe use a multimeter to work out the connections on the board.


One thing I spotted is this in the .cpp file.

#define TM1637_I2C_COMM1 0x40
#define TM1637_I2C_COMM2 0xC0
#define TM1637_I2C_COMM3 0x80

in our code I beleive we use the TM1637_I2C_COMM2 option. I can turn this into a property if that would help.


Edit, sorry no this is a red herring, we use all three addresses as in the .cpp file already. Have you tried setting the brightness?

DirkB
Posts: 113
Joined: Wed Feb 08, 2012 2:45 pm
Has thanked: 7 times
Been thanked: 11 times
Contact:

Re: Yet another TM1637 7 segment version.

Postby DirkB » Mon Jan 13, 2020 4:24 pm

Hello,

have you connected pull up resistors (10K) to the i2c port?

regards

Dirk
These users thanked the author DirkB for the post:
Benj (Mon Jan 13, 2020 6:08 pm)
Rating: 5%
 

User avatar
Benj
Matrix Staff
Posts: 14655
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4644 times
Been thanked: 4267 times
Contact:

Re: Yet another TM1637 7 segment version.

Postby Benj » Mon Jan 13, 2020 6:09 pm

Good suggestion Dirk, This recently caught me out with a Grove display. Depending on your MCU you might be able to use internal pullups with a line of C code.

chad
Posts: 151
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 26 times
Been thanked: 32 times
Contact:

Re: Yet another TM1637 7 segment version.

Postby chad » Tue Jan 14, 2020 1:34 am

Hi guys,

I tried adding pull-ups didn't make a diff. I have tried three of the modules and none of them work.
I am using the f303 nucleo just for testing because it was handy. ST issue?

I can see stuff on the clock and data line on the scope, I have tried common cathode and anode. And I have set the brightness and turned on the display in the code.

I'll play with it some more tonight. I will also look and see if there is any other code for it. I have seen people get it up and running on arduino with that code..

Hmmm
Thanks,
Chad

mnf
Valued Contributor
Valued Contributor
Posts: 625
Joined: Wed May 31, 2017 11:57 am
Has thanked: 56 times
Been thanked: 343 times
Contact:

Re: Yet another TM1637 7 segment version.

Postby mnf » Tue Jan 14, 2020 6:49 am

Looking at the data sheet - the tm1367 doesn't use i2c - uses a two wire interface with clock and data..

This looks very similar to the max7219 interface (send command then data) Note there is no slave address.

I think it should be possible to modify the max7219 library to work here - fairly easily - I can post you the source - the seven segment side got rather neglected but did work.... I don't have one of the Tm1367 displays to try - will have a look on Bangood.

Martin

chad
Posts: 151
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 26 times
Been thanked: 32 times
Contact:

Re: Yet another TM1637 7 segment version.

Postby chad » Tue Jan 14, 2020 7:23 am

Ok So I did some testing.

I have another tm1637 display. I tried it and it works with flowcode. Same basic thing just smaller / cheper.
I also dug out an arduino and hooked it up. The small display works fine. And the bigger ones from the amazon link also work.
So for some reason FC works with one and not the other but both work on an arduino using that .h.

?

CHad

User avatar
Benj
Matrix Staff
Posts: 14655
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4644 times
Been thanked: 4267 times
Contact:

Re: Yet another TM1637 7 segment version.

Postby Benj » Tue Jan 14, 2020 11:04 am

I might have it,

The .h file seems to override the bit delay from 50us to 100us.

I'm making a new version of the component with the delay set via a property so you can override it. Bear with me and I'll push it to the update system.

User avatar
Benj
Matrix Staff
Posts: 14655
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4644 times
Been thanked: 4267 times
Contact:

Re: Yet another TM1637 7 segment version.

Postby Benj » Tue Jan 14, 2020 11:14 am

There now :D

chad
Posts: 151
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 26 times
Been thanked: 32 times
Contact:

Re: Yet another TM1637 7 segment version.

Postby chad » Tue Jan 14, 2020 9:46 pm

That seemed to do it! Thanks

Looks like this rev of the chip likes a little higher delay.
Thanks !

Chad
These users thanked the author chad for the post:
Benj (Wed Jan 15, 2020 3:06 pm)
Rating: 5%