<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" itemscope="" itemtype="http://schema.org/WebPage">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<script type="text/javascript">/* Copyright 2008 Google. */ (function() { (function(){function e(a){this.t={};this.tick=function(a,c,b){this.t[a]=[void 0!=b?b:(new Date).getTime(),c];if(void 0==b)try{window.console.timeStamp("CSI/"+a)}catch(h){}};this.tick("start",null,a)}var a;if(window.performance)var d=(a=window.performance.timing)&&a.responseStart;var f=0<d?new e(d):new e;window.jstiming={Timer:e,load:f};if(a){var c=a.navigationStart;0<c&&d>=c&&(window.jstiming.srt=d-c)}if(a){var b=window.jstiming.load;0<c&&d>=c&&(b.tick("_wtsrt",void 0,c),b.tick("wtsrt_","_wtsrt",
d),b.tick("tbsd_","wtsrt_"))}try{a=null,window.chrome&&window.chrome.csi&&(a=Math.floor(window.chrome.csi().pageT),b&&0<c&&(b.tick("_tbnd",void 0,window.chrome.csi().startE),b.tick("tbnd_","_tbnd",c))),null==a&&window.gtbExternal&&(a=window.gtbExternal.pageT()),null==a&&window.external&&(a=window.external.pageT,b&&0<c&&(b.tick("_tbnd",void 0,window.external.startE),b.tick("tbnd_","_tbnd",c))),a&&(window.jstiming.pt=a)}catch(g){}})(); })()
</script>
<link rel="shortcut icon" type="image/x-icon" href="https://www.google.com/images/icons/product/sites-16.ico" />
<link rel="apple-touch-icon" href="https://ssl.gstatic.com/sites/p/438951/system/app/images/apple-touch-icon.png" type="image/png" />
<script type="text/javascript">/* Copyright 2008 Google. */ (function() { function d(a){return document.getElementById(a)}window.byId=d;function g(a){return a.replace(/^\s+|\s+$/g,"")}window.trim=g;var h=[],k=0;window.JOT_addListener=function(a,b,c){var f=new String(k++);a={eventName:a,handler:b,compId:c,key:f};h.push(a);return f};window.JOT_removeListenerByKey=function(a){for(var b=0;b<h.length;b++)if(h[b].key==a){h.splice(b,1);break}};window.JOT_removeAllListenersForName=function(a){for(var b=0;b<h.length;b++)h[b].eventName==a&&h.splice(b,1)};
window.JOT_postEvent=function(a,b,c){var f={eventName:a,eventSrc:b||{},payload:c||{}};if(window.JOT_fullyLoaded)for(b=h.length,c=0;c<b&&c<h.length;c++){var e=h[c];e&&e.eventName==a&&(f.listenerCompId=e.compId||"",(e="function"==typeof e.handler?e.handler:window[e.handler])&&e(f))}else window.JOT_delayedEvents.push({eventName:a,eventSrc:b,payload:c})};window.JOT_delayedEvents=[];window.JOT_fullyLoaded=!1;
window.JOT_formatRelativeToNow=function(a,b){a=((new Date).getTime()-a)/6E4;if(1440<=a||0>a)return null;var c=0;60<=a&&(a/=60,c=2);2<=a&&c++;return b?window.JOT_siteRelTimeStrs[c].replace("__duration__",Math.floor(a)):window.JOT_userRelTimeStrs[c].replace("__duration__",Math.floor(a))}; })()
</script>
<script>

  

  var breadcrumbs = [{"path":"/site/tandycocoloco/rgb2vga","deleted":false,"title":"FPGA RGB2VGA","dir":"ltr"}];
  var JOT_clearDotPath = 'https://ssl.gstatic.com/sites/p/438951/system/app/images/cleardot.gif';

  
  var JOT_userRelTimeStrs = ["a minute ago","__duration__ minutes ago","an hour ago","__duration__ hours ago"];

  
  

  

  var webspace = {"gvizGstaticVersion":"current","enableAnalytics":false,"pageSharingId":"jotspot_page","enableUniversalAnalytics":false,"sharingPolicy":"OPENED","siteTitle":"Tandy CoCoLoCo","onepickUrl":"https://docs.google.com/picker","adsensePublisherId":null,"features":{"oAuthForChartsApi":true,"contactStoreMigrationPollForGapi":true,"gapiLoaderUtil":true,"moreMobileStyleImprovements":null,"googleChartsOverGstatic":false,"picasaAlbumInsert":false,"pageDrafts":false,"enableJot2Atari":false,"plusBadge":false,"pdfEmbedSupport":false},"isPublic":true,"newSitesBaseUrl":"https://sites.google.com","isConsumer":true,"serverFlags":{"cajaBaseUrl":"//www.gstatic.com/caja","cajaDebugMode":false},"domainAnalyticsAccountId":"","plusPageId":"","signInUrl":"https://accounts.google.com/AccountChooser?continue\u003dhttps://sites.google.com/site/tandycocoloco/rgb2vga\u0026service\u003djotspot","analyticsAccountId":"","scottyUrl":"/_/upload","homePath":"/","siteNoticeUrlEnabled":null,"plusPageUrl":"","adsensePromoClickedOrSiteIneligible":true,"csiReportUri":"https://gg.google.com/csi","sharingId":"jotspot","termsUrl":"//www.google.com/intl/en/policies/terms/","gvizVersion":1,"editorResources":{"sitelayout":["https://ssl.gstatic.com/sites/p/438951/system/app/css/sitelayouteditor.css"],"text":["https://ssl.gstatic.com/sites/p/438951/system/js/codemirror.js","https://ssl.gstatic.com/sites/p/438951/system/app/css/codemirror_css.css","https://ssl.gstatic.com/sites/p/438951/system/js/trog_edit__en.js","https://ssl.gstatic.com/sites/p/438951/system/app/css/trogedit.css","/site/tandycocoloco/_/rsrc/1517549444000/system/app/css/editor.css","https://ssl.gstatic.com/sites/p/438951/system/app/css/codeeditor.css","/site/tandycocoloco/_/rsrc/1517549444000/system/app/css/camelot/editor-jfk.css"]},"sharingUrlPrefix":"/_/sharing","isAdsenseEnabled":true,"domain":"defaultdomain","baseUri":"/site/tandycocoloco","name":"tandycocoloco","siteTemplateId":false,"siteNoticeRevision":null,"siteNoticeUrlAddress":null,"siteNoticeMessage":null,"page":{"isRtlLocale":false,"canDeleteWebspace":null,"isPageDraft":null,"parentPath":null,"parentWuid":null,"siteLocale":"en","timeZone":"America/Los_Angeles","type":"text","title":"FPGA RGB2VGA","locale":"en","wuid":"wuid:gx:3dcd73350920a52c","revision":33,"path":"/rgb2vga","isSiteRtlLocale":false,"pageInheritsPermissions":null,"name":"rgb2vga","canChangePath":true,"state":"","properties":{},"bidiEnabled":false,"currentTemplate":{"path":"/system/app/pagetemplates/text","title":"Web Page"}},"canPublishScriptToAnyone":true,"user":{"keyboardShortcuts":true,"sessionIndex":"","onePickToken":"","guest_":true,"displayNameOrEmail":"guest","userName":"guest","uid":"","renderMobile":false,"domain":"","namespace":"","hasWriteAccess":false,"namespaceUser":false,"primaryEmail":"guest","hasAdminAccess":false},"gadgets":{"baseUri":"/site/tandycocoloco/system/app/pages/gadgets"}};
  webspace.page.breadcrumbs = breadcrumbs;

  
  var JOT_siteRelTimeStrs = ["a minute ago","__duration__ minutes ago","an hour ago","__duration__ hours ago"];

