Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VGA colors with Spartan 3E

Status
Not open for further replies.

deepa1206

Junior Member level 3
Junior Member level 3
Joined
Jun 12, 2009
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,518
Hi

I have a Spartan 3E board and I am working on a graphics project with the VGA controller. The userguide only mentions that 8 colors are possible. Is there any way I can generate more colors? Please let me know.

Thanks
 

Which VGA controller is it? Do you have datasheet? Schema of this Spartan 3E board?
 
The reason you just got 8 colors is becouse VGA signal is analog. Probably your board is making use some resistors to "convert" the digital output of the FPGA to something that can be used on VGA. But this leaves you with just 2 options per color becouse you just can make it high or low. So you got 3 basic colors and 2 options for each: 2^3 = 8 colors. If you want more colors you got find some way to creat an analog signal, or some other step between max and min.

Cya
 

Which VGA controller is it? Do you have datasheet? Schema of this Spartan 3E board?

It is the VGA controller which is part of the Spartan 3E Starter Kit. I only have the user guide, no datasheet.
Attaching the file.
 

Attachments

  • S3EStarter_ug230.zip
    7.2 MB · Views: 198

The reason you just got 8 colors is becouse VGA signal is analog. Probably your board is making use some resistors to "convert" the digital output of the FPGA to something that can be used on VGA. But this leaves you with just 2 options per color becouse you just can make it high or low. So you got 3 basic colors and 2 options for each: 2^3 = 8 colors. If you want more colors you got find some way to creat an analog signal, or some other step between max and min.

Cya

How can I do this? Do I need to solder external resistors?
 

You could do something similar to the attached schematic. The spartan-3E board I am currently using does precisely this. It uses 3 pins each for R and G, and 2 pins for B, so you get 8*8*4 = 256 colors.

Hope that helps!

 
Why only 2 bits are assigned for blue whereas red and green has 3 bits?
 

Why only 2 bits are assigned for blue whereas red and green has 3 bits?

Why not? You are not one of those symmetry loving monkeys I keep hearing about are you? ARE YOU? @_@

j/k ;-) ... suppose you ran out of pins and you had to compromise. Or suppose you wanted to use 8 bits per pixel. Or <fill_in_reason/>.
 
Hi

I have a Spartan 3E board and I am working on a graphics project with the VGA controller. The userguide only mentions that 8 colors are possible. Is there any way I can generate more colors? Please let me know.

Thanks

HI..i have a problem:!: i have a project with name "implementation of a VGA interface module.".i use xilinx ise ,and Xilinx Spartan2 XC2S50-PQ208.pls if you can help me with the VHDL CODE..to generate a 8 colors to a monitor crt..thx..waiting for your answer ..thanks >:D<
 

I tried using colour interlacing - but that was a bad idea due to low frame rate. If you want more colours - you'll have to solder something similar to post №7.
 

There's a method, when clk freq is much higher that usually used on 8 color VGA, which allows achieving more colors. Maybe someone have a document for this?
 

Look on Open cores web site. There is RTL code for an IBM compatible VGA controller on that site. By the way if you are talking about VGA, then on the 9-pin VGA connector there is only 3 color pins not 8. The 3 color pins are analog pins. That means there are no 2^3=8! If you connect the above schematic to a VGA monitor you destroy it. The signals are analog each ranging from 0 - 1 volt. Zero is pitch black and 1 is white. All other colors are in between the zero and one volt. Usually in a VGA card, the RGB values from digital logic are 8/8/8 bit which allows 2^24 colors to be selected. This 24-bit digital RGB is pushed into a RAMDAC which has 256 shades of RED, 256 shades of Blue, and 256 shades GREEN tables for a total of over a million colors. The output of the RAMDAC is the 3-bit analog RGB ( I mentioned earlier) which goes to the monitor. Look on your schematic to see if they are using a RAMDAC or not. You may have to add one externally if there is none. Remember what I mentioned here is the standard IBM VGA. It won't be true for other interfaces like HDMI, DVI and so on...
 
Last edited:

... If you connect the above schematic to a VGA monitor you destroy it. ...

