Are non-standard VGA refresh rates possible? - Page 1
Forum section: electronics / projects

author: MarkS
author_rank: Unknown
timestamp: February 10, 2025, 03:48:53 pm
content: I'm working on a "simple" VGA circuit along the lines of what Ben Eater did, but with a 640x480 resolution. The problem is the 60Hz refresh rate. The info I can find only shows 60 and 70 Hz rates. I'd like to do 30 Hz. It's far more than I need for what I'm trying to do, and it would give me an entire extra frame to allow for CPU access. However, other than drawing the same frame twice, which negates the extra CPU access time due to having to access VRAM each frame, how can this be done? Can it be done? Is there a way to trick the monitor into accepting a different rate?

author: Retep
author_rank: Regular Contributor
timestamp: February 10, 2025, 04:09:38 pm
content: It depends on the monitor but most monitors will not accept a 30 Hz refresh rate.

author: Nominal Animal
author_rank: Super Contributor
timestamp: February 10, 2025, 09:12:42 pm
content: Agreed.As an example data point, my local store sells 24" Samsung Essential Monitor S3 (S24D304G, Full HD 1920×1080 IPS panel) for 100€.Its manual states that horizontal sync must be between 30 kHz and 110 kHz, and vertical sync between 48 and 100 Hz; pixel clock can be up to 224.25 MHz.The lower limits of Vsync ≥ 48 Hz and Hsync ≥ 30 kHz are very common with LCD displays. (CRTs were much pickier about the frequencies they'd accept, even the MultiSync ones.)Note that the standard 640×480 60Hz mode has Hsync = 31.469 kHz (total 800×525 clocks at 25.175 MHz, 59.94Hz refresh rate), so that reducing the frame rate drops the horizontal sync below what most monitors will accept, even before you hit the minimum frame rate the monitor would otherwise accept.There are small TFT IPS panels whose digital RGB+Hsync+Vsync+DE interface can do lower refresh rates; you might considerthesefor example. BuyDisplay.com (EastRising) also sells at eBay and AliExpress. I've got a few of these; I use microcontrollers to add useful little displays to my Linux SBC and router gadgets.

