-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Timing Problem with KS0108 #493
Comments
You mean, I should change the meaning of this value from ns to 100ns:
What does this mean? On your setup you measured this value? Or you figured out, that smaller values do not work? You mean this value: hmmm difficult... a lot of other displays are affected... |
Actually I agree to the discussion on chibios.com, that nano seconds are useless. At least I should use a U8X8_MSG_DELAY_10NANO msg instead. |
I had a setup with a Nucleo F401 @ 84MHz ARM and made accurate timings with chibios and a hardware timer. Checked with oscilloscope. After a lot of fiddling i figured out the 2.8us. In your previous post you mentioned the exact positions i would change too, but i think only KS0108 Displays are affected? With 10ns i one could only get a max. of 2.55us - too short for my KS0108 (maybe mine is extra slow?) but i could wait two times this value (just duplicate the call) which would be fine. |
the problem is, that the code is reused across many displays. I can not simply extend the range. |
You can make a #define EXTENDED_RANGE for example. Set it to default = FALSE and if TRUE you can youse 10NANO instead of 1NANO. I also would suggest to extend even further to 2*10NANO. |
I see the following values at the moment:
|
one more question: Will a delay of 512ns be sufficient? |
I thought ONLY change the KS0108 driver to 2*10NANO and leave the others alone. |
But how? The value for the delay is stored in a data structure which is common to all displays. If I change the meaning of the 8bit, I have top update all displays (see list above). The question is, what is how can I introduce larger delay without affecting other displays, without increasing the size of the code and data. |
currently I think about a none-linear function like this:
result is: 0 --> 0 You probably want to put 212, which will result a delay of 2816 = 128+ (212-128) x 32 = 128+84 x 32 |
I could add a scaling function (inverse function of the above):
So for 2800ns you just write RFN(2800) and the result will be 212 |
One more thing: 450ns is the official value. I will include this value into the lib. So I guess you need to patch u8g2 for your specific display anyway. |
That sounds like a plan. So you discarded the idea of 10_NANO instead of 1_NANO delay functions? The implementations will have to change anyway (because 150ns of the ssd1309 is no longer 150ns but 832ns). IMO it would make sense to do both. |
oh, i just realized, that i have an extra function for ks0108: Then 450ns would have the value 225 in the config struct |
Well, yes, almost. The problem is, changing this will break all existing HAL implementations for u8g2.
ok, I do not understand the SSD1309 remark, but yes, all calls dispalys have to be changed. But it would be more like adding a macro around the existing values. Nevertheless, I think I prefer a specific solution for the KS0108. |
I meant the function which implements the actual delay has to be changed. It would only work as before for values below 128. |
I would probably change only the meaning of the delay field... |
But in the delay implementation the meaning would be interpreted wrong! |
The meaning of the delay field would be changed only for the ks0108. So other devices are not touched. |
Yes, i get that. I meant the delay implementation would also be different, so switching between displays won't be easily possible. It would be better to implement a new delay function just for the ks0108. Von meinem Huawei-Mobiltelefon gesendet-------- Originalnachricht --------Betreff: Re: [olikraus/u8g2] Timing Problem with KS0108 (#493)Von: olikraus An: olikraus/u8g2 Cc: roberto314 <100prozentoffner@gmail.com>,Author The meaning of the delay field would be changed only for the ks0108. So other devices are not touched.
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/olikraus/u8g2","title":"olikraus/u8g2","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/olikraus/u8g2"}},"updates":{"snippets":[{"icon":"PERSON","message":"@olikraus in #493: The meaning of the delay field would be changed only for the ks0108. So other devices are not touched.\r\n"}],"action":{"name":"View Issue","url":"#493 (comment)"}}}
|
ok, not a perfect solution, but at least it fixed the problem (hopefully) |
closing for now... |
This is not really a library problem - more an enhancement:
I measured the E - cycle time on a KS0108 display i have and i needed 2.8us! The datasheet says 450ns and in u8g2 the delay nano takes an 8-bit parameter (which is actually 200). Can't you change that to DELAY_100NANO so the parameter can be changed from 5 (which would be 500ns) up to 255 (which would be 25,5 us)?
Also i made a functonal framework to get u8g2 working with ChibiOS, could be interesting for the porting guide.
See: http://www.chibios.com/forum/viewtopic.php?f=8&t=4459
The text was updated successfully, but these errors were encountered: