<?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>ElectricRock Blog &#187; matt</title>
	<atom:link href="http://www.electricrock.co.nz/blog/author/matt/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.electricrock.co.nz/blog</link>
	<description>Electronic Ramblings</description>
	<lastBuildDate>Tue, 10 Aug 2010 03:37:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sample Makefile for C30</title>
		<link>http://www.electricrock.co.nz/blog/2010/07/sample-makefile-for-c30/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/07/sample-makefile-for-c30/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 22:00:11 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=157</guid>
		<description><![CDATA[To simplify the process of starting a new C30 project I have created a sample Makefile that takes care of most of the hard work of library paths, linker scripts, etc. Check it out at http://www.electricrock.co.nz/blog/microchip-c30/#makefile and let me know if you run into any problems.
]]></description>
			<content:encoded><![CDATA[<p>To simplify the process of starting a new C30 project I have created a sample Makefile that takes care of most of the hard work of library paths, linker scripts, etc. Check it out at <a href="http://www.electricrock.co.nz/blog/microchip-c30/#makefile">http://www.electricrock.co.nz/blog/microchip-c30/#makefile</a> and let me know if you run into any problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/07/sample-makefile-for-c30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated C30 build script for C30 v3.23b</title>
		<link>http://www.electricrock.co.nz/blog/2010/07/updated-c30-build-script-for-c30-v3-23b/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/07/updated-c30-build-script-for-c30-v3-23b/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 21:26:26 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=151</guid>
		<description><![CDATA[I have made a minor update to the C30 install script so that it can build/install C30 v3.23b. The only real change (apart from updating filenames) is a new unattended install script for the non-free part.
Instructions and download here: http://www.electricrock.co.nz/blog/microchip-c30/.
]]></description>
			<content:encoded><![CDATA[<p>I have made a minor update to the C30 install script so that it can build/install C30 v3.23b. The only real change (apart from updating filenames) is a new unattended install script for the non-free part.</p>
<p>Instructions and download here: <a href="http://www.electricrock.co.nz/blog/microchip-c30/">http://www.electricrock.co.nz/blog/microchip-c30/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/07/updated-c30-build-script-for-c30-v3-23b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated C30 build script for Ubuntu 10.04</title>
		<link>http://www.electricrock.co.nz/blog/2010/05/updated-c30-build-script-for-ubuntu-10-04/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/05/updated-c30-build-script-for-ubuntu-10-04/#comments</comments>
		<pubDate>Sun, 02 May 2010 21:25:50 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=143</guid>
		<description><![CDATA[Ubuntu 10.04 is hot off the press, so I have uploaded an update to the C30 build script to run on it.  Apparently the dos2unix command is no longer supported in 10.04 so the script now uses fromdos (thanks to Nicolas for the info).
Latest version of the script can be found here: http://www.electricrock.co.nz/blog/microchip-c30/
]]></description>
			<content:encoded><![CDATA[<p>Ubuntu 10.04 is hot off the press, so I have uploaded an update to the C30 build script to run on it.  Apparently the dos2unix command is no longer supported in 10.04 so the script now uses fromdos (thanks to Nicolas for the info).</p>
<p>Latest version of the script can be found here: <a href="http://www.electricrock.co.nz/blog/microchip-c30/">http://www.electricrock.co.nz/blog/microchip-c30/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/05/updated-c30-build-script-for-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>New C30 page, now with automated goodness</title>
		<link>http://www.electricrock.co.nz/blog/2010/03/new-c30-page-now-with-automated-goodness/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/03/new-c30-page-now-with-automated-goodness/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 05:25:40 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Informational]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PIC]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=133</guid>
		<description><![CDATA[I have just created a new page to put all my C30 related tutorials, etc. on.  It can be found at http://www.electricrock.co.nz/blog/microchip-c30/.
The most notable update is that my previous C30 building tutorials are now deprecated in favor of a new bash script that does it automagically.  Check out the page for more details.
]]></description>
			<content:encoded><![CDATA[<p>I have just created a new page to put all my C30 related tutorials, etc. on.  It can be found at <a href="http://www.electricrock.co.nz/blog/microchip-c30/">http://www.electricrock.co.nz/blog/microchip-c30/</a>.</p>
<p>The most notable update is that my previous C30 building tutorials are now deprecated in favor of a new bash script that does it automagically.  Check out the page for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/03/new-c30-page-now-with-automated-goodness/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>DLP-RFID1 library for Linux</title>
		<link>http://www.electricrock.co.nz/blog/2010/02/dlp-rfid1-library-for-linux/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/02/dlp-rfid1-library-for-linux/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 02:22:43 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Informational]]></category>
		<category><![CDATA[DLP-RFID1]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=111</guid>
		<description><![CDATA[This page is deprecated. Please see the new page at: http://www.electricrock.co.nz/tools/dlp-rfid1-library-for-linux/.



I bought a DLP-RFID1 USB RFID tag reader/writer from Digikey (Cat # 813-1013-ND).  However, I was unable to locate sufficient libraries to develop software that uses it under Linux.  So I have written a C++ library to do this.  Read on for [...]]]></description>
			<content:encoded><![CDATA[<p><strong>This page is deprecated. Please see the new page at: <a href="http://www.electricrock.co.nz/tools/dlp-rfid1-library-for-linux/">http://www.electricrock.co.nz/tools/dlp-rfid1-library-for-linux/</a>.<br />
</strong></p>
<p><span style="color: #999999;"><br />
</span></p>
<p><span style="color: #999999;">I bought a <a href="http://www.dlpdesign.com/rf/rfid1.shtml">DLP-RFID1</a> USB RFID tag reader/writer from Digikey (Cat # 813-1013-ND).  However, I was unable to locate sufficient libraries to develop software that uses it under Linux.  So I have written a C++ library to do this.  Read on for more information and to download it.<br />
<span id="more-111"></span></span> <span style="color: #999999;"><br />
The DLP-RFID1 comprises an FTDI USB-Serial IC connected to a microcontroller.  Therefore the library I have developed is based on <a href="http://www.intra2net.com/en/developer/libftdi/">libftdi</a>.  Currently, it is very basic and supports only polling for tags (not reading and writing tags).  As I currently have no need for reading and writing tags I don&#8217;t plan to add this functionality unless someone asks for it.</span></p>
<p><span style="color: #999999;">The library can be downloaded from <a href="http://www.electricrock.co.nz/files/rfid1/librfid1-0.1.0.tar.bz2">http://www.electricrock.co.nz/files/rfid1/librfid1-0.1.0.tar.bz2</a>.  Documentation is provided in the package.</span></p>
<p><span style="color: #999999;">This is my first time making a library package for Linux, so if you find any problems or have any suggestions please leave a comment and let me know.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/02/dlp-rfid1-library-for-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Building Microchip&#8217;s C30 Compiler v3.20 on Ubuntu 9.10</title>
		<link>http://www.electricrock.co.nz/blog/2010/01/building-c30-v32/</link>
		<comments>http://www.electricrock.co.nz/blog/2010/01/building-c30-v32/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 06:06:04 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=87</guid>
		<description><![CDATA[NOTE: This page is now outdated, please go to http://www.electricrock.co.nz/blog/microchip-c30/
This an update to my previous tutorial for building Microchip’s C Compiler for PIC24 MCUs and dsPIC DSCs (herein referred to as C30). This update covers building v3.20 of the compiler (as opposed to v3.12) under Ubuntu 9.10.  Again, this is mostly gleaned from  http://embeddedfreak.wordpress.com/2008/10/10/compiling-mplab-c30-v311b-under-linux, but [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NOTE: This page is now outdated, please go to <a href="http://www.electricrock.co.nz/blog/microchip-c30/">http://www.electricrock.co.nz/blog/microchip-c30/</a></strong></p>
<p>This an update to my <a href="http://www.electricrock.co.nz/blog/2009/08/installing-microchips-c-compiler-for-pic24-mcus-and-dspic-dscs-c30-on-ubuntu-9-04">previous tutorial</a> for building Microchip’s C Compiler for PIC24 MCUs and dsPIC DSCs (herein referred to as C30). This update covers building v3.20 of the compiler (as opposed to v3.12) under Ubuntu 9.10.  Again, this is mostly gleaned from  <a href="http://embeddedfreak.wordpress.com/2008/10/10/compiling-mplab-c30-v311b-under-linux/">http://embeddedfreak.wordpress.com/2008/10/10/compiling-mplab-c30-v311b-under-linux</a>, but adapted for the latest version of C30.</p>
<p>These instructions also work for v3.22 and are reported to work with v3.23.</p>
<p><span id="more-87"></span></p>
<h3>Installation</h3>
<h4>Install prerequisite software</h4>
<ul>
<li> Install packages from the Ubuntu repositories:
<pre class="brush: bash;">sudo aptitude install build-essential bison flex tofrodos</pre>
</li>
<li>Install wine (instructions available from the Wine website: <a href="http://www.winehq.org/download/deb">http://www.winehq.org/download/deb</a>). I used the following steps to install the latest version (you can just install the one in the Ubuntu repositories if you aren&#8217;t worried about being bleeding edge):
<pre class="brush: bash;">sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo aptitude install wine</pre>
</li>
</ul>
<h4>Setup paths</h4>
<p>The exports below can be varied depending on where you prefer things to be put. At the risk of stating the obvious I&#8217;ll outline what each of the exports is for:</p>
<ul>
<li>C30BUILD is the temporary directory where the C30 tool suite is built.</li>
<li>C30INSTALL is  where it will be installed to.</li>
<li>DOWNLOADDIR is where you save files to when downloading.</li>
<li>WINEPREFIX is where you want to install the proprietary tool suite.</li>
</ul>
<pre class="brush: bash;">export C30BUILD=$HOME/c30-build
export C30INSTALL=$HOME/Apps/pic30
export DOWNLOADDIR=$HOME/Downloads
export WINEPREFIX=$HOME/Apps/pic30-wine</pre>
<h4>Download sources, etc.</h4>
<ul>
<li>From Microchip&#8217;s website download the sources for the compiler and binutils.  They can be found on this page: <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en023073">http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en023073</a>. You will need to login to download.  You want to get:
<ul>
<li><em>GCC Code for MPLAB ASM30 for dsPIC/PIC24 v3.20</em></li>
<li><em>MPLAB C30 v3.20 GCC Source</em></li>
</ul>
</li>
<li>Download the academic or evaluation version of the proprietary compiler from the C30 website (<a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010065">http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en010065</a>)</li>
<li>Download the patches. I have adapted these from those provided by John Steele Scott (see my previous post) to work with v3.20.
<ul>
<li>Binutils: <a href="http://www.electricrock.co.nz/c30/pic30-binutils-3.20.tar.bz2">http://www.electricrock.co.nz/c30/pic30-binutils-3.20.tar.bz2</a></li>
<li>GCC: <a href="http://www.electricrock.co.nz/c30/pic30-gcc-3.20.tar.bz2">http://www.electricrock.co.nz/c30/pic30-gcc-3.20.tar.bz2</a></li>
</ul>
</li>
</ul>
<h4>Building Binutils</h4>
<ul>
<li>Unzip the sources.
<pre class="brush: bash;">
mkdir -p $C30BUILD/binutils
cd $C30BUILD/binutils
tar -zxvf $DOWNLOADDIR/mplabalc30v3_20.tar.gz
tar -jxvf $DOWNLOADDIR/pic30-binutils-3.20.tar.bz2
</pre>
</li>
<li>The microchip sources have been edited on windows, so we need to convert files to unix line endings so that they can be patched.
<pre class="brush: bash;">find . -type f -exec dos2unix '{}' ';'</pre>
</li>
<li>Apply the patches.  So far as I can tell, these fix a few compile issues with the microchip compiler and make it play nicer under Linux.
<pre class="brush: bash;">for i in pic30-binutils-3.20/patches/*.diff; do echo &quot;Applying patch $i...&quot;; patch -p0 &lt; $i; done</pre>
</li>
<li>Build it, the version number in DMHCP_VERSION needs to match the version of the non-free compiler you install.
<pre class="brush: bash;"> cd acme/
CFLAGS=-DMCHP_VERSION=&quot;v3.20-Debian&quot; ./configure --prefix=$C30INSTALL --target=pic30-coff
</pre>
<li>Before we can make it we need to touch some files otherwise it doesn&#8217;t get built properly.
<pre class="brush: plain;">find . -name &quot;*.y&quot; -o -name &quot;*.l&quot; -exec touch '{}' ';'</pre>
<li>Make it.
<pre class="brush: plain;">make</pre>
</li>
<li>Install, if you install to a location that you don&#8217;t have write permission to (e.g. /usr/local) you will need to use sudo.
<pre class="brush: bash;"> make install </pre>
</li>
</ul>
<h4>Building GCC</h4>
<ul>
<li>Similar process to binutils above for building GCC.
<pre class="brush: bash;">mkdir -p $C30BUILD/gcc
cd $C30BUILD/gcc
tar -zxvf $DOWNLOADDIR/mplabc30v3_20.tar.gz
tar -jxvf $DOWNLOADDIR/pic30-gcc-3.20.tar.bz2
find . -type f -exec dos2unix '{}' ';'
for i in pic30-gcc-3.20/patches/*.diff; do echo &quot;Applying patch $i...&quot;; patch -p0 &lt; $i; done</pre>
</li>
<li>We take a slight deviation from binutils here as we create a separate directory for GCC to build in, apparently it likes it that way.
<pre class="brush: bash;">mkdir build
cd build
CFLAGS=-DMCHP_VERSION=&quot;v3.20-Debian&quot; ../gcc-4.0.2/gcc-4.0.2/configure --prefix=$C30INSTALL --target=pic30-coff --enable-languages=c</pre>
</li>
<li>Then we have to touch c-parse.y cause (according to <a href="http://embeddedfreak.wordpress.com/2008/10/10/compiling-mplab-c30-v311b-under-linux/">embeddedfreak</a>) it doesn&#8217;t get generated correctly, so we need it to be recreated. I just followed the instructions and it worked.
<pre class="brush: bash;">touch ../gcc-4.0.2/gcc-4.0.2/gcc/c-parse.y</pre>
</li>
<li>Build it and install it (again, use sudo for make install if you have to).
<pre class="brush: bash;">make
make install</pre>
</li>
<li>Link the binutils into GCC&#8217;s tool path so it can find them, and create a link to GCC itself so we don&#8217;t have to type the version number every time:
<pre class="brush: bash;">ln -s $C30INSTALL/bin/pic30-coff-as $C30INSTALL/libexec/gcc/pic30-coff/4.0.3/pic30-coff-as
ln -s $C30INSTALL/bin/pic30-coff-ld $C30INSTALL/libexec/gcc/pic30-coff/4.0.3/pic30-coff-ld
ln -s $C30INSTALL/bin/pic30-coff-gcc-4.0.3 $C30INSTALL/bin/pic30-coff-gcc</pre>
</li>
</ul>
<h4>Next Steps</h4>
<p>The rest of the steps are just the same as for building v3.12.  I won&#8217;t repeat myself here, just check out my <a href="http://www.electricrock.co.nz/blog/2009/08/installing-microchips-c-compiler-for-pic24-mcus-and-dspic-dscs-c30-on-ubuntu-9-04/">previous tutorial</a> and follow the steps from <em>Setup the non-free part</em> onward.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2010/01/building-c30-v32/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Control 16 Firmware Replacement</title>
		<link>http://www.electricrock.co.nz/blog/2009/10/control-16-firmware-replacement/</link>
		<comments>http://www.electricrock.co.nz/blog/2009/10/control-16-firmware-replacement/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 01:26:56 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[at89s52]]></category>
		<category><![CDATA[Control 16]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=64</guid>
		<description><![CDATA[As I have mentioned in my previous posts about the Ensoniq Control 16, it is a DAW control surface designed to interface to proprietary DAW software via a proprietary PCI card.  As I have the C16, but not the PCI card, I have been working on reverse engineering the interface so that I can build [...]]]></description>
			<content:encoded><![CDATA[<p>As I have mentioned in my previous posts about the <a href="http://www.electricrock.co.nz/blog/tag/control-16/">Ensoniq Control 16</a>, it is a DAW control surface designed to interface to proprietary DAW software via a proprietary PCI card.  As I have the C16, but not the PCI card, I have been working on reverse engineering the interface so that I can build a USB adaptor for it and use it with my PC.</p>
<p>I have previously written about how I built an RS-232 adaptor for the Control 16, but this alone did not allow me to communicate with the Control 16 as I did not know its communication protocol. As I did not have the PCI card to act as a master and provide something for the C16 to communicate with, I was not able to sniff the communications and reverse engineer them. My solution instead was to replace the firmware running on the C16&#8217;s microcontroller with one that I custom wrote, and which used my own communication protocol.</p>
<p><span id="more-64"></span></p>
<h3>Control 16 Architecture</h3>
<p>The Control 16 is based around an Atmel AT89C52 microcontoller.  I replaced this with an AT89S52 for development as I could then use its in-circuit serial programming feature.  Using a multimeter I traced some of the connections between the microcontroller and other ICs on the board, and inferred the rest.  The result was that I was able to map out a block diagram of the mainboard, as shown below.</p>
<div id="attachment_65" class="wp-caption alignnone" style="width: 560px"><a href="http://www.electricrock.co.nz/blog/wp-content/uploads/2009/10/c16-blockdiagram.png"><img class="size-large wp-image-65" title="C16 Block Diagram" src="http://www.electricrock.co.nz/blog/wp-content/uploads/2009/10/c16-blockdiagram-1024x791.png" alt="Control 16 Architecture Block Diagram" width="550" height="423" /></a><p class="wp-caption-text">Control 16 Architecture Block Diagram</p></div>
<p>I&#8217;m not going to go into a lengthy explanation of the architecture unless there is someone out there who it&#8217;s useful to, so if that is you then post a comment and let me know.</p>
<h3>Firmware Replacement</h3>
<p>I developed the firmware replacement using the <a href="http://sdcc.sourceforge.net/">SDCC</a> toolchain.  I have released the code under the GPL v3 license in case it may be of use to anyone. It can be downloaded here: <a href="http://www.electricrock.co.nz/blog/wp-content/uploads/2009/10/c16firmware.zip">C16Firmware</a>. <i>Please not that there is a bug in the current version of the firmware code.  I will update it at some point, if you need it sooner let me know.</i></p>
<p>This firmware detects events from the sliders, buttons, jog wheel, and rotary encoders (though these have issues) and transmits their values via the serial port. It is also allows the values of the LEDs to be set via commands received on the serial port. So all-in-all it is almost fully functional.  The communication protocol is a fairly simple text-based protocol.</p>
<p>Now that the firmware is completed, the next stage in my C16 project is to develop software that runs on the host PC and converts between the simple text based protocol of the C16, and some other midi control protocol that can be used by DAW software.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2009/10/control-16-firmware-replacement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ensoniq Control 16 RJ-45 Connector Pinout</title>
		<link>http://www.electricrock.co.nz/blog/2009/09/ensoniq-control-16-rj-45-connector-pinout/</link>
		<comments>http://www.electricrock.co.nz/blog/2009/09/ensoniq-control-16-rj-45-connector-pinout/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 03:59:04 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Informational]]></category>
		<category><![CDATA[Control 16]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=60</guid>
		<description><![CDATA[As I stated in my first Control 16 post, the C16 is meant to connect to a proprietary Ensoniq PCI card (which I don&#8217;t have.)  So instead I have been reverse engineering the C16 interface so that I can convert it for use with my PC.  The C16 has two connectors on the back a [...]]]></description>
			<content:encoded><![CDATA[<p>As I stated in my <a href="http://www.electricrock.co.nz/blog/2009/08/ensoniq-control-16-undressed/">first Control 16 post</a>, the C16 is meant to connect to a proprietary Ensoniq PCI card (which I don&#8217;t have.)  So instead I have been reverse engineering the C16 interface so that I can convert it for use with my PC.  The C16 has two connectors on the back a 1/4&#8243; jack, which is used to connect an optional footswitch; and an RJ-45 connector, which is proprietary.  Both connectors are mounted on a board called <em>PWR/SER_I/F</em>.</p>
<p><span id="more-60"></span></p>
<div id="attachment_27" class="wp-caption alignnone" style="width: 310px"><a href="http://www.electricrock.co.nz/blog/wp-content/uploads/2009/08/control16-3.jpg"><img class="size-medium wp-image-27" title="Control 16 #3" src="http://www.electricrock.co.nz/blog/wp-content/uploads/2009/08/control16-3-300x207.jpg" alt="Control 16 Regulator/IO Board" width="300" height="207" /></a><p class="wp-caption-text">Control 16 Regulator/IO Board</p></div>
<p>The pinout of the RJ-45 connector is as follows (pin 1 is on the left when looking into the connector, therefore on the right in the photo above):</p>
<table border="0">
<tbody>
<tr>
<td>1</td>
<td>RS-422 data in (+)</td>
</tr>
<tr>
<td>2</td>
<td>RS-422 data in (-)</td>
</tr>
<tr>
<td>3</td>
<td>RS-422 data out (+)</td>
</tr>
<tr>
<td>4</td>
<td>+12v</td>
</tr>
<tr>
<td>5</td>
<td>GND</td>
</tr>
<tr>
<td>6</td>
<td>RS-422 data out (-)</td>
</tr>
<tr>
<td>7</td>
<td>GND</td>
</tr>
<tr>
<td>8</td>
<td>+5v</td>
</tr>
</tbody>
</table>
<p>While the above pinout may appear a little random at first glance, when using standard CAT5 cable it means that the pairs are RS422 in; RS422 out; +5v and GND; and +12v and GND.</p>
<p>Here is a schematic for a RS422 to RS232 converter, similar to what I am using myself (though I have been providing power from a lab power supply at this stage.)</p>
<div id="attachment_61" class="wp-caption alignnone" style="width: 310px"><a href="http://www.electricrock.co.nz/blog/wp-content/uploads/2009/09/c16-serial-adaptor.png"><img class="size-medium wp-image-61" title="Control16 - Adaptor" src="http://www.electricrock.co.nz/blog/wp-content/uploads/2009/09/c16-serial-adaptor-300x160.png" alt="Control 16 - Proprietary interface to RS232 adaptor" width="300" height="160" /></a><p class="wp-caption-text">Control 16 - Proprietary interface to RS232 adaptor</p></div>
<p>Please note that while I have successfully connected power and data to my control 16 without blowing it up, this information is only provided as a guide and I recommend double checking it against your actual hardware before connecting anything to your control 16.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2009/09/ensoniq-control-16-rj-45-connector-pinout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a Xilinx DLC5 Parallel Cable to program an AT89S52</title>
		<link>http://www.electricrock.co.nz/blog/2009/09/using-a-xilinx-dlc5-parallel-cable-to-program-an-at89s52/</link>
		<comments>http://www.electricrock.co.nz/blog/2009/09/using-a-xilinx-dlc5-parallel-cable-to-program-an-at89s52/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 22:31:01 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[at89s52]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=56</guid>
		<description><![CDATA[While working on my control 16 project I realised I would need to replace the firware of the onboard microcontroller, an AT89C52.  Unfortunately, the AT89C52 is a mission to program (as it is parallel programmable only) so I have replaced it with an AT89S52, which supports in-circuit serial programming.  What I still lacked was an [...]]]></description>
			<content:encoded><![CDATA[<p>While working on my control 16 project I realised I would need to replace the firware of the onboard microcontroller, an AT89C52.  Unfortunately, the AT89C52 is a mission to program (as it is parallel programmable only) so I have replaced it with an AT89S52, which supports in-circuit serial programming.  What I still lacked was an ISP programmer; however, instead of building one I made use of an old Xilinx DLC5 parallel port JTAG cable (<a href="http://www.xilinx.com/itp/xilinx4/data/docs/pac/appendixb.html">schematic</a>).  This was fairly straight forward under Ubuntu 9.04, using <a href="http://www.nongnu.org/uisp/">UISP</a> AVR and AT89S programming software.  The following instructions assume the target is self powered and has an oscillator/crystal connected if required. NB these instructions are written from memory, so if you find a mistake please post a comment.</p>
<p><span id="more-56"></span></p>
<h3>Setup</h3>
<ol>
<li>Add yourself to the lp group so that you can access the parallel port without needing to be superuser (you will need to log out and back in again after this command):<br />
<span style="color: #0000ff;"><em>sudo usermod -a -G lp &lt;username&gt;<br />
</em></span></li>
<li>Install uisp:<br />
<span style="color: #0000ff;"><em>sudo aptitude install uisp</em></span></li>
<li>Connect the JTAG cable to your target device as follows:<br />
<table border="0">
<tbody>
<tr>
<td><strong>JTAG</strong></td>
<td><strong>Target</strong></td>
</tr>
<tr>
<td>Vcc</td>
<td>Vcc</td>
</tr>
<tr>
<td>GND</td>
<td>GND</td>
</tr>
<tr>
<td>TDI</td>
<td>MOSI</td>
</tr>
<tr>
<td>TDO</td>
<td>MISO</td>
</tr>
<tr>
<td>TCK</td>
<td>SCK</td>
</tr>
<tr>
<td>TMS</td>
<td>RST</td>
</tr>
</tbody>
</table>
</li>
</ol>
<h3>Some useful UISP commands</h3>
<p>These are given for AT89S52, but for other AVR series it should work if you just drop the <em>-d89</em> flag and use the appropriate part number.  The main thing to note here is that the <em>dprog</em> flag is set to <em>xil</em> to indicate we are using a DLC5 for programming.</p>
<table border="0">
<tbody>
<tr>
<td>Erase</td>
<td><span style="color: #0000ff;"><em>uisp -d89 -dprog=xil -dpart=at89s52 &#8211;erase</em></span></td>
</tr>
<tr>
<td>Program</td>
<td><em><span style="color: #0000ff;">uisp -d89 -dprog=xil -dpart=at89s52  &#8211;upload if=[input filename (in intel hex or motorolla srec format)]</span></em></td>
</tr>
<tr>
<td>Read back</td>
<td><em><span style="color: #0000ff;">uisp -d89 -dprog=xil -dpart=at89s52 &#8211;download of=[output filename (in srec format)]</span></em></td>
</tr>
</tbody>
</table>
<p>If you have issues try adding <em>-v=3</em> or <em>-v=4</em> for more verbose output from UISP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2009/09/using-a-xilinx-dlc5-parallel-cable-to-program-an-at89s52/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using C30 with Piklab</title>
		<link>http://www.electricrock.co.nz/blog/2009/08/using-c30-with-piklab/</link>
		<comments>http://www.electricrock.co.nz/blog/2009/08/using-c30-with-piklab/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 21:11:08 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[C30]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[Piklab]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.electricrock.co.nz/blog/?p=47</guid>
		<description><![CDATA[This post follows on from my previous post on building Microchip's C compiler for PIC24 and dsPIC (C30) onUbuntu.  Piklab is a great IDE for PIC development, and IMHO much nicer to use than MPLAB.  Piklab has support for the dsPIC30 series of PICs using the C30 toolchain.  However, I found the default settings need a little bit of tweaking to make the the toolchain that I built work. The following post details how I setup Piklab to make use of this toolchain.]]></description>
			<content:encoded><![CDATA[<p>This post follows on from my previous post on <a href="http://www.electricrock.co.nz/blog/2009/08/installing-microchips-c-compiler-for-pic24-mcus-and-dspic-dscs-c30-on-ubuntu-9-04/">building Microchip&#8217;s C compiler for PIC24 and dsPIC (C30) onUbuntu</a>.  <a href="http://piklab.sourceforge.net/">Piklab</a> is a great IDE for PIC development, and IMHO much nicer to use than MPLAB.  Piklab has support for the dsPIC30 series of PICs using the C30 toolchain.  However, I found the default settings need a little bit of tweaking to make the the toolchain that I built work. The following post details how I setup Piklab to make use of this toolchain.</p>
<p><span id="more-47"></span></p>
<h3>Configuring the Toolchain</h3>
<p>NB: The following assumes <em>&lt;C30-base&gt;</em> is the directory where C30 was installed (if you followed my previous tutorial this will be whatever you set for the <em>C30INSTALL</em> environment variable).</p>
<ul>
<li>Open up Piklab and go to <em>Settings-&gt;Configure Toolchains&#8230;</em></li>
<li>In the <em>Configure Toolchains</em> window select <em>PIC30 Toolchain</em> from the sidebar.</li>
<li>Fill out the fields as follows:
<ul>
<li><em>Executable directory</em> &#8211; <em>&lt;C30-base&gt;/bin</em></li>
<li><em>Header directory</em> &#8211; <em>&lt;C30-base&gt;/pic30-nonfree/support/dsPIC30F/h/</em> (assuming you are using C30 to compile for dsPIC30F series&#8211;I haven&#8217;t tried any other series, so YMMV).</li>
<li><em>Linker script directory</em> &#8211; <em>&lt;C30-base&gt;/pic30-nonfree/support/dsPIC30F/gld/</em></li>
<li><em>Library directory</em> &#8211; <em>&lt;C30-base&gt;/pic30-nonfree/lib/<br />
</em></li>
</ul>
</li>
<li>The other fields can be left as the default.</li>
</ul>
<h3>Configuring the Project</h3>
<p>For each project you will also have to do some configuration. After creating a new project, bring up the <em>Project Options</em> window (<em>Project-&gt;Project Options&#8230;</em>), and fill in as follows:</p>
<ul>
<li>Toolchain tab
<ul>
<li>Make sure <em>PIC30 Toolchain</em> is the active toolchain.</li>
</ul>
</li>
<li>Compiler tab
<ul>
<li>In the <em>Custom options</em> field enter: <em>-mresource=&lt;C30-base&gt;/info/c30_device.info</em></li>
</ul>
</li>
<li>Linker tab
<ul>
<li>In the <em>Custom libraries</em> field enter: <em>-lpic30</em></li>
</ul>
</li>
</ul>
<p>That should be enough to build coff files in Piklab.  I have successfully programming the dsPIC30F4013 from Piklab using the above toolchain to build the firmware and an Microchip ICD2 to download it to the PIC.  If you have any issues, if this doesn&#8217;t work for you, or if you have had some luck using a different family of PICs with C30, then please leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricrock.co.nz/blog/2009/08/using-c30-with-piklab/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
	</channel>
</rss>
