Timeout on I2C Write BUSY - not all the time [Adafruit 8x8 matrix backpack] #4876
Replies: 1 comment
-
Posted at 2019-12-19 by Mrbbp On an arduino there is no pullup resistor to add to circuit. i tried with a try catch and resend a I2C.setup() (read it in the forum) in the resend with no more result.
other idea? Posted at 2019-12-19 by @allObjects Bonjour M. Mrbbp, 1st thought - looking at the schematics w/ the HT16K33 - was VDD 5V... a) I assume you supply enough of the 5V to the board. I could imagine that there are power spikes / brownouts when starting to send things to the controller... Direct supply from the 5V source may help... Don't know if you need a cap. I'm surprised that it does also not work all the times with a Arduino, when reading your comment correctly. I see though applications working that use only S1 Lithium Battery - 3.7V, max 4.2V when freshly charged -https://learn.adafruit.com/trinket-slash-gemma-space-invader-pendant/wirin b) Since pins of STN32 on PICO are 5V tolerant, you are fine except may be for the high signal of PICO. I see 10K pull-up resistors of 10K on the LED module: https://learn.adafruit.com/adafruit-led-backpack/downloads - therefore in seams that in no environment a resistor has to be added (but with multiples connected they have to be removed on all but one - best is last in 'chain'). It may be that the high signal and it's flank are not good enough... d) I do not know about the pin mode PICO is in when just using it straight away without setting. I would expect it to be 'output open drain', but you setting it could help, because I experienced spikes in the past with Espruino's e) My last straw would be to put a (Schottky) diodes with ring / cathode (-) towards PICO in the lines to give an extra 0.5..0.7V relieve to the resistors on high signal... Btw, about a year or two ago I bought this adafruit charlieplex 16x8 LED matrix https://learn.adafruit.com/adafruit-charlieplex-bonnet, but I could not get it properly to display a matching Espruino Graphics display buffer... May be you have done something with that display? I got inspired by you installation with the deer(?) on a tin... and ot is still to come alive for the answer to your flip-dot-generosity! Posted at 2019-12-20 by Mrbbp Hello @allObjects M... a/ i power the board and the display with usb from my macbook. I've tried with a 700mA phone charger, it inconsistently... After some time unplugged, when i plug the circuit with 5v, it does not initialize at first time... have to switch off/on (plug/unplug) few time and the display start. (as an old car or a cold engine that need a starter) b/ not sure to understand what you mean (sorry) c/ no c/ d/ i've tried
not better. e/ I'll try tomorrow. I think i have a plastic bag full of these black diode... (i used it to stepdown current for led...is it the same?) (dont remember the ref... N4007 (in smd and old fashion black cylinder?) thanks for your advice... Posted at 2019-12-20 by Robin Thr 2019.12.19
Hello @mrbbp, would you be so kind as to upload the output for the above snippet? Although L1,L2,L3 and L13 are not adding any value here, (as I2C is not setup by L2, an immediate error should be thrown - maybe the intention of the outer try/catch?) the output should fill multiple "try again" messages with two bytes placed on the I2C bus each 100msec, unless/until an error is detected, in which case "does not init < error msg detail here >" should display. Effectively, you have the looping mechanism you are after. 100msec may be too fast for the left hand console panel of the WebIDE to keep up though. Any additional detail in the WebIDE console output? Posted at 2019-12-20 by @allObjects 1N4007 will do. But it looks that something else is at fault... you remember that there were some cold solder points in the flip dot boards... flippy behavior can come from that... ...yep c) somehow got skipped... - ignore regarding b): the module has on-board resistors to pull the data and clock lines up. the resistors are 10k resistors. My comment is: if you would have multiples of these modules on data and clock lines, only one should have resistors connected and all others not. And when multiples are connected, usually the driving device is at one end at the wires - where also ground is connected and power is fed - and the last module - on the other end of the wires - would be the module with the resistors. If more than one module keeps the resistors on, the pull-up force becomes with a certain number of modules too strong to be pulled down for any of the devices. Posted at 2019-12-20 by Mrbbp @robin
and the output.
Posted at 2019-12-20 by Mrbbp i tried in a dirty way by adding some time in each command (a blank loop) and a try catch.
Posted at 2019-12-20 by Mrbbp ok understood! :) Posted at 2019-12-20 by @allObjects Surprised about duplicate setup in line 14 in post #7. I think that line should be removed... Same for the duplicate setup in post #8: line 19 should be removed. The time killer loops in lines 31..33, 39..41 and 51..53 cause problems because they hog the cpu and nothing else (js-wise) can happen during that time. Wait by burning cycles does not exist / does not work in Espruino... to the contrary, it will break the execution... 'Waiting' has to be done with 'deferred / timed-out resume (w/ Does the module have a reset command? If so, I would send that before sending the command for turning on the oscillator. Try something like that - my ugly chained steps with retries on timeouts...
Another - better looking approach would be nested/chained promises w/ (global) retries that is set / reset at the right spots. PS: Code not tested (yet) Posted at 2019-12-20 by Mrbbp Gorgeous @allObjects! My crappy solution seemed effective but it was an evidence there was a better, nicer code structure to write to do this. it seems if it catchs an error even with the tries it fail to initialize the display... just a small misspelling throw rather than trow (i'm unfamiliar with this command). Thanks again. I do not see a reset command in the doc é. ps: clearInterval() was seen in a forum post about timeout
i added led pulse to have visual feedback without a console... Posted at 2019-12-20 by @allObjects ...and with a variable you can control the logging - even when connected - and enhanced with a watch dog for setup - sDog - which - if setup not successful - restarts. Timing may be adjusted because it is dependent on all the retries w/ the timeouts cumulated plus some reserve and pause that can and should happen under its watch. You may setup another watch dog for running / sending the texts / grpahics ( PS: é, I like the francophonisation of - not just - les noms... <;:{ooops}>>>
Posted at 2019-12-20 by @allObjects Had some after thoughts: does module have a busy status? If so it would have to be read and checked before sending new commands / data... that could have been the issue whit not working reliably... but working when retrying with timeouts... Posted at 2019-12-20 by Mrbbp some infos about the I2C from the IC doc there is no busy pin on the driver board. Posted at 2019-12-20 by @allObjects I'd not have expected a busy pin but a register that can be read whether the controller is busy or it would respond on a command to not have accepted it because being busy. I have to read up on the HT16K33 controller. The lines cannot be read for it because the data line changes between input and output and the clock is always (open) output (because of stretching by client). Posted at 2020-01-13 by Mrbbp @allObjects, regards é. Attachments: Posted at 2020-01-13 by @allObjects @mrbbp If the higher control current does not straighten out eventual bad signal flanks, I have run out of ideas. Other than question the modules compliance... it though comes from a reputable source.. Posted at 2020-01-13 by Mrbbp Ok, i stop to try to work with the ht16k33 and return to the « good old shit » alias the max7219. Thanks for your help @allObjects Ps: i tried to remove the 10k with just a bridge... and with a 4k7... no more results... grrrrrrr Posted at 2020-01-14 by Robin Mon 2020.01.13 Thread noob creative electronics enhancement observation.
In post #3 e "(Schottky) diodes" Isn't the 1N4007 just general purpose? Posted at 2020-01-14 by Mrbbp And so. Can you be more specific. Have you a ref on ebay? I will try later... when i’ll have got some |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-12-19 by Mrbbp
Hello,
i'm working with a pico and an Adafruit 8x8 matrix backpack (HT16k33).
I setup the I2C and initialize the display
Some time (i'm unable to find a recurrent way, it come on a software upload or a switch on) the display does not start, with an I2C timeout (in the console)...
I've tried with decay for writing command..
same prob.
Any idea?
It is not a wiring pb (cause most of the time it work)
thanks for yopur help
Beta Was this translation helpful? Give feedback.
All reactions