author: Someone
author_rank: Super Contributor
timestamp: February 10, 2025, 09:59:54 pm
content: Depends on the specific monitor being driven. "multisync" monitors would likely accept it ok, or pick some format that is interlaced?

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 10, 2025, 11:49:27 pm
content: As said above - it will depend on the monitor. But with standard VGA, there doesn't seem to be anything defined below 60 Hz.Some monitors sold in Europe may have accepted VGA @50 Hz too.Does it have to be able to address any/many kinds of existing monitors? Is this a personal project, something you want to open source? Something you want to sell?If you can go with a custom display, then I would consider sticking to something custom (all the more that VGA per se is pretty "deprecated" these days so you would target pretty much only old monitors, or more recent ones that happen to have a VGA input - relatively rare - or using an interface like VGA/HDMI, which would probably have even less chance of accepting odd timings unless you can select one that does and stick to it).So, we don't really know what you want to achieve. Generally speaking, for low refresh rates, I would probably favor TFT panels with integrated graphic RAM. But it looks as though you want to drive VGA monitors, so that probably doesn't answer your question.Are you going to use a MCU and if so, which one? A RP2350 could certainly do 640x480 @60 Hz with the help of the PIO plus one core dedicated to it, and the second core entirely free to do anything else. (A RP2040 would also be usable but the 2350 will give you extra oomph.) If you can do with 8-bit per pixel, that's 300 KB of frame buffer, which fits into a 2350 with extra RAM to spare for the rest. WIth 4 bpp, only half of that is needed. Just a few thoughts. (I'm not selling RPi chips.)

author: richard.cs
author_rank: Super Contributor
timestamp: February 11, 2025, 02:21:16 pm
content: Quote from: SiliconWizard on February 10, 2025, 11:49:27 pmI certainly had a Sony monitor that would run at 50 Hz, but it was horribly flickery. I doubt many will work at 30 Hz, so yes probably drawing the frame twice is your lot.

author: MarkS
author_rank: Unknown
timestamp: February 11, 2025, 03:10:02 pm
content: Thanks everyone. This wasn't a deal breaker, but I was hopeful. I can make it work just fine at 60 FPS. I was just hopeful I could give the CPU more VRAM access. No matter.

author: radiolistener
author_rank: Super Contributor
timestamp: February 11, 2025, 04:00:36 pm
content: Quote from: MarkS on February 10, 2025, 03:48:53 pmIt depends on exact display model. Many displays support 50 Hz refresh rate, despite it is not listed as supported. But I suspect 30 Hz is too low, so I think it will be hard to find display that supports so low refresh rate.

author: radiolistener
author_rank: Super Contributor
timestamp: February 12, 2025, 08:52:23 am
content: FYI, I just tested it on my old Samsung SyncMaster 19" 4:3 display withCode:wlr-randr --output HDMI-A-1 --custom-mode 1280x1024@30Hzit shows the picture, but it is unstable and has jitter, some pixels are doubled.

author: Langdon
author_rank: Frequent Contributor
timestamp: February 12, 2025, 02:57:01 pm
content: Can you just buy a cheapo graphics card off newegg?That could fix this whole problem.

author: Langdon
author_rank: Frequent Contributor
timestamp: February 12, 2025, 02:58:44 pm
content: I don't think the CPU itself handles anything video-related. I'm pretty sure the iGPU or the northbridge or something handles that sorta stuff.

author: MarkS
author_rank: Unknown
timestamp: February 12, 2025, 08:10:24 pm
content: This will be for a retro computer project.

author: CaptDon
author_rank: Super Contributor
timestamp: February 12, 2025, 08:15:20 pm
content: 30Hz sweep rate for vertical is too slow for a VGA CRT display!! The yolk will not have enough inductive reactance to control the current and will probably ruin the vertical sweep output stage. A 30Hz scan rate would flicker so bad it would absolutely suck. I can vary the scan rate on my 6 digit nixie tube display and anything under 48Hz becomes highly objectionable. It currently runs at 50Hz. NTSC was 30 frames per second transmitted as an even and odd field at 60 fields per second (actually 59.94). I have no idea how most LCD type monitors would react? Probaly get an upper half and a lower half superimposed on each other filling the whole screen.

author: Langdon
author_rank: Frequent Contributor
timestamp: February 13, 2025, 01:57:49 am
content: Quote from: MarkS on February 12, 2025, 08:10:24 pmWhen you are stuck at a point where the path is not clear, try stuff till it becomes clear.Try every monitor you can get your hands on thet manages to turn on; fiddle with settings; be creative and throw something together.Once you get it to work, build a better, more long-term solution.

author: rsjsouza
author_rank: Super Contributor
timestamp: February 13, 2025, 11:18:46 am
content: As others have said, 30Hz would be a hard requirement for actual VGA. The alternative for the slower computers of the time was composite video, which is relatively easy to do and operates interlaced, therefore reducing the effective workload to create a frame. But that has its own set of flickering issues.In the early 2000s a popular resolution used by microcontrollers was QVGA to handle the throughput, but that would be rather incompatible with a computer's typical resolutions for VGA, unless you scale down to CGA modes up to 320x240.

author: Nominal Animal
author_rank: Super Contributor
timestamp: February 13, 2025, 06:48:06 pm
content: (The VGA 320x200 256-color mode and its variants – the VGA CRTC was quite programmable –, used pixel doubling both horizontally and vertically, and actually used 640x400 timings: 70 Hz refresh, 31.778 kHz horizontal sync, and 25.175 MHz pixel clock. Note that the pixel aspect ratio was 4:5, i.e. not square pixels, but 20% taller than they were wide, because the 320×200 was displayed on a 4:3 display.)320×240 is still quite common among small (1" to 3.5") display modules. They almost always have square pixels and a 4:3 display aspect ratio. The native scan direction (if you wish to avoid tearing at high update rates) is usually 240×320. Using one byte per pixel you need a 76,800 byte framebuffer. 12-bit color is annoying to implement (because odd/even pixels need to be treated differently), but then 115,200 bytes suffices. 16-bit framebuffer is often used, and takes 153,600 bytes.For a full 320×240 16-bit framebuffer, you'd need at least 128k×16 SRAM (of which only the first 76,800 words are used for the framebuffer; 54,272 are unused); Mouser sells suitable ones at 2.5€ – 4€ in singles. Note that a 256k×16 SRAM gives you triple buffering with 31,744 words left over; for example ISSI IS62WV25616EBLL (2.2V to 3.6V, 45ns, 256k×16) costs 2.40€ in singles at Mouser. You then also need to be able to control the start address as well; modifying that gives you scrolling for free.I like to do my display experiments onTeensy 4.0andTeensy 4.1, that are very easy to program in the Arduino environment, and run at 600 MHz. The latter supports external PSRAM, up to two chips, for a total of 16 Mbytes. The downside in the standard Teensy is that none of the GPIO banks export consecutive pins/bits. The SparkFunMicroMod Teensydoes export the 9-bit LCD (DotClock, Enable, Hsync, Vsync, Data 0..8 (up to 9 bits)) and 13 contiguous FlexIO2 pins (for DMA). There are some tricks one can do with FlexIO and DMA on 4.0 and 4.1, too. For simple experiments, I simply drive GPIO pins in parallel, using look-up tables to allow for any pin order (within a bank). I've considered making my own Teensy 4.x compatible one designed for driving small display modules –– PJRC even sells the one proprietary part, thebootloader(which also handles the tricky part in power sequencing); I'd just export all 24 LCD pins, one or both USBs, the PSRAM interface, and whatever easily accessible GPIO pins are left for buttons and encoders ––, but the MCU itself, NXP MIMXRT1062DVJ6B, is 196-BGA at 0.8mm pitch, and it scares hobbyist me.