E-paper hacking: fastest possible refresh rate

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today on Applied Science I'm going to talk about these e-ink or ePaper displays these things too are made popular in the Kindle and other ear readers and now they're available in the hobbyist market you can play with putting them in all kinds of different projects of course one of their signature features is that they retain the image even when it's not connected to anything at all so it takes literally zero power to maintain the image and of course the the look of it is much more like paper than it is a liquid crystal display they also have these interesting red white and black displays which are pretty cool it's not a color filter this will talk about the tech that goes into these but it's actually really unusual how these work so the setup I have here today is a TT microcontroller that we're programming through the Arduino interface and it's driving this display over the spy bus you can see I bought this one from WAV share and then we have this glorious scope from Tektronix on loan from Tektronix to monitor the spy bus wave share is not a manufacturer of these panels that they are a I guess a distributor that also makes these breakout for it so it's very convenient to have a board that converts the flat flex that's on the display to this pin header and also they provided some firmware which is a great starting point so let's zoom in on the display and check out some demos ok I'm going to run the demo that comes direct from wave share it's just 2 frames and so it's compiling and downloading and you'll see when the image transitions first you see the inverse of it then all white then all black then the image this is the frame and then it's going to switch back to the first frame and as you can see it's a pretty long process so you can't change any part of the display without going through that entire multi second refresh routine and the early Kindle and other eReader type things had this same characteristic to them you can't just update the screen you have to clear it entirely however if you know how to tweak the firmware you can make the screen do anything you want actually interestingly the controller is very programmable and it's sort of security by obscurity you can load any values you want into the registers and cause it to do anything you may hurt the display but let's take a look and see what's going on okay so I'm gonna load up the demo reel that I made with my custom firmware and we'll see how fast the update is so the first one clears it that's just a standard update and now you can see the frame rate is about 3 Hertz so we don't have to flash the whole display and we can update any part of it within a third of a second this one shows what an animation would look like it at close to 3 Hertz and you can see that I'm drawing text up here and I'm slowly moving the text in the x-direction across the screen to prevent burnin which we'll talk about a little bit later the ball going around in circle doesn't really cause much burn in but you will see if you look closely there's a ghost image as it was going to a full white screen so you can still see that ghost image now we'll go back to wave share these are all full updates as you can see because it's going through this cycle it that should look familiar you can see when it's done cycling there's no more ghosts left like the text is completely clean when it's going through its image update process you can see a little bit of remnant so we'll talk about this a little bit more but I think that the pulse sequence I've come up with is more or less safe but it's possible that if you you know some would abuse the display like this eventually there will be burn in permanent maybe certainly short term burnin for sure let's talk about how these things actually work and then it'll make it clear why we have this problem with burnin so if we were to cut one of these displays and look at the cross-section from the side we would have sort of a smooth top which is an electrode and we'll call that common and then within the display there's a whole bunch of chambers and these are not necessarily pixels they're just little chambers within the display and within each of those there are positive and negative particles and they're submersed or they're suspend in a fluid oil of some kind and the trick is that the positively charged particles are black let's say and the negatively charged particles are white so if we put an electrode array on the bottom and in this case each one of these is a pixel and if we put a positive voltage up here in a negative voltage here the field will cause the negative particle to migrate to the top and the positive particle to migrate to the bottom so what we'll end up with is white particles if those are negative going to the top of this pixel and then as we scan across we can change the fields for each one of these pixels pretty cool in its most basic form you could just put one voltage across this thing and if you're standing through all the pixels you could say okay you know positive on top negative on bottom for this one positive on top negative and scan through it and the display would work at least once or twice but the problem is with electrostatics and fields like this eventually the parts of the display will become charged themselves and so if you keep putting this electric field on the display eventually this positive charge will accumulate in the display and then your display won't work anymore because when you put a voltage on there you're going to be fighting against all the charge that's in there so one of the tricks to driving these things is you actually put an AC voltage on this and rapidly cycle it to prevent it from becoming polarized there's actually a similar problem with LCDs you can't run an LCD with just DC voltage because it will polarize and stop working if you search around on a paper distributor sites you'll see that some of the newer displays are actually rated for what they call partial refresh so basically doing this without any flashing or flickering get a new image on the screen without any of that and I think the trick is they're basically just loosens the sort of the usage restrictions and so they're saying okay you can bend the rules a little bit by putting just a DC voltage on there to get a quick update but then you better do a full refresh at some point near in the future I think you know the reason that it's hard to find instructions on how to do this is because they know that you're going to degrade the panel's performance if you don't have the right routine so it takes a little bit of experimentation to get all this working additionally this display that I'm using this 4.2 inch actually has two complete frame buffers inside of it and so it knows it keeps one frame buffer is like the currently displayed image and then the other frame buffer is the image that it wants to display next and what it does it knows that if there's if this pixel or if this pixel is currently white then it knows that all the positive charges in the top or whatever and if it knows that it wants to convert that pixel to black in the next frame it actually gives it a different sequence of positive and negative voltages than if it's going to stay white in the next frame so the the display has this thing internally called the lookup table and it basically has a set of waveforms that we're going to put on these pixels and the waveform is selected based on what the pixel was in the last frame and what the pixel is in the new frame and it seems kind of overkill but the obviously they wouldn't go through all this trouble if it wasn't necessary so coming up with this correct drive sequence is basically the secret all these are the all of these a paper displays so what about these red ones you might think well it's probably just a color filter I mean it's probably just white pixels underneath a red thing but that's actually not what's going on it's a true three color pixel it can select whether it's going to be red black or white and I searched drown that took a long time to find this out but I think the way it works is kind of like this imagine that you have black pixels that are small and positively charged and then you have really large red ones that are also positively charged and then you've got small white ones that are negatively charged so then if you put this thing between the two electrodes have the large ones and the small black ones will have the same motive force applied to them if we put it this field here minus on the bottom and positive on the top both of the red and the black will be attracted to the top let's say the red ones are going to move more slowly because they are bigger even though the charge is about the same and it's in this viscous sort of fluid so if you put a voltage on here quickly the black ones will make it to the top faster than the red ones and the pixel will turn black if you want to turn the pixel red what you do is you first make it black so that you're in this configuration with the white ones in the bottom the red ones kind of in the middle and the black ones at the top then you switch the field causing the black ones to move down and the white ones to move up but before they have a chance to switch places the red ones will actually end up being the ones that are closest to the top and the black ones will be kind of below and the white ones too haven't started moving just yet I think each manufacturer has their own special trick of how this works and even searching patents and things it's actually very difficult to figure out what's going on here but when we start looking at the code you'll see there's special pulse sequences to get the red ones to the top it's amazingly effective I mean it's a very high contrast sort of display and there's no I mean you can see the background is actually a little bit white compared to a a black and white only ePaper you can see the background on this one is much paler it's much truer to white this one's a little bit reddish probably because those red particles aren't fully at the bottom but nonetheless it's a very cool look okay let's take a look at the code that runs this thing and the changes that I've made to do this fast update so the code from wave share is free and public domain and so I've made some changes to it and then redistributed it on my blog check the description for links to all this stuff and what it is is in our Dino library and an Arduino demo sketch so you can get the thing running and so in libraries it's going to be this EP D 42 directory and almost all of the work is done in EP d 4 inch to cpp the sketch itself is pretty self-explanatory I'll also include a demo basically the same demo reel that you saw there and it's relatively straightforward especially if you use the LCDs from Sparkfun or Adafruit before basically the ideas that you can stir - frame buffer and edit the frame buffer by using these you know draw a filled circle routines or put text in there and then you send it to the display and tell the display to update and some time will go by about a third of a second wait until idle and then you can do something else with the display so pretty straightforward so let's take a look at the CPP file from wave share if you're new to editing C code at this level it may look a little gnarly but just stick with it it's not too bad I would recommend starting from the sketch and seeing what functions are being called here and then tracking them down in EPD 4-inch to CPP so you can see we've got EPD set partial window so if we scroll through here in fine set partial window there it is and I've modified the function slightly from the original wave share function and I've added one new parameter called DTM which is this data transmission mode so I mentioned that the display has two frame buffers one for the old image and one for the new image and you can actually edit each flame frame buffer completely independently so you can tell it whether you want to insert the new image of the old image at first it doesn't seem to make much sense but remember that the waveform that is being given to each pixel is determined by the difference between these two frame buffers so if you power off your device you can actually restore the old frame buffer from non-volatile memory so that your display always has the correct waveform it's kind of a little bit unnecessarily complicated you can basically just always assume that you're starting from a white display or you can even write your firmware to always leave it in a white display state you know it's kind of up to you anyway the next thing that happens is display frame quick so let's take a look at that here's display frame quick it's pretty similar to the original display frame the main difference being I've got set LUT quick here and I've gotten rid of the just the delay commands so let's take a look at the difference between set LUT in the original and set LUT quick will scroll up the command happens to be above it in the file so the original set LUT uses these variables lu TV comm zero and Lu TW and as you can see they have some descriptive names here white to white black to white so this is the difference between frame buffers for each pixel so it picks out a waveform from this lookup table for each of these pixel transmitted transitions so the original set LUT just uses these variables and I have like a parallel function that uses quick quick variable functions or quick variables and at the end of this file I have all of the stuff written out so let's start digging into what this is actually doing okay so here we've got the lookup table on the left and the data sheet on the right that explains what all these values do and it was very difficult to find this data sheet this is actually for the IL 0 3 7 3 controller which is not the one used in the 4.2 inch ePaper display if you start off with the correct data sheet the 4.2 inch ePaper and track down the controller that it's using it's the IL 0 3 8 9 and all of the lookup table information has been removed from this data sheet because the industry thrives on secrecy or something but luckily there aren't that many ePaper display controller manufacturers and they happen to use the same lookup table format in a lot of different displays however it's not the same in all of them and so you have to start poking around and lots of trial and error and whatnot the thing that was the tip-off here is that these look-up tables are 42 bytes long hey magic 42 and the this datasheet Specht 42 byte look-up tables so I knew I was on the right track oh I should point out that the wave share files came with this lookup table that's how I knew it was 42 bytes because there was in fact an original lookup table in the way of sheriff files however funny enough if you look through the code or written the original code carefully it doesn't use them in fact it even has a function cut called set LUT but it never calls the function or I think it maybe it did call the function but it didn't set up the display to use it properly I'm not going to get into the super low-level details but if you use my code it works just fine this is stick with that there is actually a couple of really nasty typos in the original wave share code okay let's take a look at what this thing's actually doing you can read this thing left to right top to bottom just like a book and the very first bite out of the sequence tells it what voltages you want to put on that specific thing and if we look you actually can control V comm which is the what we're calling the common electrode the one that's shared among all pixels so you can actually control that voltage and if we go to the datasheet for V comm the lookup table for V comm that first byte selects four different voltages and it can be v c md c VD h VD l or floating the subsequent four bytes tell this thing how how long you want those voltages to be applied for this part of the waveform and it says number of frames and so in this example over here we've got hex 40 gives it the voltage values that we want so we can come to our calculator here and say hex 40 that's zero one zero two zero zero zero zero zero so zero one is VD h plus vc MDC and then the next one is hex 17 so we'll try that in decimal its twenty three and as it happens a frame the frame rate is 50 Hertz and you can also change that through the things but let's just say it's 50 Hertz so then 23 times you know 53 hertz gives you how the length of time that that voltage will be applied in some of the other data sheets they actually had a better graphical representation of this so you can see this is kind of a little bit easier to see what's going on here so out of all these little bits and bytes that are put into that lookup table you'll eventually end up with a voltage waveform that's applied to the pixels and that's what makes this whole thing tick so let's take a look at the original lookup table versus my lookup table so here's white to white original and white to white quick so you can see the original one is actually pretty complicated it's a hex 40 which is the voltages we're going to apply then at 17 which is the time the voltage is going to be on and then this fifth bite is actually our sixth bite is actually the number of times to repeat that whole part of the sequence so this is voltage forty times seventeen repeat it twice then it does voltage ninety times seventeen times seventeen repeat that twice yada-yada so the original pulse sequence quite long but here's what I did I took the final voltage that was going to be applied to it a zero and then the final amount of time zero E and I'm only going to repeat it once so basically I truncated the look-up tables just using the last value from each waveform this makes sense because the last thing that the waveform does is sets the pixel to the proper value or if this is the proper color so what this thing is doing is let's say you want to go white to white it's actually first converting it to black then converting it to white then to black then to white again but that's very messy looking and if we're trying to do a quick update that's no good so we just go straight to white and if the pixel was already white to begin with we just make it white again no problem and so you'll see that that's true for all of these things the original black to white LUT looks like this and again I just cut the last bit out of it let's see if we can actually probe those voltages to bring this thing full circle and see if our code is actually working the way we think it is so you'll see here I've I've cut away the encapsulants it was actually a polymer that was covering up this whole area on here and this long bit of silicon is actually the driver chip that is doing the the work of converting our serial commands into this giant you know matrix scanned pixel array of that is the display itself you'll see the abbreviation Co g which is chip on glass which is that long piece of silicon the actual driver chip another little gotcha is that the glass itself has a lot of wiring on here but the wiring is all covered with a very hard insulating layer some kind of oxide so if you just take a even if you take a relatively sharp steel probe and just touch down on the surface here you can't access any of the electrical signals in there because the steel isn't hard enough to cut through it instead what we have to do is use a tungsten carbide scribe err and cut away the top oxide layer and then get a probe down on there so I'm gonna zoom in even further and see if you can see this here's a closer view and if you look carefully you can even see they were nice enough to leave us some test pads on here and that one even says comm so that's probably be calm and then a little bit lower you can see here where I scratched away the coating and believe it or not this actually works pretty well you would think and you scratched away the top oxide layer it would blow away the conductive layer underneath but as it turns out you can put a probe here and it actually has pretty good conductivity so let's move over to the side of the display and you can see where I'm going to get the individual pixel lines this is the edge of the display and if you look closely you can see this honeycomb structure those are the ended those are actually not pixels those are just the cups that contain these colored particles and so the actual pixels can be independent from this sort of cup structure and then here's a little bit where I've cut away the encapsulants and scratch it with this scriber and then try to get a probe on there I forgot her I wasn't thinking this is actually an active-matrix of transistors in there so the row and column inputs are scanned and so seeing any sort of meaningful waveform from there is very difficult because it's spread out across all the pixels and so I guess we could change the entire display that I was having trouble probing so just based on this diagram here it's much easier to measure V comm so let's take a look at the scope now and measure V comm since it's much easier and then will alter the let the lookup table and see the effect it has one of the neat features of this new oscilloscope is that it has eight channels that can be configured as digital or analog on each one so when it's digitally you get eight digital inputs you could actually have 8 by 8 digital inputs or you could have all eight analog inputs or some combination thereof so today I have eight digital inputs here and we're keeping track of the spy bus Plus this data command thing reset and the busy flag from the display and then I have channel one reading V comm so I was tack on here and then run the program and hopefully you'll be able to see the display updating back there and we should see V comm change into something else let's see if it shows up okay and there it is so V comm is 10 volts or 11 volts for a while and then at 0 and then it's back to 10 zero and 10 again and if we look at the LUT we can see that makes sense because the final line of the LUT has starts with hex 40 and ends with hex - which means repeat twice and 40 corresponds to this higher V comm voltage so I'll put this back to zero and save the LUT and then run the demo again you can see interesting the display still works which is interesting you'd think just making a random change like that would completely destroy it but actually it's it's still okay and then it went away so since we updated the what table to be zeroed at the beginning this thing just stays at ground the whole time let's finish off by going back to the digital and seeing how fast the framerate is on my hacked firmware version so I'm going to turn off channel 1 since we don't need the analogue and I'm going to change the trigger to instead of triggering on channel 1 we're going to trigger on channel 6 and since 6 is a digital it breaks out all the different pins in there so d0 is the serial clock it'll just start triggering right away the record length is super long 125 million points and a sample rate is 62 and a half million samples per second so we should get 2 seconds worth of data here which would be plenty I'm gonna run the code and I'm going to stop it and when the code gets to the part where it's doing the rapid frame update I'm going to do a single acquisition so I'm watching the display and now is a good time so I'll hit it it triggers very quickly and then 2 seconds later we should be able to see all the data there okay cool so this is each frame being updated so if we wanted to know what the frame rate was we could use the cursors and just get a real quick idea so from the end of that one to the end of this guy is 374 milliseconds 2.7 Hertz and so that's that's about the frame rate that I was getting now he can make it even faster since we have control over the waveform we can make it you know almost nothing the problem is the display will have very poor contrast and so it takes time for those charged particles to rise to the surface we can also take a look at you can see that so the this chunkiness here this is how long it takes the microcontroller to actually send the frame to the display and then this is the time it takes the display to actually show it so if we look at this thing a little more carefully here we can zoom in on it so then looking at the zoomed in section I'll use the cursors to measure the time it takes to actually send the stuff to do the display roll in here so 24 milliseconds out of the what did I say 2 or 300 or whatever it was is actually taken up just by the spy bus and in fact we're cranking really fast it's doing about 14 megahertz is what this thing is measuring here I think it's actually a little bit higher it's closer to about 18 megahertz see if you can zoom in on that zoom way in even at 62 and a half million samples per second it's actually hard to see exactly what's going on we'll bring in the cursors again and this clock edge it's like 20 megahertz yeah it's somewhere between you know 14 and 18 megahertz clock if you look at this the the data being sent has a lot of dead time in between and it's partially because the chip select line has to toggle anyway it's getting kind of detailed that this scope does make it quite easy to see what's going on in addition it's decoded the entire set of data and has it available in sort of a bus form like this another cool feature is that if you know what you're looking for you can search through all the data so for example I have this search already set up and it's looking for hex 20 hex 20 happens to be the code that sets the V com LUT so we can use the navigate buttons and then jump through the data and find all of those 20 hexes so if we zoom out a little bit we can see what it's setting the V comm table to be so 20 and even has this this drag zoom which is pretty cool too ok see you next time bye
Info
Channel: Applied Science
Views: 564,727
Rating: undefined out of 5
Keywords: E-paper, E-ink, display, electrophoretic, update rate, hz, fast, partial refresh, refresh, epaper, eink, good display, waveshare, 4.2
Id: MsbiO8EAsGw
Channel Id: undefined
Length: 27min 55sec (1675 seconds)
Published: Sun Oct 29 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.