6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Nov 13, 2024 2:45 am

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: VGA controller
PostPosted: Sun Dec 25, 2016 11:51 pm 
Offline

Joined: Sun Dec 25, 2016 11:36 pm
Posts: 2
Recently I've build very simple 6502 computer. Now I want to add VGA controller to it. I want to build a simple board with avr communicating via I²C with main board. The problem is I don't know how to solve timing problems when processing orders from main board. As I understood AVR needs to constantly send VGA signal. So if I interrupt avr when it needs to generate VGA signal I won't have time to process 6502's order. I can also interrupt avr to process order but then my VGA timing will be off and the video will be disturbed. What's the correct way of doing that? I think I haven't understood something or there's completely different methode to generate VGA signal.


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Mon Dec 26, 2016 12:39 am 
Offline

Joined: Wed Jul 20, 2016 2:14 am
Posts: 78
Location: Irkutsk, Russia
Maybe this will help you:
http://www.serasidis.gr/circuits/AVR_VGA/avr_vga.htm


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Mon Dec 26, 2016 1:27 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8540
Location: Southern California
See also the serial VGA circuits available that are shown at the end of the 6502 primer's "Displays" page, at http://wilsonminesco.com/6502primer/displays.html .

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Mon Dec 26, 2016 11:57 am 
Offline

Joined: Sun Dec 25, 2016 11:36 pm
Posts: 2
Thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Mon Dec 26, 2016 3:49 pm 
Offline

Joined: Wed Jul 20, 2016 2:14 am
Posts: 78
Location: Irkutsk, Russia
I'll add a little. If you want to do your own project, as a first step you should study the theory of VGA, i.e. how it works. The VGA signal is not continuous, it does have holes.
Communication with the VGA monitor is an unconditioned priority for ATmega. Here, all events must come very timely (match to right clock pulse). I mean the edges of horizontal and vertical synchronization pulses and video. The communication between ATmega and 6502 SBC is possible mainly during vertical flyback. This is not a lot of time, but a possibility anyway. Study the VGA timings.


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Wed Jan 11, 2017 8:18 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
One thing I'd like to add is that the Propeller micro-controller from Parallax is an excellent source for VGA output.

It cost $8 (plus a small EEPROM for about $1-$2) and passives. That's pretty much all you need and any USB to serial programmer can program it.

There are TONS of NTSC and VGA drivers developed for it and the assembly language it uses is pretty easy to learn.

The only downside is that it's 3v3 only. But many things are these days.

https://www.parallax.com/

The Propeller has 8 cores called "COGS" that run in parallel. A single COG can drive a VGA interface while another COG would fetch video data, etc.

Anyway, it's probably about the best non-PLD/FPGA solution for driving video.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Thu Jan 19, 2017 6:04 am 
Offline
User avatar

Joined: Sat Dec 07, 2013 4:32 pm
Posts: 246
Location: The Kettle Moraine
Isn't someone here running a Propeller at 5V for some long time?


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Thu Jan 19, 2017 1:54 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
KC9UDX wrote:
Isn't someone here running a Propeller at 5V for some long time?


If you ask the people over at Parallax, some will say they've pushed it to 5V. Especially for just I/O. But it isn't recommended.

It's one of those things that if it works...then great. But don't expect it to. And I've never read anyone say they run it at 5V for anything close to production.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Thu Jan 19, 2017 2:33 pm 
Offline
User avatar

Joined: Sat Dec 07, 2013 4:32 pm
Posts: 246
Location: The Kettle Moraine
cbmeeks wrote:
KC9UDX wrote:
Isn't someone here running a Propeller at 5V for some long time?


If you ask the people over at Parallax, some will say they've pushed it to 5V. Especially for just I/O. But it isn't recommended.

It's one of those things that if it works...then great. But don't expect it to. And I've never read anyone say they run it at 5V for anything close to production.


I did, it's someone here, I think. I can't quite recall who or what the project was.

It got my attentioin, because upon finding out that the Propeller I bought was 5V intollerant, I put it in permanent storage. To add bus transceivers to the project I intended to use it for defeated the point of using it.


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Thu Jan 19, 2017 10:21 pm 
Offline
User avatar

Joined: Thu Jun 23, 2011 2:12 am
Posts: 229
Location: Rancho Cucamonga, California
KC9UDX wrote:
Isn't someone here running a Propeller at 5V for some long time?


