STM32F103C8 BluePill VGA Project

What are you developing?
feluga
Posts: 59
Joined: Wed Mar 18, 2020 2:50 am

Re: STM32F103C8 BluePill VGA Project

Post by feluga »

You may also think that Blue VGA (embedded on its own STM32F103C chip) can act as a VGA I2C or SPI display for Marllin.
Maybe easier, faster to code and cheaper, given that a bluepill will cost less than US$2.

I'm not sure if STM32F103C can manage to handle I2C or SPI data reception entirely by Interrupt and DMA.
Otherwise, data receiving using SPI or I2C may not work properly.
This would be necessary as VGA Driver uses high priority Timer IRQ and can't be interrupted while running.

As I recall, SPI can read data using DMA with no CPU intervention, but I2C slave can't. Not sure.
Y@@J
Posts: 46
Joined: Mon Sep 28, 2020 8:51 pm

Re: STM32F103C8 BluePill VGA Project

Post by Y@@J »

Thank you for the answers.
I was suspecting it was not easy. Integrating such a feature at the lowest level needs a lot of knowledge, and Marlin bacame a huge mammoth ! (the LPC boards SKR 1.1 and 1.4 Turbo are 100 and 120GHz, Marlin runs on 8 bit 48GHz)
I'm working on SPI to TV with "some" success : viewtopic.php?f=47&t=815&p=5366#p5366
feluga
Posts: 59
Joined: Wed Mar 18, 2020 2:50 am

Re: STM32F103C8 BluePill VGA Project

Post by feluga »

Today I've released a new version of BlueVGA, v1.2.
In this version, it's possible to set individual pixels using the new class BlueBitmap.

It actually uses RAM Tiles instead of Flash Tile, which in turn allow to set an individual pixel within this tile.
There are 256 RAM Tiles, thus, in a 16 x 16 tile arrangement, we could create a full canvas of 128 x 128 pixels.
But those RAM Tiles can be any place in the 28x30 tile space.
This allows to create, for instance, an animation such as Space Invaders (in the examples), or even create widgets for the user interface.

Main Methods are:

Code: Select all

void BlueBitmap::drawPixel(uint8_t x, uint8_t y, bool setReset) // to draw a pixel on any place of the screen
void BlueBitmap::drawBitmap(uint8_t x, uint8_t y, uint8_t frameNum, bool setReset, int8_t color) // to draw a bitmap on the screen
void BlueBitmap::drawBitmap8(uint8_t x, uint8_t y, uint8_t frameNum, bool setReset, int8_t color) // to fast draw of 8x8 or 16x8 bitmaps

void setBlueVgaObject(BlueVGA &bvgaPtr) // to associate the vga object to drawing functions 

// RAM Tiles can be split into two sections: RAM Tiles that are "safe" and won't be used in a drawPixel() 
// and the rest that will be dynamically allocated to display pixels in the screen. By default all the tiles 
// are available for drwaing pixels.
void BlueBitmap::eraseRamTiles() 	// to reset the graphical environment - uses firstTile information
void setFirstTile(uint8_t tile)		// to assign the Tile number that a graphical function can use to set a pixel 
 					// when all available tiles are used it will recycle back to this tile
void setNextFreeTile(uint8_t tile)  	// to assign the Tile number that a graphical function can use to set a pixel
 					// used as next available tile for pixels

New Examples in Github:
  • Space Invaders Animation Demo - a nice auto-play Space Invaders Animation
  • Elliptical Text Animation - an animation of text moving in different elliptical paths
  • graph Demo Sine Curve - an slow motion animation of a sine curve drawing. At the end it changes to character view in order to help understanding how the graphical mode works.
Post Reply

Return to “Projects”