If you mean the schematic I posted ... no it wil not destroy your VGA monitor. This is a working schematic, and so far it has not destroyed the monitor I connected to it. ;-)

Just calculate for 3.3 Volt CMOS outputs going into the resistors in the schematic I posted, keeping in mind that the input impedance on the monitor side is 75 Ohm (or up to about 100 Ohm including the vga cable). I am sure you will find that things do NOT go kaboom. :)
 
I'd like to agree on the "no-blow of the monitor" post, and ... The 3.3v max on anlog pic pins I think you belive is an issue I can only think that you are meaning the output won't get any higher than 3.3v because of the clamping.. I imagine the display may be a bit dim if you're only sending 3.3v to it but turning the brightness up would be OK for me to start...

If you connect the above schematic to a VGA monitor you destroy it.
"Check first" I'd say with anything disparaging about anyone's posts, it's not great if its not accurate, you know... No stress, but you know, nothing beats "doing it" yourself


I'd like to join this thread if its OK, because I'd love to make a video-dac for my own uses, I think it'll be a fast running PIC32, and I'll give the resistor-ladder effect a try... I was thinking of using tri-stating on the color pins to let them upto 5v (with pullups) so I'm interested in how a ladder fits in that! NI'll help I am sure, another trial install in a VM to come..!

---------- Post added at 23:46 ---------- Previous post was at 23:29 ----------

There's a method, when clk freq is much higher that usually used on 8 color VGA

what about, ?????
1) Using the RGB on 3 Parralell port peripheral pins and use interupts to send "lists" of 8 pulses per "pixel" to the lines as quick as possible? So the PWM list could be a pallette even to the GDI consumer, or a pallette of 24bit?

or?

2) Using 3 clocked serial data out lines as the RGB, and sending (as close to "together" as possible, "bytes", that were effectively PWM values for each line... trying to get 4 PWM bits per pixel, Sending 0xF1 would give "a lot" on the lef pixel, a little on the right, using 3 serial lines hope to give RGB. as soon as the data is sent we can interupt reload and kick it off again but might miss a tick, especially as it needs to will have to load its data (if its changed) during the VBLANK, probrably using PMP..

It can have a pin so its "controlling processor" can signal when it it needs to update the RAMDAC's video contents (or just parts by writing a little bit more code) and when the RAMDAC isn't too busy it can "fetch the changes" during the VBLANK period...
 

what about, ?????
1) Using the RGB on 3 Parralell port peripheral pins and use interupts to send "lists" of 8 pulses per "pixel" to the lines as quick as possible? So the PWM list could be a pallette even to the GDI consumer, or a pallette of 24bit?

I suspect that he means some sort of PWM or dithering approach. If you want to do that, you may want to take a look at the max frequency your PIC32 is going to be able to manage... For that sort of thing a CPLD/FPGA is a natural candidate. An microcontroller not so much. But hey, don't let me keep you from interesting tinkering experiments. ;)
 
The PIC32 I've just looked at will do 80Mhz (I hope on veroboard even)... I must admit I thought some HDL would come in somewhere for a "proper one" but thats something I have no experience of yet at all...
I'm just a bit "put off" by the chip-package, I'll have to get a PicTail too, and I'm only a veroboard engineer at home, no tools for "special" stuff, but we'll have a go eh....

Thanks Fib,
NEAL

---------- Post added at 10:24 ---------- Previous post was at 10:21 ----------

Just a thought, but more output-pins means a possibly many more "resistor ladder" control pins to give more colors the easiest, I imagine that'll be my way to more colors. The journey is where I intend I will learn the most from, and I'll let you know how I get on
Cool,
NEAL
 

The PIC32 I've just looked at will do 80Mhz (I hope on veroboard even)... I must admit I thought some HDL would come in somewhere for a "proper one" but thats something I have no experience of yet at all...
I'm just a bit "put off" by the chip-package, I'll have to get a PicTail too, and I'm only a veroboard engineer at home, no tools for "special" stuff, but we'll have a go eh....