</script>
<script type="text/javascript">
                window.jstiming.load.tick('scl');
              </script>
<meta name="title" content="FPGA RGB2VGA - Tandy CoCoLoCo" />
<meta itemprop="name" content="FPGA RGB2VGA - Tandy CoCoLoCo" />
<meta property="og:title" content="FPGA RGB2VGA - Tandy CoCoLoCo" />
<style type="text/css">
</style>
<link rel="stylesheet" type="text/css" href="https://ssl.gstatic.com/sites/p/438951/system/app/themes/wintermint/standard-css-wintermint-ltr-ltr.css" />
<link rel="stylesheet" type="text/css" href="_/rsrc/1517549444000/system/app/css/overlay.css@cb=wintermint4a%25150goog-ws-leftnone30themedefaultstandard" />
<link rel="stylesheet" type="text/css" href="_/rsrc/1517549444000/system/app/css/camelot/allthemes-view.css" />
<!--[if IE]>
          <link rel="stylesheet" type="text/css" href="/site/tandycocoloco/system/app/css/camelot/allthemes%2die.css" />
        <![endif]-->
<title>FPGA RGB2VGA - Tandy CoCoLoCo</title>
<meta itemprop="image" content="https://sites.google.com/site/tandycocoloco/_/rsrc/1413058488747/rgb2vga/general.png" />
<meta property="og:image" content="https://sites.google.com/site/tandycocoloco/_/rsrc/1413058488747/rgb2vga/general.png" />
<script type="text/javascript">
                window.jstiming.load.tick('cl');
              </script>
