![]() |
Forum Index : Microcontroller and PC projects : Graphics on the ARMmite - teaser
Page 1 of 2 ![]() ![]() |
|||||
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
With Geoff's agreement I've implemented various graphics drivers as part of the core Basic language on the ARMmite You can see the demo on YouTube The code running this is: dim integer BLACK = &H0000 ' Color definitions: 16 bit (RGB565) colour palette so these are just examples dim integer BLUE = &H001F dim integer RED = &HF800 dim integer GREEN = &H07E0 dim integer CYAN = &H07FF dim integer MAGENTA=&HF81F dim integer YELLOW= &HFFE0 dim integer WHITE = &HFFFF dim integer x,y,r,rc dim c(7)=(black,blue,red,green,cyan,magenta,yellow,white) 'controller, command/data pin, WR pin, reset pin, no.bits, screen width, screen height display open ssd1963,1,2,3,16,800,480 do x=rnd*800 y=rnd*480 r=rnd*100 rc=rnd*8 if x-r>=0 and x+r<800 and y-r>=0 and y+r<480 and rc<8 and r>1 then circle x,y,r,c(rc),f loop Graphics controllers supported at the moment include: ILI934x - 8-bit parallel and SPI ST7735 - SPI SSD1963 16-bit parallel SSD1351 - SPI Time to write a complete screen on the SSD1963 (800 x 480 x 16bits) 73msec The commands supported as part of Basic are: DISPLAY OPEN display type, parameters: in the case of the SSD1351 this looks like - DISPLAY OPEN SSD1351, SPIchannel, command/data pin, chip select pin, reset pin, display width, display height DISPLAY CLOSE DISPLAY font number, x-coordinate, y-coordinate, foreground colour, background colour, text-string 4 fonts are currently included from the list on http://www.rinkydinkelectronics.com/r_fonts.php The code includes wordwrap and protection against writing outside the screen area PIXEL x-coordinate, y-coordinate, colour LINE x-start-coordinate, y-start-coordinate, x-end-coordinate, y-end-coordinate, colour CLS (optional parameter colour) BOX x-coordinate, y-coordinate, width, height, colour, (optional parameter F to fill) CIRCLE x-coordinate, y-coordinate, radius, colour, (optional parameter F to fill) TRIANGLE x1-coordinate, y1-coordinate, x2-coordinate, y2-coordinate, x3-coordinate, y3-coordinate, colour, (optional parameter F to fill) BITMAP x-coordinate, y-coordinate, foreground colour, background colour, bitmap (long long integer giving 8 x 8 bitmap). The code treats this as an array of type char[8]. This is read bit7 to bit0, array-index[0] to array-index[n]. The screen then updates the 8 x 8 box top left to bottom right. RBOX x-coordinate, y-coordinate, width, height, radius of corners, colour, (optional parameter F to fill) ROTATE orientation (only supported for screens with hardware rotate support) |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
I thought Sunday was a 'Day of Rest'!! ![]() Yet again, BRILLIANT progress. My only criticism is that you have bankrupted me with having to buy so many different displays! Do you know what the largest screen is that a SD1963 drives. I have seen a 7" but is there bigger that anyone knows about? Also in terms of resolution, is 800x480 the limit? WW |
||||
plasma Guru ![]() Joined: 08/04/2012 Location: GermanyPosts: 437 |
great Work Matherp. looks cool |
||||
jman![]() Guru ![]() Joined: 12/06/2011 Location: New ZealandPosts: 711 |
That fantastic Need my board to arrive :( Jman |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
I've just added the SSD1289 display controller to the code. This is the "value" TFT: 3.2in, 16-bit parallel interface, 240x320 resolution. On this video I put a counter of circles drawn - It is fast ![]() |
||||
Zonker![]() Guru ![]() Joined: 18/08/2012 Location: United StatesPosts: 772 |
OMG..! ![]() Good bye 4D systems.. We can do this with 1 MPU..!! Ok... What's the correct 7" display to get... 8 or 16 bits... I like the blue PCB one Matherp is showing... If it is true that we can get these in a good supply, we need to spin up a MPU backer board for this unit..! I/O's and power come out the back side... This IS the new TFT ARMite..!! SWEET..! ![]() Daddy likes... |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9641 |
Ye Gods, is there no stopping this man? (rhetorical) This is really fantastic. Now I will also have to get one of those STM experimenter's boards! ![]() ![]() Awesome. ![]() ![]() ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
retepsnikrep![]() Senior Member ![]() Joined: 31/12/2007 Location: United KingdomPosts: 134 |
I'm losing the will to live :( Progress is so fast ;) No sooner have I pressed Buy it now on e-bay when Matherp comes up with another one that I have to get!!! Can we slow down a bit so we get a display we all like that is likely to continue in production for some time. This e-bay stuff is a bit unpredictable in the longevity stakes. We want to make products and sensible choices about displays and touch sensitive screens but I'm getting overwhelmed. No criticism of the excellent work though, it's incredible. ![]() Gen1 Honda Insights. |
||||
Zonker![]() Guru ![]() Joined: 18/08/2012 Location: United StatesPosts: 772 |
Ok.. Maybe we should find a "naked" display with touch and get the little connector and interface it directly onto the MPU board itself... Design in the GPU and touch controller IC's on board... Sounds interesting... |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Board in early design. ![]() Fits on the back of a 2.4". It will run a VT100 terminal. PCB is same width as an arduino uno so that it can be used as a shield. The chip is a PIC32MX470MX512. This is for a larger project i am working on, but will allow easy addition of a screen to a uMite or any other mcu with serial or i2c connection. (It can be used standalone also.) 2 pins is all you need, and same as Geoff's vt100 it will also act as a USB-Serial. Microblocks. Build with logic. |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
@TZA An excellent looking 'project' there - I can see many uses for this. What do you 'guesstimate' as timescales for your 'VT100 display'? And congrats on 1000 posts ![]() WW |
||||
Zonker![]() Guru ![]() Joined: 18/08/2012 Location: United StatesPosts: 772 |
Excellent TZA..!! Man... This is going to be a fun summer of new toys..! Let's rock... |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
I don't know how many of these will survive Geoff's cull but these are the fonts I've got loaded on the ARMmite - display is the 5" SSD1963 800x480. The biggest numerical font is 64x100 pixels. I remember someone was looking for very large numbers for a clock for someone partially sighted - might these do the job? |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
This is great work Peter. On using the display as a clock (and assuming HH:MM format), is it not worth going bigger still up to a character width equal to 1/5 the horizontal resolution? Not trying to create work for you - just think this makes a useful size to have as a potential maximum font size. Taking things further, I have done some 'teaching' software displaying characters (letters and numbers) one at a time, and in different colours. This is to try teach my kiddies the alphabet (and their numbers) as well as basic colours. This worked really well when each character 'filled' the screen! FYI - I did this on my original MaxiMite and a VGA screen. So how easy would it be to have a maximum font size (possibly scaled?) equal to the x,y resolution of the screen? These are just two (valid) reasons in which I have used larger fonts and NOT meant to be taken as a criticism (just a suggestion) . . . . WW |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
Not easy at all!!!!! The fonts are stored as bitmaps in program memory. The code currently reads these bit by bit in the correct order and writes the relevant colour out to the display which has been configured with a display port set to the size of the character. It is obviously do-able but the code is pretty tricky. I spent 4 hours today just writing conversion code for the original 6x8 font. This was originally stored as 6 bytes with the bits representing top-bottom and the bytes left to right. I needed the bits left to right to match the other fonts so that bit 6 of byte 0 is the left-most second to the top pixel. My head is still hurting ![]() |
||||
darthmite![]() Senior Member ![]() Joined: 20/11/2011 Location: FrancePosts: 240 |
Hello matherp , take a look on the 1st version i do for st429. fonts.h / fonts.c contain 16x24 , 12x12 , 8x12 , 8x8 fonts. In the GFX_20141114.c file , i use them in the GFX_DisplayString GFX_DisplayChar GFX_DrawChar If it can help in your work ![]() Theory is when we know everything but nothing work ... Practice is when everything work but no one know why ;) |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
Must be really hard if you're saying it's not easy ![]() From your photo the characters look really nice and 'rounded' i.e. not scaled. If they are not currently scaled then would a simple solution be to add a 'scale' parameter and hence the 'bitmaps' remain the same but the drawing routing just multiplies up the number of pixels drawn? (I'm sure you know what I mean by this 'bad' explanation'). So for example, Font 2 in your photo is shown as a 16x22. With the 'suggested' scale factor parameter set to 2, then the font drawn becomes 32x44. This 'scaling' method allows the user to select the appropriate size for their application (i.e. Font 7 scaled by 5 would make a nice full-size clock display). Only suggesting - but forget I mentioned this if this is still too difficult. ![]() ![]() |
||||
Justplayin![]() Guru ![]() Joined: 31/01/2014 Location: United StatesPosts: 330 |
I agree with WhiteWizard. I'm working (very slowly) on a clock for myself will be looking for a display to display a very large numerical font. How about a limited font of numerals and a few symbols (degree, period, colon, plus, minus, C, F). That's what I did when I put together my GPS speedometer. An entire triple sized font was going to be too much data, so I chopped it down to just the essential characters. Then again... you can't please everyone. --Curtis I am not a Mad Scientist... It makes me happy inventing new ways to take over the world!! |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
OK, so I lied ![]() This big enough? Just don't ask for anti-aliaising |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
Now you're cooking ![]() It's '123' o'clock ![]() |
||||
Page 1 of 2 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |