VGA controller
VGA controller
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.
Re: VGA controller
Maybe this will help you:
http://www.serasidis.gr/circuits/AVR_VGA/avr_vga.htm
http://www.serasidis.gr/circuits/AVR_VGA/avr_vga.htm
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: VGA controller
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?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: VGA controller
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.
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.
Re: VGA controller
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.
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.
Re: VGA controller
Isn't someone here running a Propeller at 5V for some long time?
Re: VGA controller
KC9UDX wrote:
Isn't someone here running a Propeller at 5V for some long time?
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.
Re: VGA controller
cbmeeks wrote:
KC9UDX wrote:
Isn't someone here running a Propeller at 5V for some long time?
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.
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.
- jac_goudsmit
- Posts: 229
- Joined: 23 Jun 2011
- Location: Rancho Cucamonga, California
- Contact:
Re: VGA controller
KC9UDX wrote:
Isn't someone here running a Propeller at 5V for some long time?
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
Re: VGA controller
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.
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.
Re: VGA controller
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!
Re: VGA controller
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!
- jac_goudsmit
- Posts: 229
- Joined: 23 Jun 2011
- Location: Rancho Cucamonga, California
- Contact:
Re: VGA controller
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!
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