I did. I used a Propeller Quickstart board running a modified verison of my L-Star software as a troubleshooting tool, ROM replacement and virtual peripheral for my 5V MicroKim in my KimStar project (a side project of L-Star). See https://hackaday.io/project/4418. I had the I/O lines connected to the 5V bus for many hours and never had a problem.

If your project is simply to add a VGA output with a Propeller, you will run out of pins if you want to put the Propeller on the entire data bus to give the 6502 access to the VGA memory space. But if you want to just generate e.g. 80x25 columns of text, you only need 11 address lines instead of 16, so you should have enough lines left over for a 6-bit (+hsync + vsync) VGA text output. I'm thinking of doing this to add video to my MicroKim some day.

For graphics, you will need more hardware: the Propeller only has 32K of (hub) RAM and the firmware is loaded there too. But it's possible to let multiple Propellers work together and in sync (clock them all from the same oscillator) and let each of them generate part of the picture. But with graphics, you'll probably also run out of address space on the 6502 really quickly so you would have to think of different ways of interfacing anyway.

===Jac


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Thu Jan 19, 2017 11:38 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
I tried running one at 5 volts and it acted erratically, when I switched it back to 3.3 volts it worked normally, so I haven't tried it since.

One thing I am curious about. Is it possible to use the VGA driver with external RAM? That would allow for bitmapped graphics including text using the internal font in ROM.


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Fri Jan 20, 2017 7:40 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Jac - were you running the Propeller with a 3V supply, but with all I/O at 5V? That would be a sort of hybrid solution, moderately convenient, all it needs is a 3V regulator. Or a big resistor!


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Fri Jan 20, 2017 2:32 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
BigEd wrote:
Jac - were you running the Propeller with a 3V supply, but with all I/O at 5V? That would be a sort of hybrid solution, moderately convenient, all it needs is a 3V regulator. Or a big resistor!

Many people mix the Propeller running at 3.3 volts with 5 volt components. For output pins you can ignore the issue if the receiver interprets 3.3 volts as logic 1. For input pins you put a large resistor (3.3 K ohm or greater) to drop the current low enough that the Propeller can no longer be damaged by a voltage above 3.3 volts.


Top
 Profile  
Reply with quote  
 Post subject: Re: VGA controller
PostPosted: Sun Jan 22, 2017 5:28 am 
Offline
User avatar

Joined: Thu Jun 23, 2011 2:12 am
Posts: 229
Location: Rancho Cucamonga, California
BigEd wrote:
Jac - were you running the Propeller with a 3V supply, but with all I/O at 5V? That would be a sort of hybrid solution, moderately convenient, all it needs is a 3V regulator. Or a big resistor!


I ran the Propeller with a 3.3V supply (the QuickStart board has a built-in 3.3V regulator so I was forced to do it that way) and it was attached to the 5V address bus and data bus, and the R/!W and Phi2 outputs of the NMOS 6502. Data in both directions was transfered without problems (at 1MHz) and the Propeller didn't even get warm.

The MicroKIM has pull-up resistors on the data bus if I'm not mistaken, which helps with the 3.3V signals that the Propeller would put on the data bus, but I've used the Propeller on a 6502 (NMOS) system without pullups too.

Reversely, the Propeller seems to be fine with the 5V input signals. It's CMOS based so the inputs have a very high impedance. The thing that kills the I/O pins is current, and if the voltage is too high, the diode will sink too much current to keep the internal voltage down, and destroys itself. Based on the specifications of the Propeller, you should have a 2700 Ohm series resistor on input pins to make them 5V tolerant. There's an article on the Internet somewhere that explains it better than this.

Either way, direct connections without series resistors worked fine in my case but "your mileage may vary". I won't take responsibility if you let the Magic Smoke escape. By the way, if the 6502 in your system happens to be a CMOS (65C02) version, it also has high impedance inputs so if there are 2k7 series resistors on the data bus, the Propeller should still be able to drive the data bus of the 65C02 high. I must have also tried 2k7 series resistors in an NMOS 6502 system at 5V but I think I must have; when I started on my Propeddle project, I didn't have many chips and I was very careful not to fry anything.

Anyway, I always had the power supply of the Propeller at 3.3V, not 5V.

===Jac


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: