<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-8451817541345985506</atom:id><lastBuildDate>Mon, 15 Dec 2008 22:58:22 +0000</lastBuildDate><title>The Paleotechnologist</title><description>Using high-tech methods to preserve old-school goodness. Or vice-versa. Or just figuring out cool things to do with technology.</description><link>http://www.paleotechnologist.net/</link><managingEditor>noreply@blogger.com (M. Eric Carr)</managingEditor><generator>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-8102511316450079085</guid><pubDate>Mon, 15 Dec 2008 15:05:00 +0000</pubDate><atom:updated>2008-12-15T17:58:22.360-05:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>microprocessor</category><category domain='http://www.blogger.com/atom/ns#'>power hog</category><category domain='http://www.blogger.com/atom/ns#'>Energy Star</category><category domain='http://www.blogger.com/atom/ns#'>CPU</category><category domain='http://www.blogger.com/atom/ns#'>Z80</category><category domain='http://www.blogger.com/atom/ns#'>milliamps</category><title>Energy Star -- Paleotechnology style!</title><description>A while back, I realized that the Z80 was drawing (relatively speaking) a lot of power. I know modern CPUs can both crunch your numbers and cook your dinner; the Intel Core i7 datasheet specifies a maximum of 145 &lt;b&gt;AMPS&lt;/b&gt; of current. (I don't think my car's starter motor draws that much, some days.) &lt;br /&gt;&lt;br /&gt;The Z80, though, being from the ancient glory days of yore when CPUs didn't even require a heatsink, let alone sophisticated cryogenics, didn't really strike me as a power hog. In fact, the version the DrACo/Z80 uses is CMOS-based (for static clockability) -- it couldn't be drawing some 700 milliamps of power all on its own, could it?&lt;br /&gt;&lt;br /&gt;No, as it turns out. The Z80 itself is quite efficient. The 74LS245 buffer chips, on the other hand, draw 40 or 50 mA apiece, even when doing absolutely nothing. They just sit there and get warm! "Low-power Schottky," my paleotechnological posterior!&lt;br /&gt;&lt;br /&gt;A quick look online turned up the drop-in replacement 74HCT245 version, which is much more power-friendly. (These only draw a few microamps when idle.) The results speak for themselves...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.paleotechnologist.net/Z80/Current%20draw%20comparison.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 455px; height: 311px;" src="http://www.paleotechnologist.net/Z80/Current%20draw%20comparison.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Much more Earth-friendly! (...and now the computer can be run from a USB port or from NiMH batteries. Whether the Department of Security Theater would let me on a plane or on Amtrak with it is most likely another story, though.)&lt;br /&gt;&lt;br /&gt;I'm also experimenting with removing the '245 chips connecting the Z80 to the bus. It works well enough to do the Prime Number program, but may not be as stable for high-speed operation. More on this later (time permitting).</description><link>http://www.paleotechnologist.net/2008/12/energy-star-paleotechnology-style.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-7637704906235164441</guid><pubDate>Mon, 15 Dec 2008 04:57:00 +0000</pubDate><atom:updated>2008-12-15T00:52:37.261-05:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>ROM</category><category domain='http://www.blogger.com/atom/ns#'>primes</category><category domain='http://www.blogger.com/atom/ns#'>prime numbers</category><category domain='http://www.blogger.com/atom/ns#'>CPU</category><category domain='http://www.blogger.com/atom/ns#'>Z80</category><category domain='http://www.blogger.com/atom/ns#'>computer</category><category domain='http://www.blogger.com/atom/ns#'>assembly</category><title>Prime Time</title><description>...and now, for something completely different. (By different, I mean almost useful!)&lt;br /&gt;&lt;br /&gt;The Z80 computer is now busy computing &lt;a href="http://en.wikipedia.org/wiki/Prime_numbers"&gt;prime numbers&lt;/a&gt;! I wrote a straightforward BASIC program, which I then compiled using &lt;a href="http://www.oshonsoft.com"&gt;Oshonsoft&lt;/a&gt;'s &lt;a href="http://www.oshonsoft.com/z80.html"&gt;Z80 simulator suite&lt;/a&gt; of utilities. The resulting assembly program was pretty good, but needed some optimization. (BASIC isn't really geared towards byte manipulations.) I replaced the crude BASIC mod-and-div output routines I had written with four LD and four OUT instructions. &lt;a href="http://www.paleotechnologist.net/Z80/primes_asm.txt"&gt;Here&lt;/a&gt; is the (probably still really inefficient) assembly code.&lt;br /&gt;&lt;br /&gt;Some technical progress, too: Loading complex programs is becoming progressively easier with the addition of a &lt;a href="http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm"&gt;hex editor&lt;/a&gt; to my toolkit. Instead of toggling code in a byte at a time from the control panel, I can now load it into a serial EEPROM and plug it into the Virtual ROM peripheral. With a few lines of code (which I also copied to the ROM because I'm lazy), this code can be copied into base memory automagically. All that needs to be toggled in to start is a single, 3-byte JUMP command. &lt;br /&gt;&lt;br /&gt;For instance, to bootload the prime-number program into base memory:&lt;br /&gt;* Enter Program mode&lt;br /&gt;* Connect the ROM&lt;br /&gt;* Start the clock running&lt;br /&gt;* Load the following instruction into memory:&lt;br /&gt;  0000 C3&lt;br /&gt;  0001 00&lt;br /&gt;  0002 86&lt;br /&gt;* Hold down RESET, exit Program mode, and release RESET.&lt;br /&gt;  - The Z80 will jump to 0x8600, which is a quick routine to load the main primes program (8300:854B) into base memory (0000:034B). &lt;br /&gt;  - At the end of this routine, a JUMP command will cause it to halt.&lt;br /&gt;* Perform a RESET to start the prime-number program running.&lt;br /&gt;&lt;br /&gt;(I actually started loading the bootloader into base memory -- but then realized that it would quickly overwrite itself. A workaround, if you don't have a bootloader written into ROM, would be to toggle in the bootloader at a higher address than you plan to use for the program, then JUMP to that address -- for instance, 0x7000h -- from 0x0000h.)&lt;br /&gt;&lt;br /&gt;I'm using my ancient &lt;a href="http://www.home.agilent.com/agilent/product.jspx?cc=US&amp;lc=eng&amp;ckey=1630A:epsg:pro&amp;nid=-536900196.536896358.00&amp;id=1630A:epsg:pro"&gt;HP 1630A logic analyzer&lt;/a&gt; to look at the output from the program (POD2 connected to the data lines, L clock connected to ~IORQ); it's calculated the primes through 113 so far.&lt;br /&gt;&lt;br /&gt;I also managed to complete Problem 001 from &lt;a href="http://projecteuler.net/"&gt;Project Euler&lt;/a&gt; ("What is the sum of all numbers less than 1,000 which are multiplies of three or five?"), using the Z80. &lt;br /&gt;&lt;br /&gt;I also realized this weekend that my new Gigabyte GA-EX58 Extreme motherboard doesn't have any RS232 ports. Such is "progress," I guess. *sigh* Time for an add-in card. (Do they make PCIe RS232 cards??)</description><link>http://www.paleotechnologist.net/2008/12/prime-time.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-5712461311022539731</guid><pubDate>Tue, 09 Dec 2008 01:37:00 +0000</pubDate><atom:updated>2008-12-08T20:39:46.873-05:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Z80 computer prototype EET325</category><title>...and then there were two. Correction, four.</title><description>The EET325 class is wrapping up this week, but not before I got Bill's prototype Z80 core working with the original protoboard control panel. Not only that, but two of the students (Mike and Austin) have finished, working Z80s. So now there are four of them! Can a Beowulf cluster of Z80s be far behind? &lt;g&gt;</description><link>http://www.paleotechnologist.net/2008/12/and-then-there-were-two-correction-four.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-8986492771013064674</guid><pubDate>Tue, 11 Nov 2008 06:20:00 +0000</pubDate><atom:updated>2008-11-11T01:40:34.986-05:00</atom:updated><title>Single-board at last</title><description>To paraphrase Emperor Palpatine...&lt;br /&gt;&lt;br /&gt;"And now, witness the power of this fully ARMED and OPERATIONAL ... Z80 computer!"&lt;br /&gt;&lt;br /&gt;OK, so running at the current 40kHz system clock, it's got more milliamps than megaflops -- but at least it's running properly on one board (CPU, memory, controls, and LEDs all together.)&lt;br /&gt;&lt;br /&gt;More about the milliamps to come: it's currently drawing over half an amp(!) at 5V -- almost all of which is going into keeping the 74LS245s warm. The parts should be in tomorrow to give it a quick "Energy Star" upgrade.&lt;br /&gt;&lt;br /&gt;Click the image for a larger version. (The dials on the right are, from top to bottom, address-high-byte, address-low-byte, and data.)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.paleotechnologist.net/uploaded_images/Single_board_Z80_sm-746756.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://www.paleotechnologist.net/uploaded_images/Single_board_Z80_sm-746749.jpg" border="0" alt="" /&gt;&lt;/a&gt;</description><link>http://www.paleotechnologist.net/2008/11/single-board-at-last.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-1388476910745173040</guid><pubDate>Sat, 04 Oct 2008 04:05:00 +0000</pubDate><atom:updated>2008-10-04T00:26:15.366-04:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>itsalive</category><category domain='http://www.blogger.com/atom/ns#'>LED</category><category domain='http://www.blogger.com/atom/ns#'>PIC</category><category domain='http://www.blogger.com/atom/ns#'>machine code</category><category domain='http://www.blogger.com/atom/ns#'>itworks</category><category domain='http://www.blogger.com/atom/ns#'>Z80</category><category domain='http://www.blogger.com/atom/ns#'>computer</category><category domain='http://www.blogger.com/atom/ns#'>assembly</category><title>Z80 computer LED display</title><description>The Z80 computer now has its name in lights! (See &lt;a href="http://www.youtube.com/watch?v=4OQZYcoOv-I"&gt;video&lt;/a&gt;; I apologize in advance for the horrible low resolution and mp4 artifacts.)&lt;br /&gt;&lt;br /&gt;Dr. Rosen and I got approval to buy an Alpha 215R single-line LED display as a demo for the Z80 computer. While it was on the way, I built a second peripheral for the Z80: a specialized RS232 port that accepts strings and reformats them for output to the LED display. (It's an interesting challenge to build a peripheral based solely on information from a datasheet, without having the actual device available.)&lt;br /&gt;&lt;br /&gt;When I finally got to work with the display on Thursday, the interface actually worked -- but various electrical gremlins were causing all sorts of problems, when the Z80, interface, control panel, and sign were all connected. The problems eventually turned out to be mostly due to insufficient voltage -- as it turns out, 5.5V (rather hot for TTL circuits) at the power supply ends up being a nice, clean 5.0V to 5.1V at the Z80. Those 40-pin ribbon cables keep finding new ways in which to be a Dumb Idea(tm)...&lt;br /&gt;&lt;br /&gt;At any rate, it started running very reliably Friday afternoon. The bad news was that this meant that it was time to start programming it. Writing Z80 code to do a demonstration script isn't too bad; a bit tedious to enter the strings, but still fun.&lt;br /&gt;&lt;br /&gt;Toggling some 200 bytes of machine code in, byte by byte, however, is mind-numbingly boring -- even if (like me) you actually enjoy programming in assembler. (Note to self: there has GOT to be some source for knobs for those rotary switches SOMEWHERE!)&lt;br /&gt;&lt;br /&gt;The script is running, though. Hopefully it will prove inspiring to the EET325 students. (How many college courses out there lead you through building your own computer, chip by chip and wire by wire?)</description><link>http://www.paleotechnologist.net/2008/10/z80-computer-led-display.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-7125678018322017973</guid><pubDate>Mon, 29 Sep 2008 00:54:00 +0000</pubDate><atom:updated>2008-09-28T21:01:41.026-04:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>PIC</category><category domain='http://www.blogger.com/atom/ns#'>library</category><category domain='http://www.blogger.com/atom/ns#'>timing</category><category domain='http://www.blogger.com/atom/ns#'>timer</category><category domain='http://www.blogger.com/atom/ns#'>delay</category><category domain='http://www.blogger.com/atom/ns#'>assembly</category><title>Much Ado About Nothing</title><description>Sometimes, nothing is exactly what you need. A specific amount of nothing, to be precise. &lt;br /&gt;&lt;br /&gt;Here is a delay library, written in assembly, for PIC microcontrollers running at 8MHZ. If you find it useful, please let me know. Share and enjoy!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.paleotechnologist.net/PIC/delay_8.inc"&gt;8MHz delay library&lt;/a&gt;</description><link>http://www.paleotechnologist.net/2008/09/much-ado-about-nothing.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-338929580549757122</guid><pubDate>Fri, 05 Sep 2008 21:12:00 +0000</pubDate><atom:updated>2008-09-05T17:15:21.276-04:00</atom:updated><title>It works! (again)</title><description>Bill (Dr. Rosen's independent-study student) stopped by the lab today to work on his Z80 computer. After tracking down a few bugs, we got it working! I loaded the Fibonacci test program into it, and saw it execute the JMP 0x0003 command, verifying that it is correctly executing code.&lt;br /&gt;&lt;br /&gt;Good job, Bill (and thanks for helping us test the design for the course)!</description><link>http://www.paleotechnologist.net/2008/09/it-works-again.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-3342213694642368531</guid><pubDate>Mon, 01 Sep 2008 05:46:00 +0000</pubDate><atom:updated>2008-09-01T15:44:51.099-04:00</atom:updated><title>LCD display video on YouTube (click here)</title><description></description><link>http://www.paleotechnologist.net/2008/09/lcd-display-video-youtube.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-228063665828647576</guid><pubDate>Sun, 31 Aug 2008 22:10:00 +0000</pubDate><atom:updated>2008-08-31T22:18:45.437-04:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>text display</category><category domain='http://www.blogger.com/atom/ns#'>PIC</category><category domain='http://www.blogger.com/atom/ns#'>LCD</category><category domain='http://www.blogger.com/atom/ns#'>peripheral</category><category domain='http://www.blogger.com/atom/ns#'>Z80</category><category domain='http://www.blogger.com/atom/ns#'>Hello World</category><title>First peripheral</title><description>&lt;a href="../../images/HelloWorld.jpg"&gt;&lt;img src="../../images/HelloWorld_sm.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The first peripheral for the Z80 is working (although still somewhat alpha at this point): a two-line LCD text display. It's mapped as I/O ports 0x00 and 0x01, with control commands being sent to 0x00 and data to 0x01. &lt;br /&gt;&lt;br /&gt;It's been tested with a "Hello, World!" program written in Z80 assembler. (The current version of the program is very inefficient; the ideal way to handle it would be to write the "Hello, World!" data into memory and then clock it out to the I/O port automatically (I believe the Z80 can do this in a single instruction, once the registers are set up.)&lt;br /&gt;&lt;br /&gt;&lt;a href="../../Z80/HelloWorld.txt"&gt;Here&lt;/a&gt; is the "Hello, World!" assembly code. The C register is loaded with 0x01, then the A register is loaded with the ASCII code for each character, which is output to the port.&lt;br /&gt;&lt;br /&gt;In related news, I think I've found how to turn off all the peripherals on the PIC16F887. It's a good replacement for the '877A -- with an internal 8MHz clock, plus a complete 8-bit PORTA -- but it does seem to power up with a lot of extraneous analog options turned on. The MPU for the text display is an '887.&lt;br /&gt;&lt;br /&gt;&lt;font color="#FF0000"&gt;Edit:&lt;/font&gt; &lt;a href="../../Z80/HelloWorld2.txt"&gt;Here&lt;/a&gt; is an updated version of the "Hello, World!" app -- using a single OTIR (Output/Incrementing/Repeat) instruction to do the dirty work, once the registers are all updated. Apparently it works by not incrementing the program counter, so the same instruction is executed over and over until B counts down to zero. Whatever the mechanism, it works as advertised, and the program now takes up only 27 instead of 60 bytes of memory!</description><link>http://www.paleotechnologist.net/2008/08/first-peripheral.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-8457183135485492547</guid><pubDate>Fri, 29 Aug 2008 05:11:00 +0000</pubDate><atom:updated>2008-09-29T18:20:32.444-04:00</atom:updated><title>Putting the "Basic" back in BASIC</title><description>I found a cool &lt;a href="http://www.oshonsoft.com/z80.html"&gt;Z80 simulator suite&lt;/a&gt; -- with a lot of useful bells and whistles. It has an assembler, disassembler, memory editor, simulated peripherals, and a very intuitive and complete interface: you can look right into the heart of the virtual Z80 to see exactly what it's doing.&lt;br /&gt;&lt;br /&gt;It even has a BASIC compiler -- and not only that, but a BASIC compiler that uses one of the oldest "Old School" dialects of BASIC I've seen in many years. (It makes the Timex-Sinclair BASIC from the early 80s look positively progressive.)&lt;br /&gt;&lt;br /&gt;One of the first programs I write in most languages I learn is a Mandelbrot Set calculation routine. It's an interesting (if perhaps not always useful) benchmark to calculate a standard view of the 'Set. I use (-2.0,0.9)-(0.6,-0.9), rendered in 640x480 at 1000 iterations as a starting point.&lt;br /&gt;&lt;br /&gt;Here is the routine (sans timing benchmark code) as I would write it in FreeBASIC or QBasic:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;dim a,b,r,i,h,dx,dy as double&lt;br /&gt;dim x,y,iter,maxiter as long&lt;br /&gt;rmin=-2.0 : rmax=0.6 : imin=-0.9 : imax=0.9 : maxiter=1000&lt;br /&gt;dx=(rmax-rmin)/640 : dy = (imax-imin)/480&lt;br /&gt;for y=0 to 439&lt;br /&gt;   b=imax-y*dy&lt;br /&gt;   for x=0 to 639&lt;br /&gt;      a=rmin+x*dx&lt;br /&gt;      r=a : i=b: iter=0&lt;br /&gt;      while r*r+i*i&amp;lt;=4.0 and iter&amp;gt;maxiter&lt;br /&gt;         h=(r+i)*(r-i)+a&lt;br /&gt;         i=2*r*i+b&lt;br /&gt;         r=h&lt;br /&gt;         iter=iter+1&lt;br /&gt;         wend&lt;br /&gt;      next x&lt;br /&gt;   next y&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Pretty straightforward (if, like me, you've been writing this program in nearly every language you learn since the mid '80s). BASIC is like coding in algebra, which is why I like it.&lt;br /&gt;&lt;br /&gt;I guess having a BASIC-to-Z80-assembler compiler is a little like meeting a talking dog: it's impressive if such a thing should exist at all, and therefore one shouldn't complain too much about quality.&lt;br /&gt;&lt;br /&gt;Some things I learned:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;DIM statements are limited to one variable per line&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Double doesn't exist (Hey, it's a Z80. It's impressive that &lt;i&gt;single&lt;/i&gt; does!)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Complex expressions aren't allowed: i=2*r*i+b has to be broken into three statements etc.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;FOR statements only accept integers&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The rules pertaining to mixing floating point and integers are non-obvious; hence the switch from FOR statements to the WHILE/WEND structure here.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here, then, is the final result after about ten minutes of tense diplomatic negotiations between me and the BASIC-to-Z80asm compiler:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Dim a As Single&lt;br /&gt;Dim b As Single&lt;br /&gt;Dim r As Single&lt;br /&gt;Dim h As Single&lt;br /&gt;Dim i As Single&lt;br /&gt;Dim x As Single&lt;br /&gt;Dim y As Single&lt;br /&gt;Dim dx As Single&lt;br /&gt;Dim dy As Single&lt;br /&gt;Dim rmin As Single&lt;br /&gt;Dim rmax As Single&lt;br /&gt;Dim imin As Single&lt;br /&gt;Dim imax As Single&lt;br /&gt;Dim iter As Long&lt;br /&gt;Dim maxiter As Long&lt;br /&gt;Dim d As Single&lt;br /&gt;rmin = -2&lt;br /&gt;rmax = 0.6&lt;br /&gt;imin = 0 - 0.9&lt;br /&gt;imax = 0.9&lt;br /&gt;maxiter = 1000&lt;br /&gt;dx = rmax - rmin&lt;br /&gt;dx = dx / 640&lt;br /&gt;dy = imax - imin&lt;br /&gt;dy = dy / 480&lt;br /&gt;y = 0&lt;br /&gt;While y &amp;gt;= 479&lt;br /&gt;b = dy&lt;br /&gt;b = b * y&lt;br /&gt;b = imax - b&lt;br /&gt;x = 0&lt;br /&gt;While x &amp;gt;= 639&lt;br /&gt;a = x * dx&lt;br /&gt;a = a + rmin&lt;br /&gt;r = a&lt;br /&gt;i = b&lt;br /&gt;h = 0&lt;br /&gt;iter = 0&lt;br /&gt;While d &amp;lt; 4.01&lt;br /&gt;h = r + i&lt;br /&gt;d = r - i&lt;br /&gt;h = h * d&lt;br /&gt;h = h + a&lt;br /&gt;i = r * i&lt;br /&gt;i = i * 2&lt;br /&gt;i = i + b&lt;br /&gt;r = h&lt;br /&gt;iter = iter + 1&lt;br /&gt;d = r * r&lt;br /&gt;h = i * i&lt;br /&gt;d = d + h&lt;br /&gt;Wend&lt;br /&gt;y = y + 1&lt;br /&gt;Wend&lt;br /&gt;x = x + 1&lt;br /&gt;Wend&lt;br /&gt;finish: Goto finish&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The end result after running this through the compiler? 1398 lines of &lt;a href="../../mandelbrot.asm"&gt;assembly code&lt;/a&gt;(!) 2,362 bytes of machine code. (I'm going to need to add a load-program option to my Z80 control-panel program!)&lt;br /&gt;&lt;br /&gt;I'm not knocking the good folks at Oshonsoft. It's &lt;i&gt;very&lt;/i&gt; impressive to have even a quirky, old-school BASIC compiler for the Z80. Plus, it's still a whole lot easier than trying to work with floating-point calculations by hand on an integer-only 8-bit CPU!</description><link>http://www.paleotechnologist.net/2008/08/putting-basic-back-in-basic.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>5</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-4347203289634622731</guid><pubDate>Thu, 28 Aug 2008 02:55:00 +0000</pubDate><atom:updated>2008-08-27T23:52:41.887-04:00</atom:updated><title>9 MHz!</title><description>More progress on the Z80 computer:&lt;br /&gt;&lt;br /&gt;* The computer core (processor, memory, etc) was transferred piece by piece from the solderless breadboard to a wire-wrapped version.&lt;br /&gt;* Termination of the data and address busses was added (1K resistors to ground)&lt;br /&gt;* A 555-based internal clock was added; this will allow execution at speeds up to 1MHz.&lt;br /&gt;* The virtual-control-panel circuit was pared down; it now consists of a PIC16F877A, a MAX232 chip, and a few resistors and capacitors. It's still on solderless breadboard at this point; a more permanent control panel is planned, using three microcontrollers and having a lot more functionality.&lt;br /&gt;&lt;br /&gt;After verifying that it all still worked, I decided to see how fast it would go (the idea being that if it ran well at speed, it should be very reliable at the slow speeds we'll be using in class next term.) I connected it up to a signal generator and a mixed-signal Agilent scope. It proved to be stable at up to slightly more than 9MHz clock speed (18MHz into the J/K flip-flop). &lt;br /&gt;&lt;br /&gt;Here's a picture of the system in action. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="../images/Z80_core.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px;" src="../images/Z80_core.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is a trace of the system running a &lt;a href="../Fibonacci.txt"&gt;&amp;quot;Fibonacci&amp;quot;&lt;/a&gt; program. Execution starts at address 0x000A, with a JMP 0x0003 instruction. (The analog trace at the top is address line 12 -- which goes high whenever the Z80 writes to memory location 0x1234. The reason that the data for this location is ambiguous is that, unlike the other steps in the program, this data is constantly changing.)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="../images/trace.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px;" src="../images/trace_sm.jpg" border="0" alt="" /&gt;&lt;/a&gt;</description><link>http://www.paleotechnologist.net/2008/08/9-mhz.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-1098343633506508355</guid><pubDate>Fri, 22 Aug 2008 01:46:00 +0000</pubDate><atom:updated>2008-08-21T21:51:31.506-04:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Z80 PIC computer project itsalive itworks</category><title>It works!</title><description>After a bit of debugging (some PIC code corrections, some VB code corrections, and finally tracking down a missing direction-pin wire), the Z80 computer is executing code! I wrote a short test program to compute Fibonacci numbers, and it ran correctly.&lt;br /&gt;&lt;br /&gt;It still could use quite a few features -- such as an internal clear-all-memory routine, program save and load functionality, program trace output, etc. But for now, it's a working Z80 computer, accessed via RS232.</description><link>http://www.paleotechnologist.net/2008/08/it-works.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-7574370680796829204</guid><pubDate>Fri, 18 Jul 2008 00:24:00 +0000</pubDate><atom:updated>2008-07-17T20:45:28.987-04:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>LED</category><category domain='http://www.blogger.com/atom/ns#'>PIC</category><category domain='http://www.blogger.com/atom/ns#'>control panel</category><category domain='http://www.blogger.com/atom/ns#'>Z80</category><category domain='http://www.blogger.com/atom/ns#'>74LS245</category><category domain='http://www.blogger.com/atom/ns#'>controls</category><title>Plus ça change...</title><description>...plus ça ne change pas. Or so they say, anyway -- but the design of this computer has certainly changed. The changes are for the better, though: the core (which will be constructed by the students) has been greatly simplified, with as much functionality as possible having been collected into a control panel unit.&lt;br /&gt;&lt;br /&gt;&lt;a href="DRACO/Z80_core.png"&gt;Here&lt;/a&gt; is the schematic for the "core." Some more minor changes may yet happen (perhaps another 74LS245 for the control lines etc), but the core design is essentially finalized. The idea is that the core system can run as a "headless" unit, without a control panel: with the addition of 24 LEDs to show the status of the address and data lines, it should look like a real "Hollywood" computer, complete with blinking lights! I'm still skeptical about putting LEDs directly onto the busses, but we'll see how that works out. If nothing else, they can be driven by three more '245s.&lt;br /&gt;&lt;br /&gt;The control panel (still under construction) will include:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Rotary hex switches to enter addresses and data;&lt;/li&gt;&lt;li&gt;An LCD panel to read addresses and data (and perhaps other information);&lt;/li&gt;&lt;li&gt;Run/Stop, Single-Step, Manual/Auto, Reset, and Write switches;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;An SD card slot and Load/Save switches to back up programs to an SD card; and&lt;/li&gt;&lt;li&gt;Three PIC microcontrollers to run all of this.&lt;/li&gt;&lt;/ul&gt;Right now, I'm creating a set of inter-MPU commands, to keep everything in sync. Complete details will be available here once it's all finished.</description><link>http://www.paleotechnologist.net/2008/07/plus-change.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-1588232155695084527</guid><pubDate>Fri, 27 Jun 2008 01:46:00 +0000</pubDate><atom:updated>2008-06-26T22:00:40.403-04:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>8088</category><category domain='http://www.blogger.com/atom/ns#'>microprocessor</category><category domain='http://www.blogger.com/atom/ns#'>Z80</category><category domain='http://www.blogger.com/atom/ns#'>DRACO</category><category domain='http://www.blogger.com/atom/ns#'>8086</category><title>I'm still here...</title><description>...I've just been busy working on some really cool paleotechnology projects. Dr. Rosen came across an &lt;a href="http://www.paleotechnologist.net/DRACO/article.pdf"&gt;article&lt;/a&gt; about a microprocessor course built around students creating their own 8086-based computer. He asked me what I thought about it -- and my first thought was "Can I sign up, even though I'm not an undergrad?" &lt;g&gt;&lt;br /&gt;&lt;br /&gt;Since then, I've been working on coming up with a working computer design that EET students could have a chance of building in one ten-week term. (Drexel is on the quarter system.) Since nearly all modern PCs are based on &lt;a href="http://en.wikipedia.org/wiki/x86"&gt;x86&lt;/a&gt; architecture, Dr. Rosen suggested that, like the course described in the article, we design the course around an 8086 computer. &lt;a href="http://www.paleotechnologist.net/DRACO/8086.pdf"&gt;Here&lt;/a&gt; is the design. (Caveat lector: I haven't completely built this one -- let alone debugged the design. It almost certainly has multiple bugs. Consider it pre-alpha.)&lt;br /&gt;&lt;br /&gt;Upon further reflection, Dr. Rosen pointed out that this design (rather complex, not to mention costing perhaps $250 in parts) was probably too ambitious for a one-term undergrad class.  He asked what I thought we could do to simplify the design. I pared it down, removing the RS232 subsection and making a few other minor changes -- but it became apparent to me that an 8088-based design would be significantly simpler and less expensive. Continuing this line of reasoning, I figured that a Z80-based design would be simpler still. (The Z80-based Timex-Sinclair 1000, after all, uses a total of only four ICs.)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.paleotechnologist.net/DRACO/Z80.pdf"&gt;Here&lt;/a&gt; is the Z80-based design. (Again, this has not yet been completely built, let alone debugged. Should we go with this design and build it, I will post complete plans here.)</description><link>http://www.paleotechnologist.net/2008/06/im-still-here.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-3254768209403819929</guid><pubDate>Fri, 09 May 2008 22:00:00 +0000</pubDate><atom:updated>2008-05-10T00:05:45.716-04:00</atom:updated><title>Nothing but 'Net</title><description>OK; I'm going to have to turn in my Paleotechnologist Card -- or at least cross out the "Paleo" part -- but this is pretty cool. I'm on the Amtrak, connected to the 'Net via Internet sharing on my HTC Mogul -- connected via Bluetooth PAN. Cool, especially using this connection to access my desktop back in PHL via Remote Desktop.&lt;br /&gt;&lt;br /&gt;It seems to me that devices like the Mogul are the first of a new class of device. With connectivity via cell, WiFi, and Bluetooth, in addition to USB etc, it can handle cell phone calls, the usual Internet functions (POP, SMTP, HTTP, SSH, FTP yada yada) -- and can also act as a router/NAT proxy. Not bad for a pocket-size gizmo.&lt;br /&gt;&lt;br /&gt;Now if they could only improve the battery life. I wonder if it'll make it to FBG?&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;Edit: Nope. The battery gave up just past Washington. It was fun while it lasted, though.&lt;/span&gt;</description><link>http://www.paleotechnologist.net/2008/05/nothing-but-net.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-7785307610898083143</guid><pubDate>Mon, 05 May 2008 19:25:00 +0000</pubDate><atom:updated>2008-05-05T15:46:38.343-04:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>VSI</category><category domain='http://www.blogger.com/atom/ns#'>PIC</category><category domain='http://www.blogger.com/atom/ns#'>microcontroller</category><category domain='http://www.blogger.com/atom/ns#'>serial</category><category domain='http://www.blogger.com/atom/ns#'>servo</category><title>VSI gauge progress</title><description>The first CHComm-based instrument is starting to take shape. A Futaba servo connected to a PIC16F877a (yeah, I know -- gross overkill -- but it was handy) to make a VSI gauge. At this point, it works intermittently; it seems to only register changes of the hundreds' place; I really need to get an LCD on it to help diagnose what's going on.&lt;br /&gt;&lt;br /&gt;On the bright side, it's up to 9600 baud, from 2400, so that helps.&lt;br /&gt;&lt;br /&gt;Getting the PIC to properly multitask while communicating with the serial port is an interesting proposition. Right now, the main loop provides constant position pulses to the servo while polling the serial port line every 500us or so, to see if a start bit has been received. I'm leaning towards a 2-MCU solution for each gauge, though -- one to handle comms and one to run the servo. That way, the servo MCU would be guaranteed a very short data-update cycle, rather than allowing for a potential stoppage should something happen to the serial line.  (Servos act strange when their position pulses are interrupted.)</description><link>http://www.paleotechnologist.net/2008/05/vsi-gauge-progress.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-4524235972192158363</guid><pubDate>Sun, 04 May 2008 00:48:00 +0000</pubDate><atom:updated>2008-05-03T20:57:43.307-04:00</atom:updated><title>CH Comm works!</title><description>Just finished testing CH Comm -- it works, both with FS2004 and FSX! A whole interesting list of FS data can be exported to the RS232 port in standard format. This should make it fairly straightforward to create PIC-based instruments.&lt;br /&gt;&lt;br /&gt;At this point, the next steps are:&lt;br /&gt;* Try to get RS232 comms working reliably at a higher speed than 2400 baud -- preferably 115200, even if this means a dedicated MCU to handle the comms (which it probably will.)&lt;br /&gt;* Go through the CH Comm .ini file to pare down the output to what is needed (all this data takes an appreciable fraction of a second to export at the default 9600 baud -- which would make for poorly-responding instruments.&lt;br /&gt;* Choose one or two parameters for a PIC to read, and display them on a LCD or via a servo.</description><link>http://www.paleotechnologist.net/2008/05/ch-comm-works.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-5277593351542579228</guid><pubDate>Sat, 03 May 2008 05:01:00 +0000</pubDate><atom:updated>2008-05-03T20:58:41.360-04:00</atom:updated><title>Tandy PC-6 (circa 1986)</title><description>&lt;span style="font-weight: bold;"&gt;It's baaaaack!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A quick trip to Radio Shack for batteries, and my beloved, venerable Tandy PC-6 from back in junior high school(!) is back among the living. (I actually must have remembered to remove the old batteries before they started to corrode -- wow!)&lt;br /&gt;&lt;br /&gt;Here it is, folks -- BASIC-language paleotechnology, 1986-style!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.intellectualism.org/Paleotechnologist/uploaded_images/IMG_0215%5B1%5D-716543.jpg"&gt;&lt;img style="cursor: pointer;" src="http://www.intellectualism.org/Paleotechnologist/uploaded_images/IMG_0215%5B1%5D-716103.jpg" alt="" border="0" /&gt;&lt;/a&gt;</description><link>http://www.paleotechnologist.net/2008/05/its-baaaaack-quick-trip-to-radio-shack.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-8451817541345985506.post-7761608225959715727</guid><pubDate>Sat, 03 May 2008 02:00:00 +0000</pubDate><atom:updated>2008-05-03T20:59:06.439-04:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>microcontroller servo stepper PIC</category><title>Steam gauges!</title><description>Well, no actual steam will be involved -- just a PC or two, &lt;a href="http://www.microsoft.com/games/flightsimulatorx/"&gt;Flight Simulator&lt;/a&gt;, and several &lt;a href="http://www.microchip.com/"&gt;PIC &lt;/a&gt;microcontrollers. the idea is to create actual realistic-looking (working) instruments for use with FS. Having found &lt;a href="http://mycockpit.org/forums/showthread.php?t=1248"&gt;CHComm3a&lt;/a&gt;, which claims to be able to output data from &lt;a href="http://www.schiratti.com/dowson.html"&gt;FSUIPC&lt;/a&gt; to an RS232 port, it seemed like a good idea to try to do something useful with this data.&lt;br /&gt;&lt;br /&gt;My plan is to go for something like a Cessna 182RG setup eventually -- mostly, by building the "easier" components first. Clockwork components like the altimeter may have to wait until I can find a suitable (read: nonfunctional but in nice condition; I don't want to ruin a perfectly good instrument) part on eBay.&lt;br /&gt;&lt;br /&gt;I just picked up a copy of "Programming 16-Bit Microcontrollers In C," which seems to have some good tricks for migrating from the 8-bit parts I'm familiar with to the PIC24 family.&lt;br /&gt;&lt;br /&gt;Here's the To-Do list so far:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Verify RS232 output from FS9 / FSX&lt;/li&gt;&lt;li&gt;Verify PIC can actually parse said output&lt;/li&gt;&lt;ul&gt;&lt;li&gt;If no, co-opt a QBasic box to do it??&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Integrate Assembly and C routines &lt;/li&gt;&lt;li&gt;Decide on best calibration scheme&lt;/li&gt;&lt;li&gt;Build "easy" devices:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;ADF gauge (stepper motor w/gear drive?)&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Variometer&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Fuel gauges&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Decide how to make altimeter movement&lt;/li&gt;&lt;li&gt;Work on Ethernet connectivity for PICs&lt;/li&gt;&lt;ul&gt;&lt;li&gt;One local IP address per instrument/control&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Instruments talk to control PC, which interfaces w/FSUIPC?&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;</description><link>http://www.paleotechnologist.net/2008/05/to-do-list-for-pic-microcontroller.html</link><author>noreply@blogger.com (M. Eric Carr)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item></channel></rss>