element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum cga to vga converter uPython
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 46 replies
  • Subscribers 291 subscribers
  • Views 5980 views
  • Users 0 members are here
  • python
  • raspberry pico
  • ask_an_expert
  • microcontrollers
  • teensy
  • vga
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

cga to vga converter uPython

rlaci
rlaci over 1 year ago

Hi

im new to uPython and needing some help with fast interrupts, port handling, reading into controller, handling the big amount of data and speed

my main aim is to get it working on raspberry pico, as colors 1bit resolution is enought as its an industrial equiment with RGBHV 15.6khz input(output from the machine) need to transfer it to 31khz VGA standard output for an lcd monitor

any help welcome

thanks!

  • Sign in to reply
  • Cancel

Top Replies

  • shabaz
    shabaz over 1 year ago +3
    There's a website listing monitors that support your resolution: http://15khz.wikidot.com/ I think it's far more likely that you'll be able to source a monitor if you search long enough on eBay, than…
  • beacon_dave
    beacon_dave over 1 year ago in reply to shabaz +3
    There is a PIO based implementation of a VGA driver discussed here if anyone is interested: https://www.youtube.com/watch?v=ZXMdZGQzrWg
  • michaelkellett
    michaelkellett over 1 year ago in reply to rlaci +3
    It's very, very difficult. You need to delve quite deeply into the data sheets. The things to look for are the IO toggle rate, maximum clock rate of internal RAM, and maybe some benchmarks of complete…
  • michaelkellett
    0 michaelkellett over 1 year ago in reply to rlaci

    It's very, very difficult.

    You need to delve quite deeply into the data sheets.

    The things to look for are the IO toggle rate, maximum clock rate of internal RAM, and maybe some benchmarks of complete designs although comparing across manufacturers is very hard with real designs.

    Another issue is that all manufacturers offer different speed versions and the fastest ones in the data sheet may not be readily obtainable.

    Very roughly, in ascending order of speed:

    iCE40: slow but very low power

    Gowin Little Bee: very similar to Lattice XP2

    Lattice XP2

    Intel/A;ltera  MAX10

    Efinix Trion

    AMD/Xilinx Spartan 3

    AMD/Xilinx Spartan7

    AMD/Xilinx Artix7

    I would recommend Lattice iCE40, Intel Max10,  Efinix Trion, Gowin Little Bee in that order for a beginner.

    Huge jump from Circuit Python to any of those.

    Key things in choosing are availability of chips, dev tools and support.

    If your volumes are small there will (usually) be very little support from the manufacturer.

    The Gowin is supported by very cheap tools from China (Aliexpress)

    This board might suit you because it has some video hardware built in - the Intel/Altera tools are free. I did a blog about this board a while ago:

     Kamami MAXimator FPGA Board 

    It's not the cheapest route but might suit your application.

    MK

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rlaci
    0 rlaci over 1 year ago in reply to shabaz

    if you tell me how can i read asynchronously one line with the bit positions without any clock signal then reproduce it at the exact positions i would be very happy because i think its nonsense

    as i experienced this VGA thing is pretty broadely understuud and sometimes there is a pixelclock for blank signals too sometimes nothing (actually measured it) and the VGA decoder chip sometimes reads a whole different resolution by its own as you are sending to and it all depends on the monitor side

    i feel you do not like python but i think to use python for pio setup what part is assembler language and the same for c sdk im not sure what the problem is there especially if im using the DMA

    yes it looks like a trivial task, but at high speeds some problems start to occur but you are right im a pretty beginner in microchip programming, im looking up the pico deeply now and would like to use that board as now i know it can do it for sure. i was switching between boards in the beginning, because i was not sure, please wish me luck or try to send some code to help if you want just stay positive please

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 1 year ago in reply to rlaci

    If you're sure you wish to proceed with Pico, then it will require assembler programming for the Pico's internal PIO module(s).
    The PIO is described in a user manual on the Raspberry Pi website (there are useful videos too, but everyone's primary source of info is the user manual), and there's lots of example code on the official GitHub site, but for sure there won't be a CGA to VGA converter, that's too niche. But there is very likely to be VGA output example code on the Internet for the Pico, so that you have something to examine.

    To learn to use the PIO, that's best achieved by reading the manual (it is well-written and there are only half a dozen or so instructions to learn, although there's approx. half a dozen concepts that can be applied to each instruction type), and try to follow some example code to make sense of it, and then try to read in data, and try to write out data, and learn how to use DMA, and stick with C to interface your code. It's difficult enough to learn something new, than to try to layer on another programming language when the bulk of the examples will combine the PIO with C, not Python. If C is new, then that's not an overly difficult language either, and you might not need to learn a lot, if you get lucky and find examples close to the task you're doing. For instance, if you wish to "do something" once a line, or once a frame of data has been received, then look for examples which use DMA to transfer data from the PIO for _any_ purpose, and the PIO code, and C code there will be approximately what you need for that specific bit of functionality.

    It's difficult to predict, but I think as a beginner, you may need to spend a week or so learning about PIO, trying some examples. If you're new to C, that requires a couple of weeks study and practice (I can recommend some books if you need that). Then expect to spend a further 3 weeks or so to experiment a bit, and design, develop and test your code (ballpark), and you may well have to scrap things and try different approaches, if you hit limits (because there are some limits with PIO), so it's best to experiment a bit first with some simpler projects, and examine with a 'scope, or other forms of debug, what's going on.

    EDIT: Just realized beacon_dave has already shared an example of PIO for VGA output, so you've got something to begin learning.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • beacon_dave
    0 beacon_dave over 1 year ago in reply to rlaci

    This may be why:

    "...I found out that the GBS-8200 and knockoffs only work with composite sync on signals that are below VGA frequencies..."

    https://www.insentricity.com/a.cl/219/cgargbi-to-analog-for-the-commodore-128

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 1 year ago in reply to beacon_dave

    I googled the other day (on mobile, I didn't keep the links) and found cgavga and cga2vga projects on GitHub, that would be worth the OP checking out too. I couldn't tell if they were any good or not (and one was using a HDL I'd not heard of), but there certainly seems to be resources out there. Time to get 'hands dirty' and try one of them out. If it fails and a different approach is needed then it's just a week or two of knowledge that will come in handy later for a beginner anyway. 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • beacon_dave
    0 beacon_dave over 1 year ago in reply to rlaci
    rlaci said:
    and what is the whole approach to make it work

    I just remembered that Micah did a fairly in depth LED video matrix panel driver project using Icestudio with an iCEBreaker FPGA board, which may be of some interest. The live stream recording is available here: 

    https://www.youtube.com/watch?v=IMIKTuaKBwI

    https://www.youtube.com/watch?v=fwhXM4oo8Gs

    https://www.youtube.com/watch?v=n3q17l1Zcus

    https://www.youtube.com/watch?v=MrrhLd4ddpg

    https://www.youtube.com/watch?v=3lnWdN8G40g

    https://www.youtube.com/watch?v=QxtYy0Wb1S0

    There is also an edited down version but you'll miss out on a lot of the detail.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
<
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube