{"id":572,"date":"2024-05-20T19:45:57","date_gmt":"2024-05-20T18:45:57","guid":{"rendered":"http:\/\/robert.vanyi.org\/en\/?p=572"},"modified":"2024-05-22T22:55:47","modified_gmt":"2024-05-22T21:55:47","slug":"fixing-the-ramdac","status":"publish","type":"post","link":"https:\/\/robert.vanyi.org\/en\/archives\/572","title":{"rendered":"Fixing the RAMDAC"},"content":{"rendered":"\n<p>Yesterday I was unable to solve the issue with the RAMDAC not setting the color value register, so I gave up, and decided to make an entry about the progress so far. But I was so tired that I decided to do it this morning, making use of the public holiday. I was watching enough videos from Ben Eater by now to start suspecting the timing. Especially when I was trying to connect my clock module and sporadically the results randomly changed. <\/p>\n\n\n\n<p>Today morning with fresh head, after creating the blog entry, I looked again into the G171 specification (as of today available for example <a rel=\"noreferrer noopener\" href=\"https:\/\/retronn.de\/ftp\/docs\/pc_hardware\/DACs\/INMOS_G171.pdf\" target=\"_blank\">here<\/a>, or as part of the INMOS Graphics Databook <a rel=\"noreferrer noopener\" href=\"http:\/\/www.transputer.net\/ibooks\/72-trn-204-00\/graph1st.pdf\" target=\"_blank\">here<\/a>), and looked at the timings. The only difference I could see between the address register and the color value register was the minimal delay between address \/ color write and next read. For the address register it is t<sub>WHRL3<\/sub>, for the color value register it is t<sub>WHRL2<\/sub>. Timing between color value writes is t<sub>WHRL1<\/sub>. For t<sub>WHRL1<\/sub> the minimum is defined as \u03c4<sub>1<\/sub>, for t<sub>WHRL2<\/sub> as well as for t<sub>WHRL3<\/sub> it is \u03c4<sub>2<\/sub>, where \u03c4<sub>1<\/sub>=3 x t<sub>CHCH<\/sub> and \u03c4<sub>2<\/sub>=6 x t<sub>CHCH<\/sub>. The value t<sub>CHCH<\/sub> is the time between two consecutive raising edges of the clock.<\/p>\n\n\n\n<p>I decided to print out the data sheet, because I can think better if I can have it in my hand and make notes or drawings. But before looking into the papers I made some thoughts how I can insert a clock signal. First I was planning to use the Arduino, but I was not sure how to synchronize it with the other operations, and also I wasn&#8217;t sure if it was fast enough. Also I was not confident that my 555 based clock module can provide the right signal. And even though for most of the timings there are only minima and no maxima, the clock, that is t<sub>CHCH<\/sub> has a maximum: 10000ns. Note that the usual values are 28\/20 for this chip, as it runs 35\/50Mhz. <\/p>\n\n\n\n<p>But, I happen to have two 1MHz quartz oscillators for the BE6502 project, and 1MHz means t<sub>CHCH<\/sub> of 1000ns, well within the range. And I expect it to be more stable than a SW clock from an Arduino. So I hooked up the oscillator, and connected it directly to pin with the lucky number 13, and tada&#8230; all read and write operations were working as expected.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/oscillator.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/oscillator.jpg\" alt=\"\" class=\"wp-image-574\" srcset=\"https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/oscillator.jpg 800w, https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/oscillator-300x225.jpg 300w, https:\/\/robert.vanyi.org\/en\/wp-content\/uploads\/2024\/05\/oscillator-768x576.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><figcaption class=\"wp-element-caption\">Oscillator to the rescue<\/figcaption><\/figure>\n\n\n\n<p>The data sheet does not explicitly describe this behavior, but it mentions that to enable independent access for the pixel interface and the microprocessor interface, the G171 internally synchronizes memory writes to the pixel clock.<\/p>\n\n\n\n<p>Now the first step with the RAMDAC is done, I can move to the CRTC, but that is another story.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I was unable to solve the issue with the RAMDAC not setting the color value register, so I gave up, and decided to make an entry about the progress so far. But I was so tired that I decided to do it this morning, making use of the public holiday. I was watching enough &hellip; <a href=\"https:\/\/robert.vanyi.org\/en\/archives\/572\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Fixing the RAMDAC<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[76],"tags":[72,77],"class_list":["post-572","post","type-post","status-publish","format-standard","hentry","category-electronics","tag-electronics","tag-vga"],"_links":{"self":[{"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/posts\/572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/comments?post=572"}],"version-history":[{"count":0,"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/posts\/572\/revisions"}],"wp:attachment":[{"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/media?parent=572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/categories?post=572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robert.vanyi.org\/en\/wp-json\/wp\/v2\/tags?post=572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}