<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Tomas<div class=""><br class=""></div><div class="">If you want to know how to program your video correctly you have to study your HW.</div><div class="">As I have another board (Pipistrello) as you have (Pepino) I can not send you my Verilog code as your HW is different.</div><div class=""><br class=""></div><div class="">If you look at your „RISC5_pepino.ucf" you will find:</div><div class=""> </div><div class=""><font color="#24292e" face="-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" class=""><span style="caret-color: rgb(36, 41, 46);" class="">NET "RGB[0]" LOC = "B10"; # RED 0<br class="">NET "RGB[1]" LOC = "A10"; # RED 1<br class="">NET "RGB[2]" LOC = "C11"; # RED 2<br class="">NET "RGB[3]" LOC = "A11"; # GREEN 0<br class="">NET "RGB[4]" LOC = "B12"; # GREEN 1<br class="">NET "RGB[5]" LOC = "A12"; # GREEN 2<br class="">NET "RGB[6]" LOC = "C13"; # BLUE 0<br class="">NET "RGB[7]" LOC = "A13"; # BLUE 1</span></font></div><div class=""><br class=""></div><div class="">So, the lowest three bits (0..2) are red, bits 3..5 are green and the most significant two (6..7) are blue.</div><div class=""><br class=""></div><div class="">These FPGA lines are <font color="#ff2600" class="">digital</font> 0 and 1s; but the VGA monitor wants <font color="#ff2600" class="">analog</font> RGB values, so you need a DAC (digital analog converter).</div><div class="">The following video shows you how this can be done: <a href="https://www.youtube.com/watch?v=wzhDRIX2Ors" class="">https://www.youtube.com/watch?v=wzhDRIX2Ors</a> (3:22 - 7:00)</div><div class="">and luckily on page 1 of the Pepino schematic <a href="http://www.saanlima.com/download/pepino-v1.1/pepino4-schematic.pdf" class="">http://www.saanlima.com/download/pepino-v1.1/pepino4-schematic.pdf</a></div><div class="">you see that Magnus foresaw three somewhat similar resistors for RED (RED0=2000 Ohm, RED1=1000 Ohm and RED2=560 Ohm).</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Now to „invert“ colors, it somewhat depends on what you expect. The easy one first: inverting white should result in black, shouldn’t it?</div><div class="">But what do you expect as inverted color of „orange“?</div><div class=""><br class=""></div><div class="">The easiest way to define „inverting colors" is to invert all bits and accept the outcome.</div><div class="">Hence inverting 0FF8000H (orange) results in 0007FFFH (="pure blue") </div><div class=""><br class=""></div><div class="">br</div><div class="">Jörg</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">Am 18.10.2018 um 11:29 schrieb Tomas Kral <<a href="mailto:thomas.kral@email.cz" class="">thomas.kral@email.cz</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Tue, 16 Oct 2018 14:57:11 +0200<br class="">Tomas Kral <<a href="mailto:thomas.kral@email.cz" class="">thomas.kral@email.cz</a>> wrote:<br class=""><br class=""><blockquote type="cite" class="">I cannot decide on the<br class="">palette map. In RGB triplet, leftmost byte influences RED most,<br class="">middle green, and last blue.<br class=""></blockquote><br class="">Quite the opposite.<br class=""><br class="">Best results obtained so far, by reordering bits in RGB register.<br class="">// RGB[7:0] = BB GGG RRR<br class="">assign RGB = {color[23:22], color[15:13], color[7:5]};<br class=""><br class="">Which I believe is matching resolution of Pepino LX9 board.<br class=""><br class="">Colour map now appears like this.<br class=""><br class=""> 00000000 black<br class=""> 00000080 dark red | 00FFFFFF white - based on SW[6]<br class=""> 00008000 green<br class=""> 00008080 yellow<br class=""> 00800000 deep blue<br class=""> 00800080 magenta<br class=""> 00808000 cyan<br class=""> 00808080 grey<br class=""> 00C0C0C0 light grey<br class=""> 000000FF red<br class=""> 0000FF00 light green<br class=""> 0000FFFF light yellow<br class=""> 00FF0000 blue<br class=""> 00FF00FF light violet<br class=""> 00FFFF00 light cyan<br class=""> 00FFFFFF white<br class=""><br class="">In invert mode SW[7], the colours do not swap as opposite, which makes<br class="">me wonder of bit reversal.<br class=""><br class="">// RGB[7:0] = RRR GGG BB <br class="">assign RGB = {<<{color[7:5]}, <<{color[15:13]}, <<{color[23:22]}};<br class=""><br class="">I googled that `<<' stands in Verilog for stream operator doing bit<br class="">reversing, if I am not mistaken and the above stands to be corrected.<br class="">It could also be little endianness that I often confuse. <br class=""><br class="">I really need to read some book on Verilog and FPGA, I have PDF by<br class="">Pong, if that is good one.<br class=""><br class=""><br class="">-- <br class="">Tomas Kral <<a href="mailto:thomas.kral@email.cz" class="">thomas.kral@email.cz</a>><br class="">--<br class=""><a href="mailto:Oberon@lists.inf.ethz.ch" class="">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems<br class=""><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" class="">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><br class=""></div></div></blockquote></div><br class=""></div></body></html>