I added background colour! The background colour is driven by a hardware timer output compare that is driven on during the active portion of the display. Some monitors do not like to see video signals outside of the active regions, so you can't just tie the R/G/B to 0.7V. That signal was used to tweak VGA_IRQ_Latency constant to compensate the IRQ to SPI DMA latency which affects the text alignment.
The alignment can be easily spotted on the monitor without needing a logic analyzer. Each pixels is 40ns - 2 CPU clocks. Different compilers might generate different code sequence and that could affect the timing. Using the monitor manual horizontal position control, you can shift the video to see the edges hidden at the border of the monitor. In the picture below, the text is lined up perfectly with the background.
Background colour and text alignment |
Text are still rendered in monochrome due to the lack of clock cycles and RAM. Don't expect too much of the chip.
Did some more fooling around. I can get white on grey video output by inverting the font. The latest changes in my font conversion program that brackets the font data with a C macro which makes it easy by flipping the bits there.
Grey on white output |
DSView - setting up multiple cursors |
I got around to finally built the buffer circuit as the STM32F0 chip output has low drive.
White on black video output (from Matrix clock demo) |
Update: Black on white now works. This has something to do with the SPI getting stuck on last bit it sent out. The inverted video means that the video signal remains high and interferes with the monitor.
I padded the scanline buffer with extra 0 byte in front and back to get rid of SPI artifact and make sure that the video goes back to 0V at the end of a scan line. At some point when the other padding was added, forgot to update the byte count.
Offending line: The +2 instead of +1 there.
#define SPI_DMA_WORDS((VGA_RES_X*VGA_BITS)/SPI_WORDSIZE+2)
Black on white output |
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.