PCD8544 - attempts to fix module running into strange js behavior #931
Replies: 7 comments
-
Posted at 2014-04-03 by @gfwilliams It's because the Uint8Array is a 'view' of the original array rather than a new array. You're trying to make it go past the end of the existing array, so if you set bytes in it they're ignored. I guess the best you could do is:
Or, you could set CE manually, which is probably better (in fact you may not even have to bother):
Looks like this isn't 100% JS compliant though - in proper JS there seems to be a difference between:
I guess I should probably change the drivers over and then tweak Espruino's implementation - I prefer my version though ;) By the way, on my LCD it works great without the extra 2 bytes, so I wonder whether it's just some driver chips that have the issue - or maybe it's something to do with initialisation. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-03 by @gfwilliams Umm... So I tried your new module - and yes, it's completely broken. But the code that I had before (without the extra 2 bytes at the end at all) works perfectly on software SPI. Perhaps it's actually an issue with Espruino's SPI and how quickly it raises the CE line after sending. Try:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-03 by @gfwilliams Actually I could be wrong, but at least for me, this works now:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-03 by @gfwilliams Actually it's a big SPI issue. I'm trying to figure out why it's happening, but it seems that it gets confused about when it's finished sending data. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-03 by @gfwilliams Ok, that's now fixed in GitHub. This also explains the problems people were having with resetting the displays. I'm still not sure why I never had this issue myself :) Just a note about uint8arrays:
It's a bit crazy really.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-28 by zhogov Hi! thanks |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-04-28 by @gfwilliams This is the Espruino one that seems to work pretty well at the moment? http://www.espruino.com/PCD8544 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-04-03 by DrAzzy
I have determined what needs to be done to make the PCD8544 display actually work, and not cut off the first two bytes: every line needs the extra two bytes on the end, otherwise the display gets confused (I have no idea why - It doesn't look like it should be necessary from the datasheet...). The extra two bytes on the last line overwrite the first two bytes of the first line. Hence, the last two bytes need to be set to the first two bytes of line one.
This sounds easy enough, but my code isn't working:
What the heck is going on there? Why aren't those values in the array being set?
If I manually define the array I want it to be sending for the last line and send that, the screen renders correctly, with the first two bytes displayed.
But yeah - I don't know why I can't set those values in the array....
Using v59.
Beta Was this translation helpful? Give feedback.
All reactions