-
Notifications
You must be signed in to change notification settings - Fork 28
switched the thingpuls SSD1306 lib to a custom fork #220
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
Conversation
added a restart function to display.h that clears the grid, sends init commands to the display and restart its This will heal display glitches. This is performed every ~120 sec
Actually there is no need to fork the display driver. Adding: class MySSD1306 : public SSD1306 {
public:
void restartDisplay() {
sendInitCommand();
resetDisplay();
}
}; to the Does it introduce a "flickering" during the re-init? |
Ahh this is the point, were you can see I am coming from ANSI C. Stuff like that isnt online possible in C++ Yes this introduces a short flicker every 2 minutes. But at the same time it fixes glitches DisplayglitFix.mp4 |
So no fork of display driver is needed timestamp for reset is no calculated via millis()
If this will be merged, the fork of the display driver can be deleted |
Sorry, I did not feedback further... What is not clear with the video. Does it also flicker if the display was not glitched? |
Yes it sadly does a short flicker every ~2 Minutes even if all is fine. The problem till here is, that we have no indicator softwarewise to see if the display is glitched. Would be nice to have, but I think if you check the positions, it will be return expected values, even if glitched. |
Might be we add an option. On the other hand, the current OBS of @Natenom does not have the issue any more? |
Yes to have a config option might be good. This problem wasnt Natenom exclusive anymore. I programmed this after Markus reported this with one of the 00.03 devices. |
Sounds more like an electrical issue. Can we not get to the bottom of this instead of patching it up software-side? Does one of the owners of an affected device have an oszilloscope? |
I dont think this would be easy to track down with an oszilloscope. You have to find the problematic Signal AND the luck that the 20pF of the probe doesnt fix the problem temporary! Furthermore we have to take into account that, what ever this proble is, will also accoure to fewer experienced users. Yes, this shouldnt be a permanent thing, but if users have that glitch and no clue where it is coming from, this is a better solution than restarting the whole device |
1 similar comment
I dont think this would be easy to track down with an oszilloscope. You have to find the problematic Signal AND the luck that the 20pF of the probe doesnt fix the problem temporary! Furthermore we have to take into account that, what ever this proble is, will also accoure to fewer experienced users. Yes, this shouldnt be a permanent thing, but if users have that glitch and no clue where it is coming from, this is a better solution than restarting the whole device |
I just thought, if it affects multiple people, it might be a design flaw. If it's too high bus capacitance on I2C, the usual might help:
To verify that it's the bus capacitance, a scope would be needed. The probe capacitance would only make it worse, no? ;) I've done some research on this. Looks like it would probably be the issue to me: The cable used in my OBS is a LifY11Y, whatever that means. Google spits out this info on that type of cable. It specifies 110nF/km capacitance. For the ~1m of cable I have that would be already 110pF. Add some stray capacitances on the board, the input and output capacitance of the devices. So we're at maybe 150pF or 200pF. We're running the I2C at 500kHz (which is a weird non-standard clock rate, but okay). According to this (TI SCPA054) that means a max capacitance of 400pF, or somewhere in that region (again, we're running a nonstandard clock). Oh, and then we have 10kOhm pullups on SDA and SCL. That sounds way too much. I've found a reference from SCPA054 to this nice document: SLVA689, titled "I2C Bus Pullup Resistor Calculation". In there, the example (section 4) is exactly our case: 200pF, 3.3V VCC -> R should be between 1kOhm and 1.7kOhm. We're running even faster, so maybe 1.2k or 1.5k might be a good choice. Even with only 100pF at a bit faster rate, I get 2.2kOhm as the max. All of this is assumptions. Sadly, I don't have an oscilloscope. But I think this is an obvious thing to test, since a) the numbers look like they are wrong, and b) it's not hard to spot too slow rise edges on SDA/SCL lines with a scope if you know a little bit how to use it. That's why I suggested it. |
All what you wrote to the capacitence stuff is right, I checked and calculated this stuff some months ago too, and came to similar results.
What in mind was, is a bad ground or VCC connection. This can result in a glitchy reference potential. With this the reference voltage (GND) floats a little bit and can be changed or better distorted from external immissions like RF transmissions or 50Hz mains hum. The problem is, if you want to measure that, the 20pF of the oszi probe can be enough to pull anything to a "good enough" GND potential that is strong enough to fight the immissions! This were my concerns, not the bad rising edge. |
That's good to know. I unscrewed mine and checked, 1011 or 1101 SMD code means ~1kohm. Good. I got the 10k from here: That's on the "merged" branch, and it is apparently only on the PCB (which I looked at to see what shape the traces have) but it is at 1.2k in the schematics. So a PCB update would be needed.
Well, is it possible that the problem only occurs on OBS devices with the BME/BMP sensor installed? In which case, there might be your culprit...? |
Ahh yes, I didnt imported the netlist to the pcb. I have that value layer hidden most of the time. Douh! This is just the combination of an I2C buffer AND multiple I2C devices! Just 2 or 3 more I2C devices and no buffer works fine, at least for me. |
Outdated - change not needed any more. |
added a restart function to display.h that clears the grid, sends init commands to the display and restart its
This will heal display glitches. This is performed every ~120 sec