Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4586

Graphics, sound and multimedia • VGA sync timing issue

$
0
0
I'm trying to set up a VGA sync signal for 640x480, using a Pi Pico 2, and using arduino-pico core, but all i get on my display is "Invalid Format".
I'm not using PIOs, instead i'm using one regular core. I know it can be done without PIOs because PicoMiteVGA also handles video generation using regular cores instead of PIOs. I'm gonna be using a full Pico 2 just for video generation so performance overhead is not a concern. And i'm sure the correct Pico pins are connected to the correct VGA connector pins, so it has to be the code. Here is the code:

Code:

int VSYNC = 17;int HSYNC = 16;void setup() {    pinMode(VSYNC, OUTPUT);  pinMode(HSYNC, OUTPUT);  pinMode(19, OUTPUT);  // Initialize sync signals  gpio_put(VSYNC, HIGH);  gpio_put(HSYNC, HIGH);  gpio_put(19, HIGH);  // put your setup code here, to run once:}int line = 0;void generate_sync() {    while(true)  {    // Horizontal Sync Timing    // Front Porch    busy_wait_us(0.635);    // Sync Pulse    gpio_put(HSYNC, LOW);     busy_wait_us(3.81);     gpio_put(HSYNC, HIGH);     // Back Porch + Visible Area    busy_wait_us(1.906);         line++;    // Vertical Sync Timing    if (line == 525)     {      line = 0;    }        if (line == 0)  // Start VSYNC pulse    {      gpio_put(VSYNC, LOW);    }else if (line == 2)  // End VSYNC pulse after 2 lines    {      gpio_put(VSYNC, HIGH);    }  }  }void loop() {  generate_sync();}
Any ideas why the sync signal is not working properly and not being detected properly by the VGA display? I appreciate the help!

Statistics: Posted by PU5PSY — Thu Feb 13, 2025 2:09 am — Replies 0 — Views 13



Viewing all articles
Browse latest Browse all 4586

Trending Articles