<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Spice World! &#187; BBC Microcomputer</title>
	<atom:link href="http://www.cyberspice.org.uk/blog/tag/bbc-microcomputer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyberspice.org.uk/blog</link>
	<description>The life and times of a jet setting software engineer!</description>
	<lastBuildDate>Fri, 02 Dec 2011 14:52:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>My BBC Micro and Me</title>
		<link>http://www.cyberspice.org.uk/blog/2011/12/02/my-bbc-micro-and-me/</link>
		<comments>http://www.cyberspice.org.uk/blog/2011/12/02/my-bbc-micro-and-me/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 14:39:42 +0000</pubDate>
		<dc:creator>cyberspice</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Women In Technology]]></category>
		<category><![CDATA[BBC Micro]]></category>
		<category><![CDATA[BBC Microcomputer]]></category>
		<category><![CDATA[Beeb]]></category>

		<guid isPermaLink="false">http://www.cyberspice.org.uk/blog/?p=492</guid>
		<description><![CDATA[The BBC Microcomputer is 30 years old. The BBC News web site had an article about it but from the article you would think that only males benefited from it. Well it wasn&#8217;t just the boys who had fun with them! (Photo &#169; Anachrocomputer) The first computer in the house was my father&#8217;s. It was [...]]]></description>
			<content:encoded><![CDATA[<p>The BBC Microcomputer is 30 years old. The BBC News web site had an article about it but from the article you would think that only males benefited from it. Well it wasn&#8217;t just the boys who had fun with them!  (Photo &copy; <a href="http://www.flickr.com/photos/anachrocomputer/">Anachrocomputer</a>)<span id="more-492"></span><a href="http://www.flickr.com/photos/anachrocomputer/4440207275/" title="View 'Maker Faire 2010: BBC Micro with Ethernet' on Flickr.com"><img border="0" style="float:right; margin:10px;" height="160" src="http://farm5.staticflickr.com/4024/4440207275_1b732860b6_m.jpg" alt="Maker Faire 2010: BBC Micro with Ethernet &copy;Anachrocomputer" width="240" title="Maker Faire 2010: BBC Micro with Ethernet &copy;Anachrocomputer"/></a></p>
<p>The first computer in the house was my father&#8217;s. It was a TRS-80 Model 1. He had bought it to learn computing and because he realised computers were the future. I used it a lot learning to program in the BASIC language and then in Z80 assembly language (the language of the<br />
microprocessor that ran the computer).</p>
<p>I was also interested in electronics (thanks to my Uncle who taught it in schools) and around the same time I saw an advertisement for the<br />
Acorn Atom in an electronics magazine and I wanted one. I started saving but the BBC Microcomputer (&#8220;The Beeb&#8221;) came out before I could afford one. My Parents offered to help buy a Beeb by way of multiple combined Birthday and Christmas presents and the deal I would not use it until after my &#8216;O&#8217; levels which I mainly complied with. I remember the excitement of going in to the store to purchase my Beeb.</p>
<p>I learnt to program that machine from top to bottom. I had the reference manuals and the data sheets for all the chips. I loved how you got the full circuit diagram with the Advanced User Guide (it was a print of the one hand drawn by Acorn). I learnt BBC BASIC and 6502 assembly language. I learnt how to add to the operating system and how to do clever things by directly programming the chips in the machine. It taught me a lot about programming, such as interrupts, concurrency, race conditions, dead and live locks, and so on. Programming did become my first love and superseded electronics but I wouldn&#8217;t be the programmer I am today with out it!</p>
<p>I didn&#8217;t just program. I did play games with my favourites being Chuckie Egg and Elite! Elite was a complete time sink. No game following sucked me in as much as Elite did until World of Warcraft!</p>
<p>I didn&#8217;t completely give up on electronics and would develope small projects to connect to my Beeb. In the mid 80s I was studying for a Physics degree and naturally I used my Beeb. My final year project was based around the automation of an experiment. I designed hardware to drive the equipment, sensors and hardware to read data, and wrote software to drive it all from a Beeb.</p>
<p>In 1989 I got an Acorn A3000. It was the successor to the Beeb and also used in schools. It had the Acorn designed ARM processor (now used in nearly everything from a mobile phone to the iPad, set top boxes and televisions), what seemed like copious amounts of memory, loads of colours and a built in disk drive. It had BBC BASIC so I was at home and also taught me to program ARM assembly language (which I still use today). So the Beeb was basically retired.</p>
<p>I moved on to other machines, developing for Linux, higher degrees and becoming a research assistant but I never lost my love of my Beeb though and I still own mine almost 30 years after I bought it. I also still make projects for it. The most recent being an ethernet interface so that I can connect it to the internet.</p>
<p>I am now an embedded software consultant and I work for a company that was formed by employees of the company that bought Acorn Computers when it finally ended in 1999. My most recent project was optimising Linux on a device with an ARM processor. And my entire career is down to me and my Parents buying that Beeb 30 years ago!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberspice.org.uk/blog/2011/12/02/my-bbc-micro-and-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing http://projects.cyberspice.org.uk/</title>
		<link>http://www.cyberspice.org.uk/blog/2010/09/29/announcing-httpprojects-cyberspice-org-uk/</link>
		<comments>http://www.cyberspice.org.uk/blog/2010/09/29/announcing-httpprojects-cyberspice-org-uk/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 14:03:23 +0000</pubDate>
		<dc:creator>cyberspice</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Acorn]]></category>
		<category><![CDATA[BBC Micro]]></category>
		<category><![CDATA[BBC Microcomputer]]></category>
		<category><![CDATA[Beebthernet]]></category>

		<guid isPermaLink="false">http://www.cyberspice.org.uk/blog/?p=478</guid>
		<description><![CDATA[I am pleased to say that I have finally gotten around to starting to publish details of the hardware projects I have been working on. I have created a new site http://projects.cyberspice.org.uk/ which contains all the details of these projects. Over the next few days I will be updating it with the details of Beebthernet, [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to say that I have finally gotten around to starting to publish details of the hardware projects I have been working on.  </p>
<p>I have created a new site <a href="http://projects.cyberspice.org.uk/">http://projects.cyberspice.org.uk/</a> which contains all the details of these projects.  Over the next few days I will be updating it with the details of Beebthernet, my programmable earrings and so on.  Each of the projects will be described in detail and links to software and schematic downloads provided.</p>
<p>The first documented project is my ethernet for a BBC Microcomputer project known as <a href="http://projects.cyberspice.org.uk/beebthernet/">Beebthernet</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberspice.org.uk/blog/2010/09/29/announcing-httpprojects-cyberspice-org-uk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beebthernet</title>
		<link>http://www.cyberspice.org.uk/blog/2009/09/03/beebthernet/</link>
		<comments>http://www.cyberspice.org.uk/blog/2009/09/03/beebthernet/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 22:51:18 +0000</pubDate>
		<dc:creator>cyberspice</dc:creator>
				<category><![CDATA[Crafty]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[Acorn]]></category>
		<category><![CDATA[BBC Micro]]></category>
		<category><![CDATA[BBC Microcomputer]]></category>
		<category><![CDATA[Beeb]]></category>
		<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.cyberspice.org.uk/blog/?p=273</guid>
		<description><![CDATA[Well I have a name for my project of getting ethernet on to my BBC Microcomputer. Its now called Beebthernet. After some prototyping on copper strip-board and testing I revised the schematic for the interface. The new schematic is below as is the almost completed interface. The LEDs and their resistors are not on the [...]]]></description>
			<content:encoded><![CDATA[<p>Well I have a name for my project of getting ethernet on to my BBC Microcomputer.  Its now called Beebthernet.  After some prototyping on copper strip-board and testing I revised the schematic for the interface.  </p>
<p><span id="more-273"></span><br />
The new schematic is below as is the almost completed interface.  The LEDs and their resistors are not on the board.  Clicking on an image will take you to the Flickr page where many of the images are annotated. </p>
<div style="text-align:center;">
<td><a href="http://www.flickr.com/photos/39013214@N03/3884879035" title="View 'BBC Micro Ethernet Schematic V1.1' on Flickr.com"><img src="http://farm3.static.flickr.com/2544/3884879035_4921e66629_m.jpg" alt="BBC Micro Ethernet Schematic V1.1" border="0" width="240" height="179" /></a></div>
<p></p>
<div style="text-align:center;"><a href="http://www.flickr.com/photos/39013214@N03/3864827840" title="View 'TUBE based interface' on Flickr.com"><img src="http://farm3.static.flickr.com/2660/3864827840_b0115ae26e_m.jpg" alt="TUBE based interface" border="0" width="240" height="159" /></a></div>
<p>Unfortunately it doesn&#8217;t work.  I can read data fine but I can&#8217;t write data.  I looked at the bus and the data is getting to the module so I re-checked the timings.  Normally peripherals are slower than the devices trying to read them so the issue is slowing the processor or bus down.  However this is a modern peripheral and at least a 30 year old processor design.  The timing specification for a 2MHz 6502 says that the data bus will be stable ay a <strong>minimum</strong> of 110ns after the clock E2 goes high.  Since reads and writes are made when E2 is high the /RD and /WR lines, which are generated from E2 and the R/W line, will go low sooner than that.  The specification for the WIZ812MJ says that the <strong>maximum</strong> time take for the data lines to stabilize is 18ns.  I.e. the data bus doesn&#8217;t stabilize in time.  I need to work out a way of delaying the write line signal change by 100ns.</p>
<p>So I then knocked up an SPI version of the interface on breadboard and connected it to the User IO port, which is connected to port B of the <a href="http://en.wikipedia.org/wiki/MOS_Technology_6522">6522 VIA</a>, on the BBC Micro.  I wrote a <a href="http://en.wikipedia.org/wiki/Bit-banging">bit banging</a> routine to read and write to the WIZ810MJ in SPI mode which, although is the slowest mode available, will work what ever the speed of the IO.  It worked!  I managed to set the MAC address and interface, netmask and gateway IP addresses and pinged the device from my MacBook.  The breadboard set up and results of the ping test are below.  Again the images are annotated on Flickr.</p>
<div style="text-align:center;"><a href="http://www.flickr.com/photos/39013214@N03/3864044053" title="View 'SPI based interface' on Flickr.com"><img src="http://farm4.static.flickr.com/3499/3864044053_e50209c791_m.jpg" alt="SPI based interface" border="0" width="240" height="159" /></a></div>
<p></p>
<div style="text-align:center;"><a href="http://www.flickr.com/photos/39013214@N03/3864828066" title="View 'It Works!' on Flickr.com"><img src="http://farm3.static.flickr.com/2570/3864828066_628aabf936_m.jpg" alt="It Works!" border="0" width="240" height="159" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberspice.org.uk/blog/2009/09/03/beebthernet/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bit banging SPI in 6502 assembler</title>
		<link>http://www.cyberspice.org.uk/blog/2009/08/25/bit-banging-spi-in-6502-assembler/</link>
		<comments>http://www.cyberspice.org.uk/blog/2009/08/25/bit-banging-spi-in-6502-assembler/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 15:19:13 +0000</pubDate>
		<dc:creator>cyberspice</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[6502]]></category>
		<category><![CDATA[Acorn]]></category>
		<category><![CDATA[Assembler]]></category>
		<category><![CDATA[BBC Micro]]></category>
		<category><![CDATA[BBC Microcomputer]]></category>

		<guid isPermaLink="false">http://www.cyberspice.org.uk/blog/?p=262</guid>
		<description><![CDATA[During my adventures with my BBC Micro and external hardware I found I needed to read/write to an SPI bus. I ended up writing a bit banging routine to communicate in SPI Mode 0 with the device. Interfacing the device was a no brainer as the BBC Micro has the &#8216;User Port&#8217; which is a [...]]]></description>
			<content:encoded><![CDATA[<p>During my adventures with my BBC Micro and external hardware I found I needed to read/write to an <a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI</a> bus.   I ended up writing a bit banging routine to communicate in SPI Mode 0 with the device.</p>
<p><span id="more-262"></span><br />
Interfacing the device was a no brainer as the BBC Micro has the &#8216;User Port&#8217; which is a parallel port comprising 8 data lines and 2 control lines accessable via a 20 way IDC connector under the keyboard.  The &#8216;User Port&#8217; is actually Port B of one of the two <a href="http://en.wikipedia.org/wiki/MOS_Technology_6522">6522 VIA</a> IO chips in the machine.  To simplify the code the device was wired as follows:</p>
<ul>
<li>Bit 7 &#8211; MISO (Input data from the slave to the computer)</li>
<li>Bit 6 &#8211; MOSI (Output data from the computer to the slave)</li>
<li>Bit 1 &#8211; SCS (Output slave chip select)</li>
<li>Bit 0 &#8211; SCLK (Output SPI clock)</li>
</ul>
<p>The two registers of the VIA which are of interest are register 0, the input/output data register for Port B, and register 2 which is the direction register.  Setting a bit in register 2 means that the corresponding bit in register 0 is an input and clearing the bit means its an output.  Writing to register 0 will latch data to be output on Port B.  Reading from register 0 will return the value of the lines on Port B.  Usefully reading register 0 will return the values of output bits, set on a previous write, as well as the input bits.  The code below uses this feature too.</p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;">spibyte<span style="color: #339933;">:</span>
	sta outb
	ldy #<span style="color: #0000ff;">0</span>
	sty inb
	ldx #<span style="color: #0000ff;">8</span>
spibytelp<span style="color: #339933;">:</span>
	tya		<span style="color: #666666; font-style: italic;">; (2) set A to 0</span>
	asl outb	<span style="color: #666666; font-style: italic;">; (5) shift MSB in to carry</span>
	bcc spibyte1	<span style="color: #666666; font-style: italic;">; (2)</span>
	ora #mosi	<span style="color: #666666; font-style: italic;">; (2) set MOSI if MSB set</span>
spibyte1<span style="color: #339933;">:</span>
	sta uservia	<span style="color: #666666; font-style: italic;">; (4) output (MOSI, SCS low, SCLK low)</span>
	tya		<span style="color: #666666; font-style: italic;">; (2) set A to 0 (Do it here for delay reasons)</span>
	<span style="color: #00007f; font-weight: bold;">inc</span> uservia	<span style="color: #666666; font-style: italic;">; (6) toggle clock high (SCLK is bit 0)</span>
	<span style="color: #00007f; font-weight: bold;">clc</span>		<span style="color: #666666; font-style: italic;">; (2) clear C (Not affected by bit)</span>
	bit uservia	<span style="color: #666666; font-style: italic;">; (4) copy MISO (bit 7) in to N (and MOSI in to V)</span>
	bpl spibyte2	<span style="color: #666666; font-style: italic;">; (2)</span>
	sec		<span style="color: #666666; font-style: italic;">; (2) set C is MISO bit is set (i.e. N)</span>
spibyte2<span style="color: #339933;">:</span>
	<span style="color: #00007f; font-weight: bold;">rol</span> inb		<span style="color: #666666; font-style: italic;">; (5) copy C (i.e. MISO bit) in to bit 0 of result</span>
	<span style="color: #00007f; font-weight: bold;">dec</span> uservia	<span style="color: #666666; font-style: italic;">; (6) toggle clock low (SCLK is bit 0)</span>
	dex		<span style="color: #666666; font-style: italic;">; (2) next bit</span>
	bne spibytelp	<span style="color: #666666; font-style: italic;">; (2) loop</span>
	lda inb		<span style="color: #666666; font-style: italic;">; get result</span>
	rts</pre></div></div>

<p>The routine above is called with A containing the byte to be written on to the SPI.  When it returns A contains the byte read from the SPI.  <em>outb</em> and <em>inb</em> are page zero locations to store the byte being written and the byte being read and <em>uservia</em> is the address of register 0 on the VIA.  It is assumed that register 2 is already pre-configured (which is likely when sending/receiving multiple bytes).</p>
<p>The routine starts by setting Y is set 0 (and the input byte zeroed) and X is set to the number of bits to send i.e. 8.  Then the loop begins.  The accumulator is set to 0 (by copying the value of Y into it).  The MSB of the output byte is shifted in to Carry, and if set, the MOSI output bit (bit 6) is set in A.  A is then stored in register 0 (to output the MOSI bit).  The accumulator is set to 0 again.  This instruction also provides 2 cycles in which the MOSI bit can stabilize before the clock is toggled.  The clock is toggled by incrementing register 0 of the VIA.  This will read the value, add one to it (i.e. set the bottom bit), and write it back again.  As I said earlier, reading returns the latched value of the output bits so, apart from the clock bit, no other bits will change.</p>
<p>The Carry is cleared in preparation for the next step.  Again this instruction is done here to provide a 2 cycle delay as well.  The BIT instruction is then used to compare the accumulator with the value on the IO port.  BIT logically ANDs the accumulator and the specified memory setting the Z flag is equal but throwing away the result.  However it also copies bit 7 and bit 6 in to the N and V processor flags respectively.  Since bit 7 of the IO port is MISO this instruction reads the value on the MISO line and puts it in to N.  If N is not clear (i.e. the bit is 1) the Carry flag is set.  The Carry flag is then shifted in to the LSB of the output byte and the clock toggled back low again by decrementing the register 0 value.</p>
<p>This loop is repeated 8 times for all 8 bits.  By the end the 8 bits of the output byte will have been output MSB first and the 8 bits of the input byte read in MSB first.  SCLK is not very symmetrical and this may cause issues.  If that is the case additional NOPs either side of the <em>inc uservia</em> instruction may help.</p>
<p>The VIA also contains a shift register and I will be looking in to whether it could be used to speed up the bus.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberspice.org.uk/blog/2009/08/25/bit-banging-spi-in-6502-assembler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Melanie&#8217;s Mad Projects #1 &#8211; Ethernet for a Beeb &#8211; Update!</title>
		<link>http://www.cyberspice.org.uk/blog/2009/08/13/melanies-mad-projects-1-ethernet-for-a-beeb-update/</link>
		<comments>http://www.cyberspice.org.uk/blog/2009/08/13/melanies-mad-projects-1-ethernet-for-a-beeb-update/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 13:45:48 +0000</pubDate>
		<dc:creator>cyberspice</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Acorn]]></category>
		<category><![CDATA[BBC Micro]]></category>
		<category><![CDATA[BBC Microcomputer]]></category>
		<category><![CDATA[Beeb]]></category>
		<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.cyberspice.org.uk/blog/?p=257</guid>
		<description><![CDATA[A little while ago I wrote this blog post about adding ethernet capability to my aged BBC Microcomputer. Since then not a lot has happened. But very recently a couple of things have reinvigorated the project. I was having problems because the WIZ810mj module I was intending to use has 2mm board to board connectors [...]]]></description>
			<content:encoded><![CDATA[<p>A little while ago I wrote <a href="http://www.cyberspice.org.uk/blog/2009/01/16/melanies-mad-projects-1-ethernet-for-a-beeb/">this blog post</a> about adding ethernet capability to my aged BBC Microcomputer.   Since then not a lot has happened.  But very recently a couple of things have reinvigorated the project.</p>
<p><span id="more-257"></span><br />
I was having problems because the WIZ810mj module I was intending to use has 2mm board to board connectors on it.  This isn&#8217;t very hobbyist friendly.  However I discovered very recently that there&#8217;s a variation of the module, the WIZ812mj which actually has 0.1&#8243; pitch board to board connectors on it.  This is great because it means I can use stripboard for construction.  The WIZ810mj I already have wont be wasted and I will be writing about what I am doing with that soon.</p>
<p><center><a href="http://www.cyberspice.org.uk/gallery/displayimage.php?album=14&#038;pos=5"><img src="http://www.cyberspice.org.uk/gallery/albums/userpics/10001/wiz812mj725.jpg" title="WIZ812mj" alt="WIZ812mj" style="border: 0px" /></a></center></p>
<p>The other piece of information which has helped is discovery of a third way of using the WIZ module.  The module can be direct bus accessed or used via an <a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI bus</a>.  Since the clock speed of a BBC micro is relatively slow I ruled out the SPI bus (which is typically used by microcontrollers) and decided to bus access the module.  The addressed interface has a 32KB memory map.  This meant I was going to have to implement some paging logic in order to fit it in to the <a href="http://en.wikipedia.org/wiki/MOS_Technology_6502">6502</a>&#8216;s address space and so complicated the design.  But then I discovered it supported a third access mode which requires a minimal address space.  The third method is an indirect bus mode and uses the registers at 0&#215;0001 and 0&#215;0002 as an indirection address.  You set the address of the location you want to read or write in the WIZ module in these registers and then you can read or write the value by reading or writing the register at 0&#215;0003.  This means it requires far less space in the 6502 memory map so I can use one the Beeb&#8217;s external IO ports.</p>
<p><center><a href="http://www.cyberspice.org.uk/gallery/displayimage.php?album=14&#038;pos=1"><img src="http://www.cyberspice.org.uk/gallery/albums/userpics/10001/normal_beebthernet.png" alt="Beebthernet Schematic" title="Beebthernet Schematic" style="border: 0px" /></a></center></p>
<p>The schematic above shows the design of the ethernet board.  The board is designed to be connected to the BBC Micro&#8217;s <a href="http://en.wikipedia.org/wiki/Tube_(BBC_Micro)">TUBE</a> interface.  This interface provides access to the 6502&#8242;s data bus; A0 to A6 of the address bus; a select line; the 2Mhz clock; the read/write line; the IRQ line and the reset line.  This is all I need to drive the WIZ module.  There are a couple of bus-transceiver chips to buffer the module which is actually a 5v signal tolerant 3v3 device.  A small amount of TTL logic to provide /RD and /WR lines required by the ethernet module.  And the link, transmit and receive signals are broken out to LEDs.  The schematic does not show the derivation of the 3v3 supply nor decoupling capacitors for the ICs.  There&#8217;s also a small bug in so much as the A2 line is hooked through to the WIZ module.  Its not needed and should be tied low.</p>
<p>So that&#8217;s the design.  I have all the parts and will be prototyping it this weekend on stripboard.  Watch this space!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberspice.org.uk/blog/2009/08/13/melanies-mad-projects-1-ethernet-for-a-beeb-update/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Melanie&#8217;s Mad Projects #1 &#8211; Ethernet for a Beeb!</title>
		<link>http://www.cyberspice.org.uk/blog/2009/01/16/melanies-mad-projects-1-ethernet-for-a-beeb/</link>
		<comments>http://www.cyberspice.org.uk/blog/2009/01/16/melanies-mad-projects-1-ethernet-for-a-beeb/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 23:25:49 +0000</pubDate>
		<dc:creator>cyberspice</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Acorn]]></category>
		<category><![CDATA[BBC Micro]]></category>
		<category><![CDATA[BBC Microcomputer]]></category>
		<category><![CDATA[Beeb]]></category>
		<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.cyberspice.org.uk/blog/?p=104</guid>
		<description><![CDATA[Writing about my Beeb yesterday got me thinking about a project I consider every now and then and that is adding an ethernet adapter to my Beeb. When I first thought about this I was working on a driver for a small embedded ethernet chip that was destined for a set top box. The chip [...]]]></description>
			<content:encoded><![CDATA[<p><span style="float: right; margin-left: 10px; margin-bottom: 10px;"><img title="A BBC Microcomputer Model B" src="http://www.cyberspice.org.uk/blog/wp-content/uploads/2009/01/bbc_micro.jpg" /></span></p>
<p>Writing about my <a href="http://en.wikipedia.org/wiki/BBC_Micro">Beeb</a> yesterday got me thinking about a project I consider every now and then and that is adding an ethernet adapter to my Beeb.</p>
<p>When I first thought about this I was working on a driver for a small embedded ethernet chip that was destined for a set top box.  The chip was pretty simple and could be used on an 8 or 16 bit data bus.  It could have been interfaced to my Beeb relatively easily but would have required me to write a whole TCP/IP stack for the machine.  Something I could have done but not a quick task.  Also you&#8217;d need memory buffers to build the packets in which, in a memory starved machine, are a costly overhead.  Work got busier and I had more important things to do with my free time so I put the idea to bed.</p>
<p>I started thinking about the project again after reading about a chip that communicated using <a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI</a>.  It was intended to be used with micro-controllers so seemed more suited to my needs.  Except there were two issues.  Firstly a BBC Micro doesn&#8217;t have SPI.  In theory the <a href="http://en.wikipedia.org/wiki/MOS_Technology_6522">6522 VIA</a>, of which there are two in the Beeb, can do SPI like IO.  Unfortunately there&#8217;s actually a bug in the chip that means it doesn&#8217;t work properly.  So either I would have to bit bang or I would have to use a second chip, probably a micro-controller, to communicate with the ethernet chip and the BBC Micro would interface with the micro-controller.  Again other things became a priority and it got forgotten about.</p>
<p>So today I started thinking about it again.  As more and more devices have become internet enabled some neat chips have been released.  These chips have built in micro-controllers which have a TCP/IP stack built in.  They do all the hard work.  So I started Googling and I found <a href="http://www.circuitcellar.com/archives/viewable/Eady208/2.html">this article on the W5100</a> which seems to be ideal.  Specifically the <cite>W5100 is a fully hardwired TCP/IP stack with support for TCP, UDP, ICMP, IPv4 ARP, IGMP, PPPoE protocols. Features include 10BaseT/100BaseTX Ethernet MAC/PHY embedded support and ADSL connection (with PPPoE Protocol with PAP/CHAP Authentication mode)</cite>.  You can interface with it using a parallel data bus and it basically provides a socket level interface at the software level.  Set up the MAC address, IP address and gateway address and you can ping the chip with no further work from the host machine.</p>
<p><span style="float: left; margin-top: 10px; margin-right: 10px; margin-bottom: 10px;"><img src="http://www.cyberspice.org.uk/blog/wp-content/uploads/2009/01/wiz810mj725-300x190.jpg" title="The WIZ810MJ ethernet module" width="300" height="190" /></span></p>
<p>The W5100 comes in quite a small package.  Circuit board technology has come a long way since I last built anything complicated.  To solder most modern packages is beyond the of the average amateur electronics engineer due pin density or the requirement for solder ovens or flow technologies.  This could have put a damper on this project except I found the WIZ810MJ module.  Its basically the W5100 chip on a pre built module.  It seems perfect so I&#8217;m getting one.</p>
<p>I will need to provide a 3.3v supply but this can be relatively simply provided with a small regulator chip from the 5v supply of the Beeb.  The IO on the module is 5v tolerant so it can be interfaced with directly.  The module has an 8 bit data bus and address lines A0-A14, i.e. 32KB of address space.  The Beeb supports <a href="http://en.wikipedia.org/wiki/Sideways_address_space">Sideways ROMs</a>, basically paged ROMs which occupy the same address space.  These are 16KB in size so I intend utilizing this together with a latch to bank the address space in to two banks.  The remaining IO lines can be supported relatively easily.</p>
<p>So this is my first mad project.  Watch this space!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberspice.org.uk/blog/2009/01/16/melanies-mad-projects-1-ethernet-for-a-beeb/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

