Go Down

Topic: is sprintf incompatible with I2C LCD? (Read 153 times) previous topic - next topic

Geek Emeritus

I have a clock program I thought it worked well until I hard mounted everything. now that I can leave it running I have endless problems with corrupted or locked up displays. It runs about 36 hours, then locks up or shows random characters.

the displays that lock up are driven with sprintf. sometimes the backlight turns off. I was using 2 16X2s. I moved those functions to one 20X4. same results

The cable is about 3 feet long. 4.7 K pullup resistors at the terminal board on the 5 display panel, in common with all displays. I have an I2C buffer module coming.

Is this related to sprintf, or just a coincidence?

somebody is going to say publish the program. It's 9 k. it uses a particular library and a particular I2C backpack. if I post it, one of our perennial fault finders will jump in. so, no, thank you.
All PMs will be deleted unopened due to arrogant argumentative pot stirring Malfoys.
 If you have not read "How to use this forum - please read", in particular: "7. If you are posting code or error messages, use "code" tags":  expect rude responses

PerryBebbington

#1
Sep 15, 2020, 10:30 pm Last Edit: Sep 15, 2020, 10:30 pm by PerryBebbington
Quote
Is this related to sprintf, or just a coincidence?
Unlikely. If it was it wouldn't work at all.

Are you using Strings (capital S)? What you describe is the kind of random problem Strings cause. Also static damage will cause random problems.

Do you know if the program is stopping when the display freezes? Do you have a run LED?

Do you have decoupling capacitors all over the place?

Try lower value resistors, maybe 2k or something.

Photos please.

noiasca

somebody is going to say publish the program. It's 9 k. it uses a particular library and a particular I2C backpack. if I post it, one of our perennial fault finders will jump in. so, no, thank you.
blabla. If you don't want to show your 9k code, make 10 liner showing the problem.
how to react on postings:
- post helped: provide your final sketch, say thank you & give karma.
- post not understood: Ask as long as you understand the post
- post is off topic (or you think it is): Stay to your topic. Ask again.
- else: Ask again.

ballscrewbob

@Geek Emeritus

No code, No pics, No schematics, That doesn't really help anyone to help you.

Best guess is the 3 foot cable introducing spurious noise factors from local devices.

My next guess is that the red wire is upside down  :smiley-grin:

It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google (who would have thunk it ! ) or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

Paul__B

somebody is going to say publish the program. It's 9 k. it uses a particular library and a particular I2C backpack. if I post it, one of our perennial fault finders will jump in. so, no, thank you.
So by "perennial fault finders", you mean the people who understand what the problem is likely to be?  Tough!  :smiley-roll:

If you used a (capital "S") String, then that is the fault.  :smiley-lol:

Geek Emeritus

no capital s string

if you leave serial monitor running, you can see the clock updating. it's a display problem.

the red wire can't be the problem. I'm using circular polarized DC
All PMs will be deleted unopened due to arrogant argumentative pot stirring Malfoys.
 If you have not read "How to use this forum - please read", in particular: "7. If you are posting code or error messages, use "code" tags":  expect rude responses

ballscrewbob

Ah a display we cannot see using code we cannot see built using a schematic we cannot see.

My serial monitor updates just fine as does my display but then again I cannot tell you what I am doing to get such fine results.

C'mon you know better than this !
Either add some details as requested or I will just throw this in the shark tank and have done with it.

It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google (who would have thunk it ! ) or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.

UKHeliBob

#7
Sep 16, 2020, 07:59 am Last Edit: Sep 16, 2020, 08:02 am by UKHeliBob
Quote
is sprintf incompatible with I2C LCD?
That question is easily answered

sprintf is not incompatible with I2C LCD

However your use of sprintf() (which we have not seen) and/or your use and connection of the I2C LCD (which we have not seen) may be incompatible or more likely just plain wrong
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

PerryBebbington

#8
Sep 16, 2020, 08:46 am Last Edit: Sep 16, 2020, 09:29 am by PerryBebbington
The red wire can't be the problem. I'm using circular polarized DC
In my experience when you use circular polarised DC you have to be careful to get the polarity of the neutron flow the right way, try reversing it.

Set the clock speed of I2C lower. Use lower value resistors.

Beyond that without all the information you know you need to provide it's impossible to help.

Paul__B

In my experience when you use circular polarised DC you have to be careful to get the polarity of the neutron flow the right way, try reversing it.
But there is the question!  Should you cross the streams, or should you not cross the streams?


Go Up