Well, I'm an ex veroboard engineer at home. :p Anything except bga is pretty much doable with simple gear. The tip du jour would be to ditch the veroboards, and to use fully copper clad boards. Those are cheaper and give you better signal quality. :) And then do dead bug style (or manhattan style) construction. Like I said, cheaper and better (IMO). You have a nice continuous copper plane underneath all your components. And things like TSSOP with a 0.65 or 0.5 mm pitch are no problem, since you can bend the pins a little to give you room to work. The 0.5 mm QFN things do require patience though. :p

Anyways, the point is, if it's not BGA then you can prototype it at home.


And yeah, more pins for the resistor ladder will give you more colors. Dunno at what point it becomes impractical though. Personally I would maybe go to 5 resistors per color, but that's it. Not much use to put more effort into such a lowtech solution. If you want more better faster, then it might be time for a "proper" solution. ;) Such as an embedded board that has the whole video thing already figured out for you. :p

But as a learning experience it's pretty useful. :)
 

Yes, once your video requirements become sophisticated enough, you might as well use a specialised video DAC, like the ADV7123 or **broken link removed**, or move to DVI/HDMI.
 

Its a challenge of abstraction for me

Most of my video coding satisfaction requirements are have been catered for upto now really except this one. For over 30 years I've been "playing" (zx81 to start, the best thing was the 68000 Atari ST).... Learning at an early age about having to force an ST ramdac to rescan or scan-start (early using horizontal blank interupts and programming pulses *to* the RAMDAC's 50/not60hz bit) I am confident enough. DirectX, XNA, have done some nice things, even just C# Windows forms I've done a can give binary graphics framework based on sending a byte[][] value's result to a pixel in a picturebox as more "fun". I could even emulate the Atari's "bit-planed" video memory structure, and now understand more why it occurs.

I have (so everything is already "worked out already") a PC with a perfectly working WIMP OS, huge storage, simple decent scalable networking protocols and everything "in a bag", so by some theorists there would be no point even soldering a components on any PCB because its been done already, where I like to plan to try to do at least a bit of each "little bit" (each dot of the scanline, then eh?) then I learn more how that "normally abstracted form us lame normal people"'s layers would work, and why...

I would like to make a full OS one day from scratch, which on a PIC (keep it RISC eh:) means
.....I need to be able to add "user" programs to a list of (my) OS's running tasks (a ;normal;p stack/timer/idle setup), I'll need to have memory models, a display etc. So I am thinking of using the best instruction set I know best (680x0) as my base for thoughts as to how I would do this as it obviously needs an "assembled" language of instructions for the processing to "follow". ( just like any HDL code, or running anything running microcode. (386+) Like Java, .NET, GDI, Z80. A way to "List" instructions).. If I'm going to use 16bits for the instruction OP, if I am going to use ADD, SUB, ROL, TRAP etc, then it might as well look more than just a "bit like" 680x0 to the outside... When I ask it to add the value from address '12' to the address pointed to by A6, decrementing A6 at the same time, it will be "code" doing the operation on the pic, possibly directly onto SPI memory, or cached and done later... So if in my "assembled code "I am writing the contents of "$ffff800" then that is the "normal ST"'s video memory region, I can make the PIC send it to my own RAMDAC in place and I can say I can "build computers" and not just mean buy a board and chip and plug them in...

I have listed my resources, I'm not sure when they will change or how (but hopefully they may tomorrow with an interview coming up somewhere relevant), but I'll dive in when I find the bag of 200 and 1k resistors I bought and now cant find ...

As a coincidence I thought I was going to see THE "Mr Fibble" on "Dave" TV earlier, but it was a different episode I think... Scary indeed! lol
Thanks,
NEAL

---------- Post added at 20:26 ---------- Previous post was at 20:20 ----------

Not much use to put more effort into such a lowtech solution. If you want
Why not put the effort in?
Personally I would maybe go to 5 resistors per color, but that's it.
show me yours done and I'll admire it
 

Why not put the effort in?

Well, essentially because I am a lazy bastard! You can buy ready made cheap video solutions for a whole range of applications. So I'd rather use that, move on, and flush my time into other stuff that is not so readily available. Case in point, I'd get a Raspberry Pi, and use that for the video output. Okay, who am I kidding? I'd get three! XD
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top