</head>
<body xmlns="http://www.google.com/ns/jotspot" id="body" class=" en            ">
<div id="sites-page-toolbar" class="sites-header-divider">
<div xmlns="http://www.w3.org/1999/xhtml" id="sites-status" class="sites-status" style="display:none;"><div id="sites-notice" class="sites-notice" role="status" aria-live="assertive"> </div></div>
</div>
<div id="sites-chrome-everything-scrollbar">
<div id="sites-chrome-everything" class="">
<div id="sites-chrome-page-wrapper" style="direction: ltr">
<div id="sites-chrome-page-wrapper-inside">
<div xmlns="http://www.w3.org/1999/xhtml" id="sites-chrome-header-wrapper" style="height:auto;">
<table id="sites-chrome-header" class="sites-layout-hbox" cellspacing="0" style="height:auto;">
<tr class="sites-header-primary-row" id="sites-chrome-userheader">
<td id="sites-header-title" class="" role="banner"><div class="sites-header-cell-buffer-wrapper"><a href="index.html" id="sites-chrome-userheader-logo"><img id="logo-img-id" src="_/rsrc/1357668734165/config/customLogo.gif@revision=2" alt="Tandy CoCoLoCo" class="sites-logo  " /></a><h2><a href="index.html" dir="ltr" id="sites-chrome-userheader-title">Tandy CoCoLoCo</a></h2></div></td><td class="sites-layout-searchbox  "><div class="sites-header-cell-buffer-wrapper"><form id="sites-searchbox-form" action="https://sites.google.com/site/tandycocoloco/system/app/pages/search" role="search"><input type="hidden" id="sites-searchbox-scope" name="scope" value="search-site" /><input type="text" id="jot-ui-searchInput" name="q" size="20" value="" aria-label="Search this site" /><div id="sites-searchbox-button-set" class="goog-inline-block"><div role="button" id="sites-searchbox-search-button" class="goog-inline-block jfk-button jfk-button-standard" tabindex="0">Search this site</div></div></form></div></td>
</tr>
<tr class="sites-header-secondary-row" id="sites-chrome-horizontal-nav">
<td colspan="2" id="sites-chrome-header-horizontal-nav-container" role="navigation">
</td>
</tr>
</table>
</div>
<div id="sites-chrome-main-wrapper">
<div id="sites-chrome-main-wrapper-inside">
<table id="sites-chrome-main" class="sites-layout-hbox" cellspacing="0" cellpadding="{scmCellpadding}" border="0">
<tr>
<td id="sites-chrome-sidebar-left" class="sites-layout-sidebar-left initial" style="width:150px">
<div xmlns="http://www.w3.org/1999/xhtml" id="COMP_2bd" class="sites-embed" role="navigation"><div class="sites-embed-content sites-sidebar-nav"><ul role="navigation" jotId="navList"><li class="nav-first "><div dir="ltr" style="padding-left: 5px;"><a href="home" jotId="wuid:gx:4a605a86382ceaa4" class="sites-navigation-link">Home</a></div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="cocogl" jotId="wuid:gx:1104c7c6b466e9b0" class="sites-navigation-link">CoCoGL</a></div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="cursed" jotId="wuid:gx:427c5831a0191b4a" class="sites-navigation-link">Cursed</a></div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="dropbox" jotId="wuid:gx:4319c7b4036c9005" class="sites-navigation-link">Dropbox</a></div></li><li class=""><div class="current-bg" jotId="wuid:gx:3dcd73350920a52c" dir="ltr" style="padding-left: 5px;">FPGA RGB2VGA</div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="mda-cga-ega-to-vga" jotId="wuid:gx:7c4eb7c23e311932" class="sites-navigation-link">MDA/CGA/EGA to VGA</a></div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="mess-superide" jotId="wuid:gx:696f205e4abb644a" class="sites-navigation-link">MESS SuperIDE</a></div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="minted" jotId="wuid:gx:1441cf4ec07c1a08" class="sites-navigation-link">MinTED</a></div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="sidekick" jotId="wuid:gx:44f62a4c343c2ce0" class="sites-navigation-link">SideKick</a></div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="wired" jotId="wuid:gx:251cc954bcb72331" class="sites-navigation-link">Wired</a></div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="wordpak-2" jotId="wuid:gx:30de1c16a1ef9dd2" class="sites-navigation-link">WordPak 2+</a></div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="wordpak-rs" jotId="wuid:gx:3868e2108491c870" class="sites-navigation-link">WordPak-RS</a></div></li><li class=""><div dir="ltr" style="padding-left: 5px;"><a href="system/app/pages/sitemap/hierarchy" jotId="wuid:gx:552ac6f8e659b841" class="sites-navigation-link">Sitemap</a></div></li></ul></div></div>
</td>
<td id="sites-canvas-wrapper">
<div id="sites-canvas" role="main">
<div id="goog-ws-editor-toolbar-container"> </div>
<div xmlns="http://www.w3.org/1999/xhtml" id="title-crumbs" style="">
</div>
<h3 xmlns="http://www.w3.org/1999/xhtml" id="sites-page-title-header" style="" align="left">
<span id="sites-page-title" dir="ltr" tabindex="-1" style="outline: none">FPGA RGB2VGA</span>
</h3>
<div id="sites-canvas-main" class="sites-canvas-main">
<div id="sites-canvas-main-content">
<table xmlns="http://www.w3.org/1999/xhtml" cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox"><tbody><tr><td class="sites-layout-tile sites-tile-name-content-1"><div dir="ltr"><div><div><div><div style="margin-left:40px"><font size="3">This is a FPGA implementation of a RGB to VGA converter using the Altera DE0-Nano board.<br /><br /></font></div><div style="margin-left:40px"><font size="3">The Quartus II source code can be found at: <a href="https://github.com/lfantoniosi/rgb2vga" target="_blank" rel="nofollow">source code</a>. There is a branch for the SVGA 800x600 mode which solves the problem with missing borders.<br /><br /></font></div><div style="margin-left:40px"><font size="3">The board can be ordered at: <a href="https://oshpark.com/shared_projects/QwG4zF3f" rel="nofollow">Osh Park</a></font></div><div style="margin-left:40px"><br /></div><div style="margin-left:40px"><br /></div><div style="margin-left:40px"><font size="3"><font size="4"><b>RGB Format<br /></b></font></font></div><div style="margin-left:40px"><font size="3"><br />The CoCo3 has a RGB ouput port but it is pretty useless nowadays because it uses the old NTSC-like RGB format. The RGB was in vogue before the existence of the VGA monitors. <br /><br />This format outputs video using the same NTSC multiple frequency at 60  frames per second and displaying 262.5 lines. This is often called as 15Khz mode, because it displays 15,750 lines per second. You can call it as well 240p or 480i (30fps).<br /><br /></font></div><div style="margin-left:40px"><font size="3">With a nominal resolution of 800x262.2 pixels in overscan mode, only displaying 640x240 in the visible area, many computers adjusted their resolutions to this maximum. Some with 640x200 (coco3), and others with 512x212 (MSX2), etc. <br /><br /></font></div><div><div style="margin-left:40px"><font size="3">The only way to display more vertical lines is using a trick, or flickering. In the interlace mode, the computer will display first the odd lines in first frame and the even lines on second. This way, the 262.5 would be doubled to 425 with a visual flickering.</font><br /></div><br /></div><div style="margin-left:40px"><font size="3">The specs are:<br /><br /><table border="1" bordercolor="#888" cellspacing="0" style="border-collapse:collapse;border-color:rgb(136,136,136);border-width:1px"><tbody><tr><td style="width:164px;height:20px"> <font size="3">Horizontal Resolution</font></td><td style="width:155px;height:20px;text-align:right"> 800 px<br /></td></tr><tr><td style="width:164px;height:20px"> <font size="3">Vertical Resolution</font></td><td style="width:155px;height:20px;text-align:right"> 262.2 px<br /></td></tr><tr><td style="width:164px;height:20px"> <font size="3">Horizontal Frequency</font></td><td style="width:155px;height:20px;text-align:right"> 59.94 Hz<br /></td></tr><tr><td style="width:164px;height:20px"> <font size="3">Vertical Frequency</font></td><td style="width:155px;height:20px;text-align:right">15.74 Khz <br /></td></tr><tr><td style="width:164px;height:20px"> <font size="3">Pixel Clock</font></td><td style="width:155px;height:20px;text-align:right"> 14.31818 Mhz<br /></td></tr></tbody></table></font><font size="3"><br /><br /></font></div><div style="margin-left:40px"><font size="3">The clock pixel is a multiple of the NTSC color burst: 3.579545 Mhz. Three analog channels R,G and B are used. Some computers have separate vertical and horizontal sync, like the Coco3, some will have a composite sync (both mixed in one wire). Some will have the composite sync mixed on G channel, called Sync On Green. Some computers have a positive sync (coco3), as some will have a negative sync (MSX). Both syncs are TTL level.<br /><br /></font></div><div style="margin-left:40px"><font size="3">All these variants make part of the plethora of video format called by RGB. This is way some monitors like the Tandy CM-8 will work only with the coco3, and some other monitors will require a mod on the computer to accept the negative composite sync if you use it with a coco3.<br /><br /></font></div><div style="margin-left:40px"><font size="3">There is also the RGBI, or digital RGB. CGA or Commodore 128 will display 16 colors using 4 bits: RGB and I for intensity. In this format all signals including R,G and B are TTL level.<br /></font></div><div><b><font size="4"><br /></font></b><div style="margin-left:40px"><br /></div></div><div><div style="margin-left:40px"><font size="3"><b><font size="4">VGA Format</font></b></font><br /></div><font size="3"><br /></font></div><div><div style="margin-left:40px"><font size="3">The Video Graphics Array was introduced in 1987 for the IBM PS/2 models and its format was widespread as the new standard for computer video, replacing the EGA/MDA released years earlier.<br /><br /></font></div><div style="margin-left:40px"><font size="3">This video format is progressive scan with no flickering. But for this it will require faster clock speeds.<br /></font></div><div style="margin-left:40px"><font size="3"><br /></font></div><div style="margin-left:40px"><font size="3">The new specs for 640x480@60Hz are:<br /><br /></font><table border="1" cellspacing="0"><tbody><tr><td style="width:164px;height:20px"><font size="3"> Horizontal Resolution</font></td><td style="width:155px;height:20px;text-align:right"><font size="3"> 800 px<br /></font></td></tr><tr><td style="width:164px;height:20px"><font size="3"> Vertical Resolution</font></td><td style="width:155px;height:20px;text-align:right"><font size="3">525 px<br /></font></td></tr><tr><td style="width:164px;height:20px"><font size="3"> Horizontal Frequency</font></td><td style="width:155px;height:20px;text-align:right"><font size="3">60 Hz<br /></font></td></tr><tr><td style="width:164px;height:20px"><font size="3"> Vertical Frequency</font></td><td style="width:155px;height:20px;text-align:right"><font size="3">31.5 Khz <br /></font></td></tr><tr><td style="width:164px;height:20px"><font size="3"> Pixel Clock</font></td><td style="width:155px;height:20px;text-align:right"><font size="3"> 25.175 Mhz<br /></font></td></tr></tbody></table></div><font size="3"><br /></font><div style="margin-left:40px"><font size="3">As you can see it has the exactly double amount of lines from the previous RGB. This makes things easier for the convertor.<br /><br /></font></div><font size="3"><br /></font></div></div><div style="margin-left:40px"><b><font size="3"><font size="4">Building a Converter</font></font></b><br /></div></div><font size="3"><span> </span></font><br /><div style="margin-left:40px"><font size="3">Video converting requires dedicated integrated circuits to do the job. Since I started learning FPGA I wanted to know if would be possible to do this job using no extra IC and how good would be that.<br /></font></div><div style="margin-left:40px"><font size="3"><br /></font></div><div style="margin-left:40px"><font size="3">The starting point: how could you do such converter in VHDL?<br /><br /></font></div><div style="margin-left:40px"><font size="3">In short the VGA converter or scandoubler (15Khz to 31.5Khz) will digitize every RGB line and output it twice using the VGA clock frequency.<br /><br /><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/general.png?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1413058488747/rgb2vga/general.png" /></a></div><br /></font></div><div style="margin-left:40px"><font size="3"><br /></font></div><div style="margin-left:40px"><font size="3">The basic idea is to have an ADC (analog-to-digital converter) to digitize every pixel, save it into a buffer and display it using VGA frequency. The diagram above shows the basic function of a video converter.<br /><br /></font></div><br /><div style="margin-left:40px"><font size="3">The DE0-Nano has an internal SDRAM of 32MB. This is way more than we need for our framebuffer. For video output we can easily build a resistor chain and use a VGA connector. But how to build a fast ADC in FPGA ? Is that possible ?<br /><br /></font></div><font size="3"><br /></font><div style="margin-left:40px"><b><font size="3"><font size="4">Delta-Sigma Differential Inputs</font></font></b><br /></div><font size="3"><span> </span></font><br /></div><div style="margin-left:40px"><font size="3">Every FPGA chip has differential input/output pins called LVDS. The LVDS is made of 2 wires (a positive and a negative pin) and they work essentially as fast voltage comparators. In short you put your analog signal into the positive port and a voltage reference in the negative. The port will return 1 if higher, 0 otherwise.<br /><br /><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/lvds.png?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1413077454685/rgb2vga/lvds.png" /></a></div><br /></font></div><br /><div style="margin-left:40px"><font size="3"><font size="4"><b>Building an ADC</b></font><br /><br /></font></div><div style="margin-left:40px"><font size="3">We need a voltage reference to be compared against our signal and this voltage reference must be incremented every successive test. For this we can build a simple R2R DAC and let the FPGA control its voltage by  controlling the DAC output pins.<br /></font></div><div style="margin-left:40px"><font size="3"><br /></font></div><div style="margin-left:40px"><font size="3">Since the SDRAM access is slow and it runs at 100Mhz speeds only we need to use a color depth that is compatible with the this speed. For this project we will use 8-bit, what gives 256 different colors using RRRGGBB notation.<br /><br /></font></div><div style="margin-left:40px"><font size="3">Now we know that we need to built three 3-bit ADCs, well the blue component is 2-bits only but to reuse the same parts we digitize in 3-bit and discard the LSB.<br /><br /></font></div><div style="margin-left:40px"><font size="3">Using a 3-bit DAC we need to perform 8 comparisons. So for every pixel on screen will have 8 iterations in total. The FPGA clock must run 8 times faster than 14.31Mhz then.<br /><br /><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/DAC.png?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1413140438186/rgb2vga/DAC.png" /></a></div><br /></font></div><div style="margin-left:40px"><font size="3"><div style="display:block;text-align:left"></div><br /></font></div><div style="margin-left:40px"><font size="3">This shows the basic diagram of the R2R DAC connected to one LVDS port. For the RGB we need to connect the DAC to 3 different LVDS ports, one for each RGB channel. The variable resistor at the end of the chain allows us to adjust the voltage levels from 0.2 to 2.75V.<br /><br /><br /></font></div><div style="margin-left:40px"><font size="4"><b><font size="3">Measuring Voltages<br /><br /></font></b></font></div><div style="margin-left:40px"><font size="4"><font size="3">The voltage on each channel is measured using an integrador. We iterate the DAC output from 0 to 7 generating all 8 possible voltages and for each step check each R, G and B comparators. If the signal is higher than the DAC add 1, otherwise ignore. </font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">At the end of the 8th iterator we have the individual voltage for each channel.</font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">Since we need 8 iterations for each pixel this may cause some jitter or instability if we are in the edge of the pixel. That's why is important to have the clock in pair with the input pixel clock. Also adjust the input_detect module to trigger the DAC in the middle of the pixel (peak value).</font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><b>Genlock<br /><br /></b></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">The next step is to lock the video image and capture each individual frame. This is done by the genlock. The input video is a progressive 240p video made of 262.5 lines.<br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">Each line is separated by a HSYNC pulse. Each video frame is separated by a VSYNC pulse. The job of the genlock is to listen these signals and adjust the internal counters to generate the exact line and column that is being digitized.<br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">For exevy pixel clock tick, the HCOUNT is incremented. It goes from 0 to 799 for each line. After the HSYNC, the HCOUNT is zeroed and the VCOUNT is incremented. The VCOUNT goes from 0 to 262. After the VSYNC both HCOUNT and VCOUNT are zeroed and a new frame start again.<br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">Since we need to perform 8 tests each pixel, our HCOUNT goes instead from 0 to 6400. The current pixel column is HCOUNT/8.<br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">We also want to discard the front and back porches, so the digitization occurs only in the 640x240 window. This reduces memory bandwidth and optimizes the resolution to a 640x480 VGA monitor, avoiding pixelation.<br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/active.png?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1413236661107/rgb2vga/active.png" />This</a></div></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><b>Line Buffers</b><br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">SDRAMs cannot be accessed directly like Static RAMs. You need to set the command, row strobe, column strobe and then you have your data. This could take up to 6 clock cycles, but we need to access our pixel data instantly.<br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">For this we create two line buffers in internal RAM. Once the line is finished and our genlock is blanked between back/sync/front porch we send the entire line to the SDRAM using burst mode. After the line is sent, we can start again reusing the same line buffer.<br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">We need two line buffers, one for the incoming line and other for the output line.<br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">The line buffers can be easily implemented using Altera's ALTRAM modules. Just creating 2 dual port/dual clock RAM buffers of 1024 bytes each.in</font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">The same method applies to the output line, while blanking the new line is being read.<br /><br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><b>Framebuffer<br /><br /></b></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">The entire framebuffer is stored into the SDRAM one line each time. The SDRAM module will read and from from/to the line buffers performing the transfer. Once its finished it raises an ack wire.<br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">The SDRAM module operates on same clock speed of the genlock (114Mhz) and it writes and reads a line in burst mode.<br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">Since we write and read the framebufffer so fast we don't need to perform any refresh. In fact a refresh routine would stall the operation and affect the operation.<br /><br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><b>VGA outuput<br /><br /></b></font></font></div><div style="margin-left:40px"><font size="4"><font size="3">The video is output by the vga out module that reads one line each time and displays it twice. The analog video is generated using resistors in paralel for each color bit: 680Ohms, 1K, 2K for bits 2,1 an 0.<br /><br /><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><b>Schematics</b>:<br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><br /><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/scheme.png?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1415113421412/rgb2vga/scheme.png" style="width:100%" /></a></div><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><b>Board:<br /><br /><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/board.png?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1415113502601/rgb2vga/board.png" style="width:100%" /></a></div><br /></b></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><br /></font></font></div><div style="margin-left:40px"><br /><font size="4"><font size="3"><font size="4"><font size="3"><b>Additional Features<br /><br /></b></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3">In the final project I added an composite monitor input into the green channel. Changing the FPGA code this allows us to support Apple II composite signal and even display artifact colors for it.<br /><br /><br /></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><b>Bill Of Materials</b><br /></font></font></font></font><br /><font size="3"><font><font size="3"><div style="margin-left:40px">1x<span style="white-space:pre"> </span>TRIMMER 10K OHM 0.2W PC PIN</div><div style="margin-left:40px">3x<span style="white-space:pre"> </span>RES 75 OHM 1/4W 1% AXIAL</div><div style="margin-left:40px">8x<span style="white-space:pre"> </span>RES 1K OHM 1/4W 5% CARBON FILM</div><div style="margin-left:40px">4x<span style="white-space:pre"> </span>RES 2K OHM 1/4W 5% CARBON FILM</div><div style="margin-left:40px">2x<span style="white-space:pre"> </span>RES 47 OHM 1/4W 5% CARBON FILM</div><div style="margin-left:40px">3x<span style="white-space:pre"> </span>RES 750 OHM 1/4W 5% CARBON FILM</div><div style="margin-left:40px">3x<span style="white-space:pre"> </span>RES 1K5 OHM 1/4W 5% CARBON FILM</div><div style="margin-left:40px">3x<span style="white-space:pre"> </span>RES 3K OHM 1/4W 5% CARBON FILM</div><div style="margin-left:40px"><span style="background-color:transparent">1x</span><span style="white-space:pre;background-color:transparent"> </span><span style="background-color:transparent">CONN HEADER 10POS .100 STR TIN (COCO3 HEADER MALE)</span></div><div style="margin-left:40px">1x<span style="white-space:pre"> </span>CONN HD D-SUB RCPT R/A 15POS (VGA OUTPUT CONNECTOR FEMALE)</div><div style="margin-left:40px">1x<span style="white-space:pre"> </span>SWITCH SPST GOLD 8 SEC 50V (DIP SWITCH 8-POSITION)</div><div style="margin-left:40px">2x<span style="white-space:pre"> </span>CON HEADER FEMALE 40POS (<b style="background-color:rgb(255,0,0)">FEMALE </b>HEADER 40 POSITIONS, 2 ROWS)</div><div style="margin-left:40px"><br /></div><div style="margin-left:40px"><br /></div></font></font></font></div><div style="margin-left:40px"><font size="3"><font><font size="3"><div style="margin-left:40px"><b>Optional for Composite monochrome (Apple2) or Non-coco3 computers, RGBI: </b></div><div style="margin-left:40px"><br /></div></font></font></font></div><div style="margin-left:40px"><font size="3"><font><font size="3"><div style="margin-left:40px">1x<span style="white-space:pre"> </span>LM1881N/NOPB-ND<span style="white-space:pre"> </span>IC VIDEO SYNC SEPARATOR 8-DIP</div></font></font></font><div style="font-size:medium;margin-left:40px">1x<span style="white-space:pre"> </span>RES 680K OHM 1/4W 5% CARBON FILM</div><div style="font-size:medium;margin-left:40px"><span style="background-color:transparent">2x</span><span style="white-space:pre;background-color:transparent"> </span><span style="background-color:transparent">CAP CER 0.1UF 100V 10% RADIAL</span></div><div style="font-size:medium;margin-left:40px"><div><span style="background-color:transparent">3x</span><span style="white-space:pre;background-color:transparent"> </span><span style="background-color:transparent">3M9447-ND<span style="white-space:pre"> </span></span><span style="background-color:transparent">CONN HEADER VERT SGL 2POS GOLD (JUMPER HEADER)</span></div><div>1x<span style="white-space:pre"> </span>CONN JACK RCA R/A METAL ORG PCB (RCA COMPOSITE INPUT)</div><div>1x<span style="white-space:pre"> </span>CONN HD D-SUB RCPT R/A 15POS (RGB VGA-LIKE INPUT CONNECTOR FEMALE)</div></div><font size="3"><font><font size="3"><div style="margin-left:40px"><br /></div><div style="margin-left:40px"><span style="font-size:10pt;background-color:transparent">Important: See Modification below</span></div></font></font></font></div><div style="margin-left:40px"><div style="margin-left:40px"><br /></div><br /><font size="4"><font size="3"><font size="4"><font size="3"><b>Assembling Instructions<br /></b></font></font></font></font></div><div style="margin-left:40px"><br /></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3">The stacking header go under the board. They will be soldered on top. All the other components remains on top. The board is plugged on top of the <br />Altera DE0 Nano. Follow the GPIO0 and GPIO1 orientations.</font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><br /></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><br /></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><b>Modifications</b></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><b><br /></b></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3">I have changed some resistor for the VGA DAC. Please, replace the values as below. And add a new 3K0 as show below. All values are in Ohms. R7 and R8 are mixed together to compose the blue output so there is no difference if you connect the new resistor to R7 or R8.</font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><br /></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><div style="display:block;text-align:left"></div><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/new%20resistors2.png?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1422737747174/rgb2vga/new&#32;resistors2.png" /></a></div><br /><br /></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><b>RGBI</b></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><br /></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3">Optionally you can modify the board to support RGBI to be used with Tandy 1000, Commodore 128 or Spectrum 128+.  You just add 2x 1K0 resistor for the Bright channel. Make you cable to output the Bright through the RGB input pin 4. WARNING: The R,G and B lines don't have voltage dividers, instead they have a 75R pull down. Connecting it directly could damage the Altera permanently. Use a 150R resistor on the three lines in your cable for the R, G and B lines. The Bright line is already safe by this change. The RGBI can be switched by the switch RGBI</font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><br /></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/bright.png?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1422738635036/rgb2vga/bright.png" /></a></div></font></font></font></font></div><div style="margin-left:40px"><br /></div><div style="margin-left:40px"><font size="3"><br /></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><br /></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3"><b>Usage<br /><br /></b></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3">The 3 jumpers are used to drive the composite video to the sync separator and also to drive the separated sync signals to the H and V syncs. If you use it with an Apple II composite, short all 3 jumpers, if using a RGB computer with composite sync, short only J2 and J3 and use the RGB IN port. When using a computer with separated H and V, use the coco3 port.<br /><br /></font></font></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><font size="4"><font size="3">The DIP switches changed in the last github versions. The last dip switches are for:<br /><br /><table border="1" bordercolor="#888" cellspacing="0" style="border-collapse:collapse;border-color:rgb(136,136,136);border-width:1px"><tbody><tr><td style="width:163px;height:22px"> SHRINK<br /></td><td style="width:550px;height:22px"><font size="4"><font size="3"><font size="4"><font size="3">Shrink the image to show 720x240. Normal mode is 640x240. Some computers need the borders to be shown.</font></font></font></font></td></tr><tr><td style="width:163px;height:40px"> OFFSET<br /></td><td style="width:550px;height:40px"><font size="4"><font size="3"><font size="4"><font size="3">Use this jumper to use alternate offset (centering)</font></font></font></font></td></tr><tr><td style="width:163px;height:20px"> DEINTERLACE</td><td style="width:550px;height:20px">De-interlaces odd-even fields. For flicker free images on Amiga</td></tr><tr><td style="width:163px;height:20px"> APPLE ][</td><td style="width:550px;height:20px">For Apple II it will make the display black and white instead of green</td></tr><tr><td style="width:163px;height:20px"> ARTIFACT INVERSE</td><td style="width:550px;height:20px">reverse the fake colors (coco3)</td></tr><tr><td style="width:163px;height:20px"> ARTIFACT</td><td style="width:550px;height:20px">T<font size="4"><font size="3"><font size="4"><font size="3">o use fake colors on Coco2 or to reconstruct Apple 2 colors (use with Apple2 switch as well)</font></font></font></font></td></tr><tr><td style="width:163px;height:20px"> RGBI</td><td style="width:550px;height:20px">Use the Bright input as RGBI. Note the R,G and B are still analog and need a proper trimmer adjust for the better image.</td></tr><tr><td style="width:163px;height:20px"> SCANLINE</td><td style="width:550px;height:20px">Turns scanlines on/off</td></tr></tbody></table></font></font></font></font></div><br /><div style="margin-left:40px"><font size="4"><font size="3"><br /></font></font></div><div style="margin-left:40px"><font size="3"><b>Assembled board</b></font></div><div style="margin-left:40px"><font size="3"><b><br /></b></font></div><div style="margin-left:40px"><font size="3"><b><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/board-top.jpg?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1420355803432/rgb2vga/board-top.jpg" /></a></div><br /></b></font></div><div style="margin-left:40px"><font size="3"><b><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/board-side.jpg?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1420355841044/rgb2vga/board-side.jpg" /></a></div><br /></b></font></div><div style="margin-left:40px"><font size="3">New board with 3-bit blue and RGBI input:</font></div><div style="margin-left:40px"><font size="3"><br /></font></div><div style="margin-left:40px"><font size="3"><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/changes.JPG?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1422738851366/rgb2vga/changes.JPG" /></a></div><br /></font></div><div style="margin-left:40px"><font size="4"><font size="3"><br /></font></font></div><div style="margin-left:40px"><font size="3"><b>Images</b></font></div><div style="margin-left:40px"><font size="3"><b><br /></b></font></div><div style="margin-left:40px"><font size="3"><b><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/image-rtype.jpg?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1420355977788/rgb2vga/image-rtype.jpg" /></a></div><br /></b></font></div><div style="margin-left:40px"><font size="4"><font size="3"><div style="display:block;text-align:left"><a href="https://sites.google.com/site/tandycocoloco/rgb2vga/image-theater.jpg?attredirects=0" imageanchor="1"><img border="0" src="_/rsrc/1420356005195/rgb2vga/image-theater.jpg" /></a></div><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><div style="display:block;text-align:left"></div><br /></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><b>Videos:<br /><br /><a href="https://www.youtube.com/watch?v=xgMjMySxE4w">Box Filtering</a><br /><br /><a href="https://www.youtube.com/watch?v=dw5HMWgIjnw">Apple II</a><br /><br /></b></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><b><a href="https://www.youtube.com/watch?v=7q2_E9-EiTE">CoCo3</a><br /><br /></b></font></font></div><div style="margin-left:40px"><font size="4"><font size="3"><b><a href="https://www.youtube.com/watch?v=ZVzbcofWbIk">Apple IIc</a><br /><br /></b></font></font></div></div></td></tr></tbody></table>
</div> 
</div> 
<div id="sites-canvas-bottom-panel">
<div xmlns="http://www.w3.org/1999/xhtml" id="COMP_page-subpages"> </div>
<div id="sites-attachments-container">
</div>
<a xmlns="http://www.w3.org/1999/xhtml" name="page-comments"></a>
<div xmlns="http://www.w3.org/1999/xhtml" id="COMP_page-comments"><div class="sites-comment-docos-wrapper"><div class="sites-comment-docos"><div class="sites-comment-docos-background"></div><div class="sites-comment-docos-header"><div class="sites-comment-docos-header-title">Comments</div></div><div id="sites-comment-docos-pane" class="sites-comment-docos-pane"></div></div></div></div>
</div>
</div> 
</td> 
</tr>
</table> 
</div> 
</div> 
<div id="sites-chrome-footer-wrapper">
<div id="sites-chrome-footer-wrapper-inside">
<div id="sites-chrome-footer">
</div>
</div>
</div>
</div> 
</div> 
<div id="sites-chrome-adminfooter-container">
<div xmlns="http://www.w3.org/1999/xhtml" class="sites-adminfooter" role="navigation"><p><a class="sites-system-link" href="https://www.google.com/a/UniversalLogin?continue=https://sites.google.com/site/tandycocoloco/rgb2vga&amp;service=jotspot">Sign in</a><span aria-hidden="true">|</span><a class="sites-system-link" href="system/app/pages/recentChanges">Recent Site Activity</a><span aria-hidden="true">|</span><a class="sites-system-link" href="system/app/pages/reportAbuse" target="_blank">Report Abuse</a><span aria-hidden="true">|</span><a class="sites-system-link" href="javascript:;" onclick="window.open(webspace.printUrl)">Print Page</a><span aria-hidden="true">|</span><span class="sites-system-link">Powered By</span> <b class="powered-by"><a href="../../../accounts.google.com/ServiceLogin@continue=https%253A%252F%252Fsites.google.com%252F&amp;followup=https%253A%252F%252Fsites.google.com%252F&amp;service=jotspot&amp;passive=true&amp;ul=1">Google Sites</a></b></p></div>
</div>
</div> 
</div> 
<div id="sites-chrome-onebar-footer">
</div>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
    window.jstiming.load.tick('sjl');
  </script>
