Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Halt when useing RP2040 with TM1652 #42

Open
YeWuChen opened this issue Oct 31, 2023 · 3 comments
Open

Halt when useing RP2040 with TM1652 #42

YeWuChen opened this issue Oct 31, 2023 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers

Comments

@YeWuChen
Copy link

YeWuChen commented Oct 31, 2023

I tried using RP2040 to drive TM1652, but the example would crash and Windows would prompt an unrecognized USB devices.
But I can use hardware serial to driven TM1652, just use 'Serial2.begin(19200,SERIAL_8O2);' and set the TX pin to hardware serial pin, just
pay attention to the initialization, need to add a about 6ms of delay between the cleardisplay and send command.

Arduino IDE version: 1.8.19
RP2040 version: 3.6.0 by Earle F. Philhower, III

And there's my code:
my_TM1652.zip

It would be great if this library could be used hardware serial with all the good features of TM16XX library!

@maxint-rd maxint-rd self-assigned this Oct 31, 2023
@maxint-rd maxint-rd added bug Something isn't working enhancement New feature or request good first issue Good for newcomers labels Oct 31, 2023
@maxint-rd
Copy link
Owner

maxint-rd commented Oct 31, 2023

Hello @YeWuChen ,
Thank you for submitting this issue. It's great to read you found a workaround for the issue you encountered.

Some time ago I encountered stability issues with the TM1640 on RP2040. (See the short video clips in those posts). Unfortunately even after using a better scope, I wasn't able to determine the cause. I'm definitely no expert on the RP2040. Perhaps your findings can help to implement a solution of some sort. From what I recall I've not done any testing using hardware serial on the RP2040. Also I have not tested all TM16xx chips in my collection with the RP2040.

I think I need to do some more testing on the RP2040 to see what issues I can reproduce and if possible fix. Unfortunately my work on the TM16xx library is limited to the spare time I have available. Because of that it may take quite some time before I can respond with my findings. I will keep this issue open until I've done so.

BTW. which example code did you use that halted the RP2040?

@YeWuChen
Copy link
Author

YeWuChen commented Nov 1, 2023

Hello @maxint-rd ,
Thank you very much for your reply! I used the two examples TM16xx setSegments and TM16xxDisplay_Print, and modified the header files and classes in the examples to TM1652, and set the pin and parameters.Both examples resulted in the RP2040 halted,So I didn't try other examples, but these two examples with modified header files and classes to TM1652 programmed into my Mega2560 worked fine!

With best wishes.

@maxint-rd
Copy link
Owner

FIY: During recent work on developing a generic class to support untested TM16xx chips, I used the RP2040 to test things. I fixed the halting issue for RP2040 (and also some other MCUs) by introducing a begin() method with implicit initialization that replaces blocking time related calls in the constructor. You can find that fix in this repository branch. It is expected that in due time that fix will be merged into the main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants