5" & 7" Inch TFT 800x480 16 Bit wiring + code for SSD1963 & a Pic Microcontroller (see show more)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi so welcome to another video this one's going to be telling you how to wire up your 8-bit TFT and wired up to 16-bit mode so I've got this one configured at 8-bit mode at the moment what do you show you the difference in speeds I've been running this 8-bit mode for many many months and drying the many many weeks to get it or work in 16-bit mode so if you have a close look at the resolution of this text including this text and then the speed at which it refreshes so this is a picture on the internal memory card coming up that's 8-bit mode you saw how slowly or quickly it comes down the screen so this is 8-bit mode look at the clarity the picture although the colors don't take change much this is just running random colors down the screen 8-bit mode doesn't say now watch the refresh on these numbers you can virtually see every number every bit of data get refreshed so pay attention to the clarity of these numbers so what I'll do change it to 16-bit mode and show you again look at the speed of these two dots like : in the middle of the clock so that's running through the routine and when I change it to 18 so when I change it to you 16-bit mode these rapidly speed up sets running the whole program a lot faster well I'll configure this to 16-bit mode now you can see the difference let that picture come down again so you can see that's taken a few seconds I was quite happy with the picture until I saw the 16-bit mode and this sharper and the text is sharper so this is a pig 32m x7 running at 80 Meg's so you could look at the if I can zoom you in just look at the edges on the letters and you'll see when I change you to 16 bit mode a sharper so obviously you're zoomed right in just start a five six inches away from that display well that's the best focus hugging gear so have a look at that and now we'll change it to 16 bit right I've just transmitted to 16-bit mode you see the total layers flashing little quicker but if you look at the crispness of this data or the edges from text while beating them back in the middle of the screen is just so much sharper and now that's refreshing that picture and you saw all the other colors were taking a second or two to come down the screen and that's it that's running 16-bit mode so now we've got a better color or except this just picked up the date and time so now we've gotta wait for that to change so I'll zoom you back in you can see all the text on the screen including this happier the colors seem slightly sharper I guess they should be running a 16-bit mode you can see this text this data coming in this is the solar panels a cloudy day today we've got 7 watts coming off the power 12 volts 587 milliamps so let this screen refresh and you'll clear this you can see how quick how much faster this picture comes down and the image is generally sharper it's taking me forever to get rid of the flicker on that on this display but I'll show you the data in a code and the wiring so it's hoping you can see the difference in this text it's just so much sharper also let the picture come down once more so hopefully you can get an idea is running a lot Kaka and the results apart from the speed everything is sharper crisper right so I'm running Li conventional with all my other recent programs pic32 mx7 running a hey team eggs I've always had this forty way ribbon playable but I don't need previously been using 8 bits of data eight bits of parallel data to the TFT this is a 800 by 480 TFT 800 by 480 pixels running at 3.3 volts right what I do all now I'll show you the some code and wiring diagrams right so first and foremost running this pic microcontroller you've got to set the port up to parallel master mode BMP so if I scroll down this is section 13 parallel master mode I'll scroll down there's little note here so parallel master port data it's only available on pic32 devices with a hundred pins or more so if you've got a 64 pin quad flat-pack something on that you're not going to be able to get 16 data lines right this is the layout of my pic microcontroller I'm using this pic 32 MX thousand 5 F 2 5 6 and we're looking for as these parallel master data or parallel mode data ports so you see this one PMD 5 is re 5 or e 6 etc etc you see some up around the sides PMD 4 p.m. d3 so you see these various data ports parallel master data on different ports there are first seven first seven or eight on port II and from 8 to 15 they're scattered all over the place so I'd look at your microcontroller and remember you've got to have a hundred pin device or bigger right so now you know where you're all parallel master ports are this is the wiring diagram for this TFT display I believe these seven inches the same of actually just all as a seven inch but still only 800 by 480 pixels but I'm hoping I'll be able to just plug it in it will work straight away so this is same as before see first eight days aligned remembering zeroes are numbers you've got eight data lines a that's port e so if we zoom in a bit and so register select is anything these just define it in your code so this is the breed and right so you got parallel my beautiful pearl Mouse that right and then parallel master read so I'll default rd5 have a look at your chip a little the surnames and then these are the various ports for the other bits of data so you can see PMD 8 RG or T 1 RF Rd so on and so forth so you get the idea we bring you to the bottom so this parallel master port data it's got two chip selects stitch like one and two but you see in the defines in the code we're not using the parallel master chip select which would be pmc s1 or cs2 so they're not use so you can use any pin for the chip select and just define it so that's it 16 data lines read write read to select tip select and obviously power and ground and LED also I'll let you look at that for a second these are the pins for the SD card these are the pins for the touch screen controller and that FCS that's for the touch screen controller this is obviously backlighting bear and ground and that's it simple when you know how right in case you haven't seen my other videos this is the configuration I'm used for the TFT but there's the read write that E is the first eight bits so then we've got the chip select readwrite reset that's all the stuff well so this bit here you want to just copy it's also available on some multi electronic as demonstration programs this is where simply this command that enables us to write to a specific index in the TFT register you see let's see we define an index and then write a command to it or data to it and this this is if if it's busy it's waiting before it writes the command so I'll scroll down you don't need that this is a hallmark locked out if you don't don't need any of that right down to the program this is initializing the MCU but what I did so that I didn't have to keep on deleting loads of lines I created a couple of files and so this one's the 8-bit initialization this is all reports this and log to digital they're all digital and disabling on the JTAG so this is the 8-bit section and then so I didn't have to keep on deleting bits I mean I made this section up and this is initializing the MTU 16-bit mode so same again all digital all the ports you don't actually have to put any of these in because all outputs disabling the JTAG and this section here has samples available on mic electronica or even microchip i found mark electronic a--'s formula for this is actually the quickest and easiest there are many other ways you can write all of these bits but just copy microelectronic cos it's all the time quick and easy so this is as I say 16-bit maruge so I've added this bit at the bottom so we're enabling the parallel master mode in the MCU and then down here you see I'm setting the DFT default mode and this is the set active index right that's that section at the top I showed you not actually sure what the set mm is something to do with the TF table not too sure to be honest but I'll click in there anyway right so next bit initialize a touch panel or I'm not actually initializing the touch panel itself this is the actual just the TFT so initialize TFT and this is going to assess the 1963 controller 800 by 480 pixels and TFT set DBC this is actually the dynamic specialising in control so don't actually need that because my TFT is just wired up to an LED it's not being controlled by the microcontroller or the lodging by closing well so that's the 16-bit initialize and then back to the original you might have seen 8-bit in the initialization so if this is the TFT initialize 8-bit the old method that you might have seen it in my previous video when getting locked Reds on this TFT display you wrote TFT SS the 1963 I bit set bridge and you'd but the register there and then right at the command you're going to write to it and I found that these two figures carry rids that sort of stuff but this second method which we're using here so even if you still using the 8-bit you TFT set index this is the index or the register in the SSD 1963 module Petrolia going to write to and then this is what you're going to write so I just thought I'd delete this bitten show you this example so that's what we're doing with this set index pointer and then the command and there's a couple of other commands I've REM dealt so this for example would flip the screen left to right let flip it top to bottom this is the power mode we should don't actually use or don't need because it's not different to more electron occurs library flip f2 right and this will invert a picture so it make it into a negative just a couple of examples right this is another routine I've created so this is the TFT set mode SSD 1963 controller so zeroing the chip select TFT set index so this is the scan mode whether it's left to right top to bottom that sort of stuff so this is actually just the normal regular mode this is the power mode in it 0a this is the pixel format very alien and we're writing a 50 so if you're looking at the data sheet from my other videos you remember get the calculator look at the data sheet and you're depending on what selection you want you'll have various binary numbers that sort of stuff various bit you want to select and it dis convert it to hex up there that sort of stuff so remember that another thing I forgot to point out if Mike electron occurs definitions of the panel are the same as the one is as the panel you're using you don't actually need to configure them you need to configure them if they're different so a quick way to get up microelectronic as definitions so these bits have to be defined for TFT LCD that sort of stuff so if I remove at this statement this are reset so remove that and then draw and program it to fill up build there we go and it's come up down the bottom from unresolved external TFT reset that's because I've said there isn't a reset when there should be so and what pops up on the top of the screen is leap TFT definitions so if you scroll through this page this is all the definitions for various TFTs and you'll see right down the bottom so I think this one's just regular 8-bit alot gamma settings display settings so if we scroll right down the bottom near the bottom somewhere so this is the small oil or this 320 by 240 panel for the easy pic fusion board but scroll all the way down the bottom and you see all the definitions for various displays so this is now the SSD 1963 so really don't forget we're in leap TFT definitions and it's these you'll see they're using either 800 by 480 or the 480 by 272 and depending on what you write determines what we're using here but it's for this TFT I'm using I'll scroll down to the right bit so you see there an example a TFT DVCS had dynamic backlight generator or PWM generator but my idea is just water up to LEDs so I'm not controlling the backlight oh don't need any of that but scroll down have look at the definitions various registers and various commands are being written to as I say you only need to define the ones that are different or not working I thought I'd show you so this is changing microelectronic as library definitions of just panel size and leaving everything else alone so you see changing just the panel size gives me a totally corrupt screen these are the numbers and you know we lost the field sink you can see it's not synchronizing from top to bottom to synchronizing from left to right so you can see we're getting close but you can see the numbers scrolling up there so that's just changing the panel size and leaving these synchronization alone so you've got to remember this works like a TV or this particular panel I've set up to work log of TV and microelectronic as examples it starts scanning up here comes down kids and scanning it's at the bottom starts again does odd and even lines depending on what you've set you can see the pictures trying to come through there right this example is changing nothing so I'm using my electronics example to drive this screen everything is microelectronic as SSD 1963 controller I think their screen is 480 by 272 so you can see we've got a blue screen air which my initials blue screen is and I think that's the end of the clock letter and we got part of the time here and it's being repeated here so this is changing nothing on multiple Ektron occurs very definitions and you can see it just doesn't work but every minute when my picture comes up you'll see it scroll down there as well it was close but not there it goes you can see part of the picture just come on so this is the wirings correct we've initializes the parallel data mode parallel port mode right so what I've done here is deliberately shortened the vertical sync period so now the synchronization pulses between the top and bottom are too short but all the data to fit in so what happens is the data starts running into the synchronization pulses and the screen can't synchronize doesn't know where to synchronize because the data is interfering so this is a shortened vertical pulse sync you can see the data is there but it's just all over the place so you can see it's actually affects the horizontal as well so you've got to get the horizontal and vertical sync pulse is correct you see the pictures flicking up and down so that vertical sync and you see the lines running across there and the picture is running across so the horizontal syncs out because the vertical sync is out so depending on what screen you've got go get the vertical sync and the horizontal sync just right right what I've done here is extended that vertical pulse timing so it's now too long I wanted to show you the effect the I've had to make it very long to try and get this camera to pick it up but you see the whole screen is flickering and wait for the picture to come up so you see everything slowed down and you get this flicker which looks terrible and certainly when a picture comes up you will see the effect so this is slowing everything down by few hundred times actually on the same pulses and you see that all those different picture that nice crisp picture you see all these visible lines as you say you've got to get everything just right so that's the effect when the pulses are too long right now I put it back to how it should be but or you might notice on some videos if they're looking at a TV you'll get flickering and that's the scanning of the whether it's a camera CCD chip or tube so if you see any effects on this screen this because it's the scanning of this camera chip versus the scanning on this screen sometimes you might have notice on a TV program you'll get a a TV picture and you see low in scanning down and there's a difference in the synchronization between the camera and this but anyway so hopefully you can now see North razor sharp images so I'm pretty pleased just by going from 8-bit to 16-bit so now you've seen some examples there I'll show you what we're doing with the code right so this is the routine I've created of called it TFT set mode you can call it whatever you like so this is the 16-bit mode and these parts are the parts I'm changing that are different to microelectronic goos examples but please do look at marker electricals examples the minerals if you've got the smaller TFT the 480 by 270 there example will work just doesn't work with this larger five-inch 800 by 480 so and to reiterate if the register you're writing to is actually the same as microelectronic as example you don't need to put it in here but I was just starting from scratch and I started putting loads in so some of these can probably be removed if they're saying I shall notice I think one of my collector articles samples uses 18 bit data where you've got ash of all these n data lines up two pins and you start from what data pin to instead of zero but so this is just using 16-bit color data so you can see so power look at the data sheet for the controller you use it so this is set in the clock PLL a sort of stuff so this page address for example I mean I could probably delete half of this because I think it's or so but say the page address isn't changing for microelectronic this example so you can remove that so this was the first section that started making an improvement so you go to that address register there be 0 and you write these commands so have a look at the date issue and we've got time to go for it now but this is like color deterring that sort of stuff and whether it's TFT with TTL mode that sort of stuff I just found 38 works for me but this is the horizontal and vertical size of the panel and I initially put 800 by 480 and the color the screen came up nice a locked picture right size but the colors were off then I read the datasheet and it says it's the pixel size plus 1 so just to remind you quick reminder get the coca later up in case you forgot them so we at my panel size at 800 pixels long so look down to decimal so we got 800 low by 486 800 plus 1 plus 1 obviously 801 convert that to hexadecimal 3 2 1 and so you can see the high byte for the panel size and the load by two further panel size 3 2 1 and similarly for the vertical size 480 plus 1 and trust me if you don't put the plus 1 and your colors will be wrong so depending on what controller what panel controller you've got so that was a start that's the panel size these are clock settings but mine are the same as microelectronic was so I don't need to put those in up and REM them out remove them and these are the critical bits it took me forever forever to get I'd get a picture get reasonable color definitions but there's flicker and what we're doing here is changing the line and field synchronization pulses and there's a lot of set in the front and back porch that's where the signal starts and ends and we've got a gap but in the sink policies and the start and the end of the data so these are two important registers B 4 and B 6 C you can see the set vertical period and set horizontal period and it includes the front porch so if your if your screen is not showing much of a picture a little tip where this front porch setting there this numbers got to be small what's meant to be small I've looked at the data sheet for more examples but at a thought for a test I set this instead of like a hexadecimal 48 I set this to something like a number start at two thousand and you get flicker but you start getting a picture a reasonable quality picture just with flicker and you can start altering the line and film sync sizes and that's what I did and I'll gradually kept on reducing this if you make this too small or it's too small initially you'll just get part of our pixel on your screen or you just get part of the screen your whole display so you can dive in either this might work if you've got this identical display or if you've got a new display with a new controller you can start making this front port size make it massive and the thing just locks up and synchronizes so and then start holding these other numbers so these figures the sort of flicker free as you saw they could probably be enhanced a bit but I head up on the scope and I don't know if you can see over here I'll show you or him I don't on the scope and I was looking at the fun at that porch and a sync pulses where you can see I was messing about to get better resolution less flicker but I think are you can see this vertical pole saw it measured it a hundred microseconds but depending on what settings you got here the can become a few milliseconds too big too small sort of staff so for this five inch and I believe it will probably work for the seven inch because it's got a sound under pixels these are the settings that worked for me have looked copy them till as I say they are not the same as menthe electronica so I had to define them if I don't define them you see that you saw that little square in the example earlier and basically you can run your normal routine this is just initializing the you arts but this is what I was doing so I've got my routine for 8-bit so I'll just use this line and this line and then for 16-bit these three lines I initialize enter you take leave it this is initialized a touch panel and this is the mode this is a routine I created so that's it so these registers have a look if your panels not working or maybe just the settings will get your panel working but this has taken me weeks of at this start and stop over a period of many weeks and finally got it so hopefully this has helped give you some insight into getting a pic microcontroller running 16-bit data into a TFT color TFT as I say 800 by 480 thank you very much
Info
Channel: John B
Views: 41,210
Rating: undefined out of 5
Keywords: 5 Inch TFT, 7 Inch TFT, 16Bit, Wiring, code, source, 800x480, 800x480 wiring, 16Bit TFT wiring, 16Bit TFT code, PIC Microcontroller (Computer Processor), Thin-film-transistor Liquid-crystal Display, Mikroelektronika, Visual TFT, pmp, Parallel Mode, Programming, MikroC, Pic, Pic32, Beginners, uC, Farnell, Colour TFT, Color TFT, Thin-film Transistor, SSD1963, Colour Graphics, MikroC Pro for Pic, Pic32MX7, Pic32MX5, dspic, Easypic Fusion, GUI
Id: SgtP4MZ9Hys
Channel Id: undefined
Length: 31min 36sec (1896 seconds)
Published: Thu Jun 05 2014
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.