<script xmlns="http://www.w3.org/1999/xhtml" src="https://ssl.gstatic.com/sites/p/438951/system/js/jot_min_view__en.js"></script>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
    window.jstiming.load.tick('jl');
  </script>
<script xmlns="http://www.w3.org/1999/xhtml">
      
          sites.core.Analytics.createTracker();
          sites.core.Analytics.trackPageview();
        
    </script>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
                    sites.Searchbox.initialize(
                        'sites-searchbox-search-button',
                        {"object":[]}['object'],
                        'search-site',
                        {"label":"Configure search options...","url":"/site/tandycocoloco/system/app/pages/admin/settings"});
                  </script>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
      gsites.HoverPopupMenu.createSiteDropdownMenus('sites-header-nav-dropdown', false);
    </script>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript" defer="true">
            JOT_setupNav("2bd", "Navigation", true);
            JOT_addListener('titleChange', 'JOT_NAVIGATION_titleChange', 'COMP_2bd');
          </script>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
              new sites.CommentPane('//docs.google.com/comments/d/AAHRpnXtASf_M2E6cjJ9Hgufts3Rf9PYa38729OyYQRYslT4vxFC7v4WAXn14I1GqLszm0TdoMOhWSkAn2qjkNIC63Gck7GCmIWCtXxlki-l56ufcS6ZvSRATWklueSAtXFR-6DsKB3P5/api/js?anon=true',
                  false, false);
            </script>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
  setTimeout(function() {
    var fingerprint = gsites.date.TimeZone.getFingerprint([1109635200000, 1128902400000, 1130657000000, 1143333000000, 1143806400000, 1145000000000, 1146380000000, 1152489600000, 1159800000000, 1159500000000, 1162095000000, 1162075000000, 1162105500000]);
    gsites.Xhr.send('https://sites.google.com/site/tandycocoloco/_/tz', null, null, 'GET', null, null, { afjstz: fingerprint });
  }, 500);
