panda381 / picovga Goto Github PK
View Code? Open in Web Editor NEWVGA/TV display on Raspberry Pico
VGA/TV display on Raspberry Pico
I am using PicoVGA with a RP2014 Zero board that has a more limited option of pins than the Pi Pico. I want to use UART and SPI and for that I need to assign VGA_GPIO_SYNC to a GPIO that is not consecutive to the color pins. From a quick look at the code, it seems that this will only affect the pins initialization in vga.c, (VGA_GPIO_SYNC would need to be initialized separately):
// connect PIO to the pad
for (i = VGA_GPIO_FIRST; i <= VGA_GPIO_LAST; i++) pio_gpio_init(VGA_PIO, i);
...
// set pin direction to output
pio_sm_set_consecutive_pindirs(VGA_PIO, VGA_SM(layer), VGA_GPIO_FIRST, VGA_GPIO_NUM, true);
Can you confirm this? Is this change worth a pull request?
Hi I am working on a pico motherboard. My question is that if it's possible to move the output to other pins, because I still want the uart pins for data transmission.
Hi,
Amazing work! it all works out of the box!
1. I want to have a unified UF2 program demonstrating as much sub-examples as possible on a 16MB RP2040 (like this).
That way switching between examples will be easy as sending character to the serial interface or by pressing the BOOT button.
Do you plan on making such program? can I help?
2. I see you wrote about loading UF2 programs out of a SD card - sounds great!
Is it ready? Can you share your work?
3. For now I hold the BOOT button, while pressing and releasing the RESET button in order to upload new UF2 program,
Is it possible for the examples to keep running the USB Storage Device - so we can upload new UF2 without entering the boot mode?
Else, is it possible for the examples to enter the boot mode by sending '^' char on the virtual USB-Serial command?
I thought of connecting a USB-UART bridge, and use its flow-control lines to toggle the BOOT and RST lines-
(So I can change UF2 programs via a PC script) but it will require 2 USB ports so I think its better to solve it in the software..
4. After have a working hardware with the ability to switch examples in a button press / serial command,
I will design a small PCB for it and would love to share it here if possible :)
Thanks again for this repo and docs!
Arad ๐
Hello Miroslav,
I'm using this project as a graphics processor for an 8bit computer and it works great (I use the remaining pins and remaining PIO to connect to a 6502 8bit computer bus). I'm also using the Pico for USB keyboard and mouse support in the same project. In this work, I noticed that the Pico SDK included in this library is out of date. For my USB support, I manually updated the TinyUSB library to the latest version and just patched out anywhere there was a conflict with the older Pico SDK and that has worked.
However, I recently purchased a Pi Pico W for it's Wifi support and I'd like to use it with this project (giving my 8bit computer VGA, USB, and Wifi support). I'm sure I'm going to need to update the Pico SDK to make that work but I'm not exactly sure what you did originally to bring it into your build system. If you can provide any insight on that, I would appreciate it. I'm happy to provide a pull request with the updated code if I get it working either way.
Thanks!
Hello Mr. Miroslav Nemecek,
Thank you for this wonderful gift. I am making a GUI console for my hobby project with it. However, I have a few questions.
What License applies to this code? Is it ok to use in a commercial/closed source context?
Thank you for this code and the great YT video demonstrating it.
I was wondering if those were supposed to work with Raspberry reference design for attaching a VGA to a PICO.
Mine is the implementation of Pimoroni (that is supposed to respect that mapping): https://shop.pimoroni.com/products/pimoroni-pico-vga-demo-base
But right now it fail on me (could by my screen or Pico or Pico demo).
Thanks.
PS: If it's an alternate design maybe you would directly spot what need to be alter for all those example to work, it is mostly a matter of picking the right GPIO for the same usage.
I apologise in advance, my c is very rusty and this seems like a fairly straight forward task but I've been at it for hours and somehow I'm getting nothing coming out of the vga port anymore (though I should make clear compiling and running the demos included all worked).
I have an image that's 192x144 and I want to scale it to the VESA resolution, but I can't seem to get there. I've converted the source bmp using the tool you included and have:
// format: 8-bit pixel graphics
// image width: 192 pixels
// image height: 144 lines
// image pitch: 192 bytes
const u8 myImage[27648] __attribute__ ((aligned(4))) = {
// ...
I call this method to prepare the transform:
void SetMat()
{
// IMGW = 192, IMGH=144, WIDTH=1152, HEIGHT=864
Mat.PrepDrawImg(IMGW, IMGH, 0, 0, WIDTH, HEIGHT, 0, 0, 0, 0, 0);
Mat.ExportInt(MatInt);
}
Then my main
is - the setup videomode
bit being where I think it's going wrong but I copied from the other examples in the hope I could get it to work.
int main()
{
imageCanvas.img = (u8 *)myImage;
imageCanvas.w = IMGW;
imageCanvas.h = IMGH;
imageCanvas.wb = IMGW;
imageCanvas.format = CANVAS_8;
Canvas.w = WIDTH;
Canvas.h = HEIGHT;
Canvas.wb = WIDTH;
Canvas.format = CANVAS_8;
SetMat();
// setup videomode
VgaCfgDef(&Cfg); // get default configuration
Cfg.video = &VideoVESA; // video timings
Cfg.width = WIDTH; // screen width
Cfg.height = HEIGHT; // screen height
Cfg.wfull = WIDTH; // full width
Cfg.dbly = False; // double Y
VgaCfg(&Cfg, &Vmode); // calculate videomode setup
// // initialize base layer 0 to simple color (will be not visible)
// ScreenClear(pScreen);
// sStrip *t = ScreenAddStrip(pScreen, Vmode.height);
// sSegm *g = ScreenAddSegm(t, Vmode.width);
// ScreenSegmColor(g, 0xff00ff00, 0x00ff00ff);
// initialize system clock
if (clock_get_hz(clk_sys) != Vmode.freq * 1000)
set_sys_clock_pll(Vmode.vco * 1000, Vmode.pd1, Vmode.pd2);
// initialize videomode
VgaInitReq(&Vmode);
DrawImgMat(&Canvas, &imageCanvas, 0, 0, WIDTH, HEIGHT, &Mat, DRAWIMG_CLAMP, 0);
while (true)
{
// maybe call again later
// DrawImgMat(&Canvas, &imageCanvas, 0, 0, WIDTH, HEIGHT, &Mat, DRAWIMG_CLAMP, 0);
}
}
This isn't putting anything out on the the video port once it's running on the pico, and I'm hoping that โฆ someone(?) might be able to set me straight, again, on what I'd imagine is fairly straight forward.
Thanks in advance.
Are you using both SPI buses for this project? Will this project work with the "no OS SD" SD card driver if not? https://github.com/carlk3/no-OS-FatFS-SD-SPI-RPi-Pico Thank you for your time.
I have used esp32 vga library but vcc pin is not required to be connected.
Also in other library of yours you did not connected the vcc pin but in this library you have connected the vcc pin at pin number 9 with resisitor of 150 ohm.
This looks great as a project.
The build system seems very Windows specific, will this build with the Linux pico gcc tools ?
I have a "VGA demo base" for the Pico, how does the pinout compare, how do I configure it ?
Thanks.
How can I change the GPIO pins used in the PicoVGA library? In other words, my project has the eight video pins on non-sequential GPIOs. Is there a config file where I can specify that VGA_B0 is GPIO14, VGA_B1 is GPIO15, VGA_G0 is GPIO2, etc.....
Hi,
Please guide me to include a third-party library https://github.com/carlk3/no-OS-FatFS-SD-SPI-RPi-Pico in the picoVGA so that a file from a microSD card can be displayed over VGA monitor.
Thanks and regards,
Sourav
Hi I am trying to get a rca output to work with this circuit:
This circuit works by combining the five VGA signals (R, G, B, H and V) into a crude approximation of a monochrome [RS-170] signal. The resistors at the top do a rough weighting of the three color channels to approximate how the eye responds to intensity, and the two resistors at the bottom add a combined sync signal to the mix.
I have tried this circuit diagram with the vga output of the pico, so I can have 2 video out ports on my pico. However only the vga port worked, and the rca didn't.
I am not sure about the problem, but the possible problem might be:
Do you have any ideas how I can make this work?
Not understand,
if to use UART PINS GP0, GP1
what pins will be B0, B1 ?
I've been trying to use ScreenSegmAText
but it appears to crash PicoVGA.
I've tried with a few simple programs without luck.
As as test, I modified the matrix rain sample using ScreenSegmAText()
and it also doesn't work:
ScreenSegmAText(g, TextBuf, Font_Copy, FONTH, DefPal16, TEXTWB);
Expected output would be the matrix rain but with random CGA colors instead I get no monitor sync at all.
Hello.
First let me say thank you for creating this library and for the examples. I have learned how to use the library mostly from the examples.
I'm trying to use DrawImgMat to scale an image into a Canvas and it is very difficult for me to guess how to use it. There is no example code on how to use that functiona and the combitation with the cMat2D class.
So far my efforts yield only to a 1:1 scale. I have been able to use DrawImg and DrawRect and those functions work fine on the default Canvas.
I have an image that is 64x146 8BITMODE with Transparency.
I use first a call to PrepDrawImg(64,146,0,0,64 * 2,146 * 2,0,0,0,0,0) to prepare the matrix for a 2x scale.
Then I use
DrawImgMat(&Canvas, &SkullCanvas, 0, 0,64 *2, 146 *2, &Mat, DRAWIMG_TRANSP, 0);
I got an image that is 2x the original, but it is off center by the middle, and only 64,146 of the image is on display.
Is like scaling 2X then only displaying the original size, and not on the position 0,0 inside the Canvas, but on position 64,146.
This maybe is too much to ask, since you are not visiting this repo issue bucket since almost a year ago, but could you write a guide for using cMat2D and DrawImgMat for noobs like me?
Yes, the project has a web page, but sadly, I don understand why my code fails.
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.