MCB1700
mandag den 9. december 2013
Xmaroids
Wow, two years went by. Well here's a small update. An outline graphics library is in the works. The upper speed limit (set by the SPI bus) seems to be around 20 frames per second for simple graphics (the usual couple of balls bouncing around). The RAM consumption in a double-buffered scenario will be 10K, a single-buffer will be 6K, or as low as 4K - and even lower - if you don't care about speed. The footprint in flash is between 4 and 12 depending on utilization and optimization level. The concept is to trade off cycles for memory. I challenge you to improve on my xmas-themed Asteroids arcade game clone. Here is a first proof of concept. The working title is Xmaroids. Source code for the demo will be made available. The library remains closed source at least for now. I obviously need to add missiles and explosions. I will probably never get as far as adding levels and keeping and displaying scores.
onsdag den 30. november 2011
Improved Demos, Now With Binary Image
Upon popular request ;-) I have uploaded an image file for the RGB Balls Demo to a server on the Internet. This is an improved version that uses sub-pixel positioning. The balls move real slow so that you can fully enjoy the sub-pixel positioning (and to avoid the jagged edges that appear when the balls move faster).
I am not showing you another clip, because you would not be able to tell the difference on a blurry blogger clip.
Here are 13 Alphablended Balls. Does the alpha blending look right? At least it looks slightly more appealing on a white background than it does on a black background.
Here is the Plasma Demo.
Update, Intel HEX files for use with FlashMagic:
RGB
Alpha
Plasma
Enjoy.
I am not showing you another clip, because you would not be able to tell the difference on a blurry blogger clip.
Here are 13 Alphablended Balls. Does the alpha blending look right? At least it looks slightly more appealing on a white background than it does on a black background.
Here is the Plasma Demo.
Update, Intel HEX files for use with FlashMagic:
RGB
Alpha
Plasma
Enjoy.
onsdag den 16. november 2011
Help: JTAG Kills LCD
This is a plead for advice. Whenever I have programmed the LPC1768, the display goes blank, but code runs as usual. The board must be power cycled to get the display up again. The reset button alone does not do it. This is with or without JTAG still attached. This means that I have a hard time debugging with display output. Sometimes I can attach a debug session with display output up and some of those times breakpoints work, but this is rare.
Can you figure out what I need to do in order to get the display up again after JTAG programming? Here I am thinking software wise - some kind of display reset procedure. The data sheets for the ILI9320 leaves me clueless. I am using an Olimex Tiny JTAG thing with OpenOCD from Eclipse with a Zylin plugin.
Help!
Can you figure out what I need to do in order to get the display up again after JTAG programming? Here I am thinking software wise - some kind of display reset procedure. The data sheets for the ILI9320 leaves me clueless. I am using an Olimex Tiny JTAG thing with OpenOCD from Eclipse with a Zylin plugin.
Help!
tirsdag den 15. november 2011
Sub-pixel positioning
Earlier today I submitted an entry about how the touch controller would freak out after a while, and how it was related to back-to-back I2C transactions. A couple of hours later I regretted that entry, because it seems the problem is in the configuration of the touch controller. Specifically the panel driver settling time and the touch detect delay. The values I use now has not made the controller freak out yet (knock on wood).
Instead I am going to rant about how outline rendering makes sub-pixel positioning possible and shoot another demo, even though you probably cannot tell the difference from the previous one, other than the fact that the dot has changed colour from red to green. Still, the underlying code has changed a lot, not least the touch controller code. It needs finishing touches, but I am pretty satisfied with it; it's reasonably tight and neat.
In the previous demo the entire screen was invalidated with each redraw, now I only invalidate a rectangle around the dot as it moves. This improves the latency that was obvious in the previous demo. Another improvement to the latency is slightly faster controller configuration parameters (the values causing me grief).
And then of course the dot is positioned on sub-pixels, down to a sixteenth of a pixel actually. This sits well with the resolution of the touch panel. Sub-pixel positioning is one of the benefits of outline rendering. It comes at little to no cost at all, once the outline rendering is in place. Without further ado, here is another shot of my kit with my ball point pen moving around. Enjoy.
You may have noticed that the calibration is somewhat off. This is on purpose - to make the corners accessible - but it is probably too much. I tried to do a close-up to really show off the sub-pixel positioning, but it's not working out at all, is it? Blurry is the order of the day.
Instead I am going to rant about how outline rendering makes sub-pixel positioning possible and shoot another demo, even though you probably cannot tell the difference from the previous one, other than the fact that the dot has changed colour from red to green. Still, the underlying code has changed a lot, not least the touch controller code. It needs finishing touches, but I am pretty satisfied with it; it's reasonably tight and neat.
In the previous demo the entire screen was invalidated with each redraw, now I only invalidate a rectangle around the dot as it moves. This improves the latency that was obvious in the previous demo. Another improvement to the latency is slightly faster controller configuration parameters (the values causing me grief).
And then of course the dot is positioned on sub-pixels, down to a sixteenth of a pixel actually. This sits well with the resolution of the touch panel. Sub-pixel positioning is one of the benefits of outline rendering. It comes at little to no cost at all, once the outline rendering is in place. Without further ado, here is another shot of my kit with my ball point pen moving around. Enjoy.
You may have noticed that the calibration is somewhat off. This is on purpose - to make the corners accessible - but it is probably too much. I tried to do a close-up to really show off the sub-pixel positioning, but it's not working out at all, is it? Blurry is the order of the day.
torsdag den 10. november 2011
Interrupt Driven Touch Demo
After some struggle I managed to make the touch controller related code fully interrupt driven. This is one of those days where I make every mistake in the book and then some. I already figured that I would take baby steps, so I started by making read and write functions interrupt driven. This worked fine, the read and write functions waited for the interrupt-driven state machine to finish and then returned.
I was using local variables a great deal, and when I switched to fully interrupt-driven I forgot about silly things like using static and volatile keywords and what not. I also realized that I needed to insert a delay before attempting to initialize the controller. I still need to clean up the code a bit. Anyway, here is a short clip with a demo using the interrupt-driven code:
I was using local variables a great deal, and when I switched to fully interrupt-driven I forgot about silly things like using static and volatile keywords and what not. I also realized that I needed to insert a delay before attempting to initialize the controller. I still need to clean up the code a bit. Anyway, here is a short clip with a demo using the interrupt-driven code:
søndag den 6. november 2011
The Touch
As I have previously alluded to, the MCB1700 (mine at least) is in fact equipped with a touch screen. It is plainly visible when you inspect the kit, but there is absolutely no mention of the fact in Keil specifications for the kit. On closer inspection (you will need a screwdriver) you find that there is a controller chip mounted on the LCD board. I suspected that Keil might have different evaluation boards using the exact same LCD board, why else mount a controller chip.
And sure enough, if you start on their Cortex-M Evaluation Board Comparison, you will note that they have two boards equipped with "LCD-TFT", MCB1750 and MCB1760, or generically MCB1700. As you can see, no mention of a touch controller. Curiously Keil also have four (actually only three) boards equipped with "QVGA" (the LCD-TFT on the MCB1700 is also QVGA). The specifications for two of these boards mention the touch controller (the link from Keil is dead, ST probably killed it...), but I'll be surprised to find that the LCD board is not exactly the same on all of these evaluation boards, including MCB1700:
All it takes hardware wise to get the touch controller connected on the MCB1700 board is two wires for the I2C signals SCL and SDA. I connected them to P0.19 and P0.20 which were conveniently available. Here is a shot with the wires.
Get the Keil tools, if not for the tools, then for the example code alone. It is a large download but it contains lots of useful examples not just for the touch controller on the MCBSTM32. The touch controller code from MCBSTM32 examples is easily modified for the MCB1700, and you can build from there. This is what I am currently doing.
And sure enough, if you start on their Cortex-M Evaluation Board Comparison, you will note that they have two boards equipped with "LCD-TFT", MCB1750 and MCB1760, or generically MCB1700. As you can see, no mention of a touch controller. Curiously Keil also have four (actually only three) boards equipped with "QVGA" (the LCD-TFT on the MCB1700 is also QVGA). The specifications for two of these boards mention the touch controller (the link from Keil is dead, ST probably killed it...), but I'll be surprised to find that the LCD board is not exactly the same on all of these evaluation boards, including MCB1700:
All it takes hardware wise to get the touch controller connected on the MCB1700 board is two wires for the I2C signals SCL and SDA. I connected them to P0.19 and P0.20 which were conveniently available. Here is a shot with the wires.
Get the Keil tools, if not for the tools, then for the example code alone. It is a large download but it contains lots of useful examples not just for the touch controller on the MCBSTM32. The touch controller code from MCBSTM32 examples is easily modified for the MCB1700, and you can build from there. This is what I am currently doing.
onsdag den 2. november 2011
Standalone FreeType raster
A thing I was not previously aware of, it is quite simple to use the anti aliasing FreeType renderer without the rest of FreeType. Last night I combined my view model of the display on the MCB1700 with the FreeType renderer. The only minor hiccup was a missing FT_ABS macro, quickly resolved by a compiler define. So here is another video clip. This time in low light conditions and with exposure turned all the way down. Still not quite good, a bit blurry and actually does not do the little demo justice:
In case you are wondering, those balls are outlines with 8 off-curve points. Each ball is a separate view which is moved around. They are rendered using the anti-aliased renderer and a sort of alpha blending. Actual alpha blending was a bit boring, but adding the red, green, and blue balls together made for a more interesting effect. I am not sure the video brings that out.
I did another shot of the plasma, I think I improved it a little:
Here are ten balls with true alpha blending:
With more than ten balls bouncing, rendering slows down noticeably. The alpha blending is inner loop code with intense bit-shuffling going on due to the way that the RGB values are packed. Rendering opaque text on a uniform background should prove to be fast, I can hardly wait to see it. I doubt that I will be able to improve much on the rendering speed of the FreeType renderer, but I will definitely be able to cut memory consumption (by using smaller values - bytes - for co-ordinate data, and keeping relative co-ordinates as in a TrueType file). Unfortunately the cuts in memory consumption may affect rendering speed some, but this remains to be determined.
Etiketter:
alpha-blending.,
anti-aliased,
balls,
bouncing,
display,
FreeType,
LCD,
MCB1700,
raster
Abonner på:
Opslag (Atom)