</script>
<script xmlns="http://www.w3.org/1999/xhtml">
                    window.onload = function() {
                      if (false) {
                        JOT_setMobilePreview();
                      }
                      var loadTimer = window.jstiming.load;
                      loadTimer.tick("ol");
                      loadTimer["name"] = "load," + webspace.page.type + ",user_page";
                      window.jstiming.report(loadTimer, {}, 'https://gg.google.com/csi');
                    }
                  </script>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
        JOT_insertAnalyticsCode(false,
            false);
      </script>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
    var maestroRunner = new gsites.pages.view.SitesMaestroRunner(
        webspace, "en");
    maestroRunner.initListeners();
    maestroRunner.installEditRender();
  </script>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript" defer="true">
  //<![CDATA[
    // Decorate any fastUI buttons on the page with a class of 'goog-button'.
    if (webspace.user.hasWriteAccess) {
      JOT_decorateButtons();
    }

    // Fires delayed events.
    (function() {
      JOT_fullyLoaded = true;
      var delayedEvents = JOT_delayedEvents;
      for (var x = 0; x < delayedEvents.length; x++) {
        var event = delayedEvents[x];
        JOT_postEvent(event.eventName, event.eventSrc, event.payload);
      }
      JOT_delayedEvents = null;
      JOT_postEvent('pageLoaded');
    })();
  //]]>
</script>
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript">
    JOT_postEvent('decorateGvizCharts');
  </script>
<script type="text/javascript">
          JOT_setupPostRenderingManager();
        </script>
<script type="text/javascript">
          JOT_postEvent('renderPlus', null, 'sites-chrome-main');
        </script>
<div id="server-timer-div" style="display:none"> </div>
<script type="text/javascript">
          window.jstiming.load.tick('render');
          JOT_postEvent('usercontentrendered', this);
        </script>
</body>
</html>
