Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : MM2: SSD1963 with horizontal scrolling
Author | Message | ||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8603 |
This has been on my to-do list for some time and I'm pretty pleased with the result I've added a new function to the CFunction capability. This allows you to specify a region of the screen and scroll it right to left. There is no specific hardware support in the SSD controller for doing this so this is implemented by reading the pixel data from the display and then writing it back one pixel displaced. Despite this and despite only running a 9-bit parallel databus this takes only 50msec for the 280x232 pixel scroll area in the demo. Please note to support this functionality the RD pin must be connected to the processor (you can select which pin), rather than being tied high. At the moment the code only supports right to left scrolling i.e. new data is added to the right hand side of the area after it is moved one place left. This seems to me the most likely application but please let me know if there are specific applications that require an alternative and I can implement them. Because this is all done in software you can of course have multiple separate scroll areas on the display. Check out Youtube to see the code in action. The basic code that created the demo is very simple: sub SSD_test const scrollxstart=100, scrollxwidth=280,newpoint=scrollxstart+scrollxwidth-1 const scrollystart=20,scrollyheight=232, scrolldirection=0 local integer i, j, rp=130, bp=100, yp=160, wp=190, cp=70, xp=40, zp=220 SSD.setrot(landscape) SSD.fillscreen(rgb(black)) ssd.drect(scrollxstart-1,scrollystart-1,scrollxwidth+2,scrollyheight+2,rgb(red)) ssd.pstring(0,scrollxstart+8,0,"Micromite MKII 4.7b8 with SSD1963",1,rgb(white),rgb(black)) ssd.pstring(0,newpoint+10,scrollystart-13+(scrollyheight\2),"Fixed",2,rgb(green),rgb(black)) ssd.pstring(0,newpoint+10,scrollystart+13+(scrollyheight\2),"Area",2,rgb(green),rgb(black)) ssd.pstring(0,10,scrollystart-13+(scrollyheight\2),"Fixed",2,rgb(green),rgb(black)) ssd.pstring(0,10,scrollystart+13+(scrollyheight\2),"Area",2,rgb(green),rgb(black)) ssd.pstring(0,scrollxstart+12,scrollystart+scrollyheight+5,"Demonstration of scrolling data",1,rgb(white),rgb(black)) do ' scroll an area defined by the x-y coordinates of the top left point ' the width of the area to be scrolled ' the height of the are to be scrolled ' the scroll driection (NOT YET IMPLEMENTED) ' a buffer used to store the data as it is read and written back to the display ' the array containing display specific information set up during initialisation i=ssddraw(ssd.scroll,scrollxstart,scrollystart,scrollxwidth,scrollyheight,scrolldirection,rbuf(),SSD_params()) ssd.pixel(newpoint,xp,rgb(black)) ' clear the old data after the scroll ssd.pixel(newpoint,rp,rgb(black)) ssd.pixel(newpoint,yp,rgb(black)) ssd.pixel(newpoint,bp,rgb(black)) ssd.pixel(newpoint,wp,rgb(black)) ssd.pixel(newpoint,cp,rgb(black)) ssd.pixel(newpoint,zp,rgb(black)) rp=rp+(rnd()*4)-2 'get the new data points bp=bp+(rnd()*4)-2 yp=yp+(rnd()*4)-2 xp=xp+(rnd()*2)-1 zp=zp+(rnd()*4)-2 wp=wp+(rnd()*4)-2 cp=cp+(rnd()*4)-2 ssd.pixel(newpoint,xp,rgb(yellow)) 'write them to the space left ssd.pixel(newpoint,rp,rgb(blue)) ssd.pixel(newpoint,yp,rgb(red)) ssd.pixel(newpoint,bp,rgb(green)) ssd.pixel(newpoint,wp,rgb(magenta)) ssd.pixel(newpoint,cp,rgb(cyan)) ssd.pixel(newpoint,zp,rgb(white)) loop The full program is attached: 2015-06-21_141412_scroll.zip The program will only run on the 44-pin part as the performance penalty of not having all the data pins on a single port on the processor is too high. In the example each 50msec "scroll" represents moving 2.338 million bits (46Mbs) The Cfunction also fixes a bug in line drawing so please cut and paste this version if you are using the previous 44-bit version |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2794 |
Neat! Now someone can hopefully write the 80's Defender arcade game for the MicroMite!! WW For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
Zonker Guru Joined: 18/08/2012 Location: United StatesPosts: 761 |
Wow.. That's Awesome Peter..! The 7" 4D systems display has a "trending" object also and I was using it to track RPM,CHT,EGT and OIL Pressure while staying on the "RPM" screen... Still gathering parts to build up a demo circuit for the 7" display to test... I am using a "powered" USB hub, so I am thinking to supply power to the display back-light from one USB feed and power the MM and display interface circuits from the other... (if possible)... If not, then I will need to provide a local supply to power up everything in one go... Thank you fine Sir for all the hard work and effort with the LCD Displays..!! P.S. I finally got 8 type K thermos running in differential mode on the LTC2983 temp subsystem... Works great..! If you run in "diffie" mode, you can use isolated senders OR non isolated senders, (ie. CHT probes that are hard mounted to lugs on the "hot" end)... |
||||
Print this page |