<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tutorial on Colin O'Flynn</title><link>https://colinoflynn.com/tag/tutorial/</link><description>Recent content in Tutorial on Colin O'Flynn</description><generator>Hugo</generator><language>en-ca</language><lastBuildDate>Mon, 15 Apr 2024 10:51:37 +0000</lastBuildDate><atom:link href="https://colinoflynn.com/tag/tutorial/index.xml" rel="self" type="application/rss+xml"/><item><title>Dumping Parallel NAND with Glasgow</title><link>https://colinoflynn.com/2024/04/dumping-parallel-nand-with-glasgow/</link><pubDate>Sun, 14 Apr 2024 23:00:05 +0000</pubDate><guid>https://colinoflynn.com/2024/04/dumping-parallel-nand-with-glasgow/</guid><description>&lt;p&gt;I recently got my Glasgow device, which is a rather impressive piece of tech. I followed the Windows installation instructions and it &amp;ldquo;Just Worked&amp;rdquo;, including installing the toolchain! On one computer I needed to use Zadig to force the driver to be &lt;strong&gt;libusbK&lt;/strong&gt;, but on another Windows computer it wasn&amp;rsquo;t needed. In this blog post, I&amp;rsquo;m going to explore a parallel NAND device that I wanted to dump, and find out how well Glasgow works.&lt;/p&gt;</description></item><item><title>FICHSA ChipWhisperer Tutorial Requirements</title><link>https://colinoflynn.com/2019/05/fichsa-chipwhisperer-tutorial-requirements/</link><pubDate>Mon, 06 May 2019 11:31:39 +0000</pubDate><guid>https://colinoflynn.com/2019/05/fichsa-chipwhisperer-tutorial-requirements/</guid><description>&lt;p&gt;At the FICHSA Conference (&lt;br&gt;
&lt;a href="https://fichsa.sise.bgu.ac.il/"&gt;https://fichsa.sise.bgu.ac.il&lt;/a&gt; ) I will be running a short workshop on ChipWhisperer using the ChipWhisperer-Nano.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A direct link to a Google Doc with the most up to date information is available here:&lt;/strong&gt; &lt;a href="https://docs.google.com/document/d/1IgDeGZ6d0FEYJbaF4a-KsBhdIHlMZg04-wQYUSZgnks/edit?usp=sharing"&gt;&lt;strong&gt;https://docs.google.com/document/d/1IgDeGZ6d0FEYJbaF4a-KsBhdIHlMZg04-wQYUSZgnks/edit?usp=sharing&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you want to fully play along, please bring a laptop with the following installed and setup:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;VirtualBox 5.x (5.2.28 is latest supported). You CANNOT use VirtualBox 6 due to some unknown incompatibility.&lt;/li&gt;
&lt;li&gt;VirtualBox Extension pack for version you installed (&lt;a href="https://download.virtualbox.org/virtualbox/5.2.28/Oracle_VM_VirtualBox_Extension_Pack-5.2.28.vbox-extpack"&gt;direct link&lt;/a&gt; to 5.2.28, does not depend on the host OS).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I will be (hopefully) posting a VirtualBox image once one is fully updated.&lt;/p&gt;</description></item><item><title>USB Inrush Testing</title><link>https://colinoflynn.com/2015/03/usb-inrush-testing/</link><pubDate>Mon, 02 Mar 2015 23:51:31 +0000</pubDate><guid>https://colinoflynn.com/2015/03/usb-inrush-testing/</guid><description>&lt;p&gt;The USB spec has limits on the &amp;lsquo;inrush current&amp;rsquo;, which is designed to prevent you from having 2000uF of capacitance that must be suddenly charged when your board is plugged into the USB port.
The limit works out to around &lt;a href="http://www.testusb.com/inrush_issue.htm"&gt;10uF of capacitance&lt;/a&gt; . Your board might have much much more - so you&amp;rsquo;ll have to switch portions of your board on later with FETs as a soft-start.
For the ChipWhisperer-Lite, I naturally switch the FPGA + analog circuitry as to meet the 2.5 mA suspend current. Thus I only have to ensure the 3.3V supply for the SAM3U2C meets the inrush limits, which is a fairly easy task. This blog post describes how I did this testing.
The official &lt;a href="http://www.usb.org/developers/docs/wireless_documents/USB-IFTestProc1_3.pdf"&gt;USB Test Specs&lt;/a&gt; for inrush current testing describe the use of the Tektronix TCP202 which is $2000, and I don&amp;rsquo;t think I&amp;rsquo;d use again a lot. Thus I&amp;rsquo;m describing my cheaper/easier method.
First, I used a &lt;a href="http://store.newae.com/differential-probe-assembled-tested/"&gt;differential probe&lt;/a&gt; (part of the ChipWhisperer project, so you can see schematics) to measure the current across a 0.22 ohm shunt resistor. The value was selected as I happened to have one around&amp;hellip; you might want a smaller value (0.1 ohm say) even, as the voltage drop across this will reduce the voltage to your device. The differential probe has enough gain to give your scope a fairly clean signal. This shows my test board, where the differential probe is plugged into a simple 2-pin header:
&lt;a href="https://colinoflynn.com/wp-content/uploads/2015/03/P1080537.jpg"&gt;&lt;img src="https://colinoflynn.com/wp-content/uploads/2015/03/P1080537.jpg" alt="P1080537"&gt;&lt;/a&gt;
From the bottom, you can see where I cut the USB shield to bring the +5V line through the shunt:
&lt;a href="https://colinoflynn.com/wp-content/uploads/2015/03/P1080538.jpg"&gt;&lt;img src="https://colinoflynn.com/wp-content/uploads/2015/03/P1080538.jpg" alt="P1080538"&gt;&lt;/a&gt;
To calibrate the shunt + gain from the diff-probe, I just used some test loads, where I measure the current flowing through them with a DMM. You can then figure out the equation for converting the scope measurement to a current in amps.
&lt;a href="https://colinoflynn.com/wp-content/uploads/2015/03/P1080539.jpg"&gt;&lt;img src="https://colinoflynn.com/wp-content/uploads/2015/03/P1080539.jpg" alt="P1080539"&gt;&lt;/a&gt;
Finally, we plug in our actual board. Here I&amp;rsquo;ve plugged in the ChipWhisperer-Lite prototype. The following figure shows the measurement after I&amp;rsquo;ve used a math channel in PicoScope to convert the voltage to a current measurement, and I&amp;rsquo;ve annotated where some of these spikes come from:&lt;a href="https://colinoflynn.com/wp-content/uploads/2015/03/usb_power.png"&gt;&lt;img src="https://colinoflynn.com/wp-content/uploads/2015/03/usb_power.png" alt="usb_power"&gt;&lt;/a&gt;
Saving the data, we can run through the &lt;a href="http://www.usb.org/developers/tools/usb20_tools/USBET20_1_20_00_Installer.zip"&gt;USB Electrical Analysis Tool 2.0&lt;/a&gt; to get a test result. The USB-IF tool assumes your scope saves the files with time in seconds and current in amps. The PicoScope .csv files have time in miliseconds, so you need to import the file into Excel, divide the column by 1000, and save the file again. Finally you should get something like this:
&lt;a href="https://colinoflynn.com/wp-content/uploads/2015/03/compliance_results.png"&gt;&lt;img src="https://colinoflynn.com/wp-content/uploads/2015/03/compliance_results.png" alt="compliance_results"&gt;&lt;/a&gt;
Note the inrush charge is &amp;gt; 50mC, but there is an automatic waiver for anything &amp;lt; 150 mC. While the system would be OK due to the waiver, I would prefer to avoid exceeding the 50 mC limit. In this case there&amp;rsquo;s an easy solution - I can delay the USB enumeration slightly from processor power-on, which limits the inrush to only the charging of the capacitors (which is done by ~15mS). This results in about 47 mC. This means I&amp;rsquo;ve got about 100 mC of headroom before I exceed the official limits!
This extra headroom is needed in case of differences due to my use of the shunt for example.
In addition, I should be adjusting the soft-start FET gate resistor to reduce the size of that huge soft-start spike. Ideally the capacitor charging shouldn&amp;rsquo;t draw more than the 500mA I claim when I enumerate, so that&amp;rsquo;s a little out of spec as-is! If I don&amp;rsquo;t want to change hardware I could consider using PWM on the FET gate even&amp;hellip;&lt;/p&gt;</description></item><item><title>Design a FIR Filter in an FPGA in 30 mins using High Level Synthesis</title><link>https://colinoflynn.com/2013/01/design-a-fir-filter-in-an-fpga-in-30-mins-using-high-level-synthesis/</link><pubDate>Sat, 26 Jan 2013 18:25:00 +0000</pubDate><guid>https://colinoflynn.com/2013/01/design-a-fir-filter-in-an-fpga-in-30-mins-using-high-level-synthesis/</guid><description>&lt;p&gt;&lt;img src="https://colinoflynn.com/oldsite/tiki-download_file.php?fileId=58&amp;amp;display&amp;amp;scale=0.6" alt="Image"&gt;
I&amp;rsquo;ve been working with Xilinx&amp;rsquo;s new High Level Synthesis tools built into Vivado. I&amp;rsquo;m slowly working on posting some more complete tutorials. In the mean-time &lt;a href="https://colinoflynn.com/oldsite/tiki-index.php?page=XilinxHLS" title="XilinxHLS"&gt;here&lt;/a&gt; is a simple tutorial about making &lt;a href="https://colinoflynn.com/oldsite/tiki-index.php?page=XilinxHLS" title="XilinxHLS"&gt;a Finite Impulse Response Filter&lt;/a&gt; on a real ADC/DAC board .&lt;/p&gt;</description></item><item><title>Getting started with GIT Revision Control</title><link>https://colinoflynn.com/2012/08/getting-started-with-git-revision-control-2/</link><pubDate>Fri, 10 Aug 2012 12:16:00 +0000</pubDate><guid>https://colinoflynn.com/2012/08/getting-started-with-git-revision-control-2/</guid><description>&lt;p&gt;Revision Control is the most critical part of any project involving files. Otherwise you end up with tons of directories, and naming schemes like "report_final2_june.docx" along with 20 other copies.&lt;/p&gt;
&lt;p&gt;This is best described in this 20-min clip. Sorry it's a little long, but there is a fair amount to cover:&lt;/p&gt;
&lt;div class="embed embed--video"&gt;&lt;iframe src="https://www.youtube-nocookie.com/embed/cFbCusX9bKs" title="YouTube video" loading="lazy" allowfullscreen frameborder="0"&gt;&lt;/iframe&gt;&lt;/div&gt;
You can download the slide set:
&lt;a class="wiki" href="https://colinoflynn.com/oldsite/tiki-download_file.php?fileId=33" rel=""&gt;Slide Set&lt;/a&gt;
For your reading pleasure, here are the highlights. I've linked to the exact moments of interest in the video rather than retype stuff I describe in the video.
&lt;h1 id="What_is_GIT" class="showhide_heading"&gt;What is GIT&lt;/h1&gt;
Git is a revision control manager. Briefly, it lets you see how things changed and track those changes. Even better, it lets you do tasks like create a "branch" of the source code. You can switch back and forth between branches to deal with issues like wanting to rewrite sections of the code, while still being able to get back to the last good 'release' copy.
&lt;a class="wiki" href="www.youtube.com/watch?v=cFbCusX9bKs&amp;amp;hd=1&amp;amp;t=7m15s" rel=""&gt;Show Me Branching&lt;/a&gt;
&lt;h1 id="Getting_stated_on_Your_Computer" class="showhide_heading"&gt;Getting stated on Your Computer&lt;/h1&gt;
You can use GIT on any folder! It's dead simple to do, and handy even if you will never commit things to the web. Doing so requires a few steps:
&lt;ol&gt;
	&lt;li&gt;Create a repository locally &lt;a class="wiki external" href="http://www.youtube.com/watch?v=cFbCusX9bKs&amp;amp;hd=1&amp;amp;t=2m10s" target="_blank" rel="external nofollow noopener"&gt;Show Me&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;Commit initial file&lt;a class="wiki external" href="http://www.youtube.com/watch?v=cFbCusX9bKs&amp;amp;hd=1&amp;amp;t=3m45s" target="_blank" rel="external nofollow noopener"&gt;Show Me&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;Commit changes &lt;a class="wiki external" href="http://www.youtube.com/watch?v=cFbCusX9bKs&amp;amp;hd=1&amp;amp;t=5m18s" target="_blank" rel="external nofollow noopener"&gt;Show Me&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;Do other stuff (branching, merging, etc) &lt;a class="wiki external" href="http://www.youtube.com/watch?v=cFbCusX9bKs&amp;amp;hd=1&amp;amp;t=7m1s" target="_blank" rel="external nofollow noopener"&gt;Show Me&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 id="Using_Real_Repositories" class="showhide_heading"&gt;Using Real Repositories&lt;/h1&gt;
To use real remote repositories, you need a server to host them. I recommend assembla.com or bitbucket.org . bitbucket.org provides more storage, more users for free, and unlimited project sizes for university-based projects. Both are pretty cheap for commercial projects.
&lt;p&gt;You want to configure a SSH key. Doing so requires four steps:&lt;br /&gt;
&lt;ol&gt;&lt;br /&gt;
	&lt;li&gt;Generate the key &lt;a class="wiki external" href="http://www.youtube.com/watch?v=cFbCusX9bKs&amp;amp;hd=1&amp;amp;t=12m17s" target="_blank" rel="external nofollow noopener"&gt;Show Me&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Set the key up on assembla/bitbucket &lt;a class="wiki external" href="http://www.youtube.com/watch?v=cFbCusX9bKs&amp;amp;hd=1&amp;amp;t=13m09s" target="_blank" rel="external nofollow noopener"&gt;Show Me&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Set the key up on git &lt;a class="wiki external" href="http://www.youtube.com/watch?v=cFbCusX9bKs&amp;amp;hd=1&amp;amp;t=14m27s" target="_blank" rel="external nofollow noopener"&gt;Show Me&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;Set the key up to always be loaded &lt;a class="wiki external" href="http://www.youtube.com/watch?v=cFbCusX9bKs&amp;amp;hd=1&amp;amp;t=16m15s" target="_blank" rel="external nofollow noopener"&gt;Show Me&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;
&lt;/ol&gt;&lt;/p&gt;</description></item><item><title>Avnet Spartan-6 LX9 Board: Or How ChipScope is your Saviour</title><link>https://colinoflynn.com/2012/02/avnet-spartan-6-lx9-board-or-how-chipscope-is-your-saviour/</link><pubDate>Sat, 11 Feb 2012 15:24:00 +0000</pubDate><guid>https://colinoflynn.com/2012/02/avnet-spartan-6-lx9-board-or-how-chipscope-is-your-saviour/</guid><description>&lt;p&gt;I was recently working on a project which needed more gates than I had in my trusty current FPGA Board (Spartan3-200 on DLP-FPGA-HS). I quickly found the Avnet Spartan 6 LX9 board (AES-S6MB-LX9-G), which I could buy for $90 and have here in a few days. It also comes with a license for SDK for ChipScope, as it&amp;rsquo;s designed for experimenting with on-FPGA processors. It doesn&amp;rsquo;t have a full EDK license so you are a little limited in peripherals&amp;hellip;
But for my project I didn&amp;rsquo;t care about that. I was however interested in ChipScope Pro, having used it previously at a job. This quick post will show you how valuable it can be - the license included with the LX9 board is &amp;ldquo;device locked&amp;rdquo; and will only work with XA6SLX9 parts. ChipScope Pro is not normally licensed as part of WebPack so the $90 board is a great deal when you consider the licensing cost.
My normal FPGA debugging, beyond Verilog testbenching, is to use a LogicPort on some spare IO lines. This works well - the LogicPort has a very high sampling rate (200MHz external, 500MHz internal). But it requires a physical connection, which requires a lot of IO pins. I was hoping ChipScope could eliminate this problem.
There is two cores of interest: the Integrated Logic Analyser (ILA) core, and the Virtual IO (VIO) core. They are both controlled by the Integrated Controller (ICON) core. You can only have one ICON, but it can control up to a number of ILA/VIO cores.
The VIO core gives you a virtual dashboard, where you can toggle bits and see results. This is pretty handy for validating/playing with cores to check they function as intended. Here I am checking a UART core from fpga4fun.com:
&lt;img src="https://colinoflynn.com/oldsite/tiki-download_file.php?fileId=22&amp;amp;display&amp;amp;x=120&amp;amp;y=43" alt="ChipScope Pro VIO"&gt;
Note the VIO core doesn&amp;rsquo;t provide buffering, so data is transferred over the JTAG. This limits your polling speed of course, but makes it easy to play with things. It does let you define pulse trains or single pulses if you have special timing requirements on e.g.: load lines, as I had here.
The ILA core is strictly input. But it connects to BRAMs on-board the device, meaning you can buffer a fair amount of data. Since it&amp;rsquo;s all on-device the speed is basically limited by similar constraints to the rest of your design. Of course if you already have a packed chip you might not be able to spare any BRAMs&amp;hellip;
Here I am debugging a state machine, note you how can even define &amp;rsquo;tokens&amp;rsquo; so it decodes the states correctly:
&lt;img src="https://colinoflynn.com/oldsite/tiki-download_file.php?fileId=23&amp;amp;display&amp;amp;x=120&amp;amp;y=51" alt="ChipScope Pro ILA"&gt;
 
So the combination of ChipScope ILA + VIO I&amp;rsquo;m hoping will make designs go by a lot faster.&lt;/p&gt;</description></item><item><title>Turbo Coding Tutorial</title><link>https://colinoflynn.com/2011/11/turbo-coding-tutorial/</link><pubDate>Mon, 07 Nov 2011 15:08:00 +0000</pubDate><guid>https://colinoflynn.com/2011/11/turbo-coding-tutorial/</guid><description>&lt;p&gt;I&amp;rsquo;ve added a page on &lt;a href="https://colinoflynn.com/oldsite/tiki-index.php?page=Turbo" title="Turbo"&gt;Turbo Coding&lt;/a&gt;, a subject I&amp;rsquo;m researching for a class at Dal. This includes a large presentation, links to reference material, and lots of MATLAB code based on &lt;a href="http://code.google.com/p/iscml/"&gt;CML&lt;/a&gt;. It&amp;rsquo;s still being updated but maybe you&amp;rsquo;ll find it useful/interesting as well.&lt;/p&gt;</description></item><item><title>LPCXpresso LPC1114 J4 JTAG Pinout</title><link>https://colinoflynn.com/2011/10/lpcxpresso-lpc1114-j4-jtag-pinout/</link><pubDate>Tue, 18 Oct 2011 01:26:00 +0000</pubDate><guid>https://colinoflynn.com/2011/10/lpcxpresso-lpc1114-j4-jtag-pinout/</guid><description>&lt;p&gt;I recently got an LPCXpresso board, which you can cut and make into a debugger. I wanted to use the 0.1&amp;quot; header (J4) and not the specified JTAG (2x10 0.5&amp;quot;) header. Here is how I cut my board such it can be plugged back together: the female header is just half an IC socket:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://colinoflynn.com/oldsite/tiki-download_file.php?fileId=12&amp;amp;display" alt="LPCXpresso Cut in half"&gt;&lt;/p&gt;
&lt;p&gt;Counting pin 1 at the top of the board (near J49), the pinout is:&lt;/p&gt;</description></item><item><title>Interfacing to 34401A</title><link>https://colinoflynn.com/2011/10/interfacing-to-34401a/</link><pubDate>Sun, 09 Oct 2011 20:14:00 +0000</pubDate><guid>https://colinoflynn.com/2011/10/interfacing-to-34401a/</guid><description>&lt;p&gt;I recently got my 34401A bench meter out of storage, and wanted it working with my computer, something I hadn&amp;rsquo;t done for several years. I forgot to get my &amp;lsquo;official&amp;rsquo; Agilent connection cable, but figured I could use my standard cables no problem.&lt;/p&gt;
&lt;p&gt;This took a bit of effort to actually get working, so here is my notes on the issue:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The required settings are 9600 Baud, 1 Start Bit, 2 Stop Bits, Hardware flow control. Hyperterminal never seemed to work, possibly because the 34401A uses full RTS/CTS + DTR/DSR flow control. I did however have success with the &amp;lsquo;Termite&amp;rsquo; program with the following settings: &lt;img src="https://colinoflynn.com/oldsite/tiki-download_file.php?fileId=11&amp;amp;display" alt="Image"&gt;&lt;/li&gt;
&lt;li&gt;Send the &lt;strong&gt;SYSTem:REMote&lt;/strong&gt; command first, you should see a little &amp;lsquo;RMT&amp;rsquo; appear on the 34401A VFD front panel. This indicates comms are working. Try a &lt;strong&gt;READ?&lt;/strong&gt; command too; As an example see the following, blue is what I&amp;rsquo;ve sent and green is the meter responding: &lt;img src="https://colinoflynn.com/oldsite/tiki-download_file.php?fileId=10&amp;amp;display" alt="Image"&gt;&lt;/li&gt;
&lt;li&gt;I first tried a small null-modem adapter + RS232 extension cable. You need to ensure your cable has all lines connected, since the 34401A uses full flow control. My null-modem adapter didn&amp;rsquo;t have lines 1 &amp;amp; 9 connected straight-through, as the 34401A manual says it should be. I figured it wouldn&amp;rsquo;t matter since it doesn&amp;rsquo;t claim to use them, and the rest of the lines were connected as required, but the meter didn&amp;rsquo;t respond to any commands. Using a null-modem cable which had line 9 connected straight-through, but not 1, seemed to work fine. So the hardware can be an issue!&lt;/li&gt;
&lt;li&gt;So far the Excel/Word Plug-In hasn&amp;rsquo;t worked for me. I know it did at one point, so still working on that, but I might end up just using Python or something instead anyway.&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;</description></item><item><title>Making AT90USBKEY Run on 5V (Easy Way)</title><link>https://colinoflynn.com/2011/08/making-at90usbkey-run-on-5v-easy-way/</link><pubDate>Sat, 20 Aug 2011 14:01:00 +0000</pubDate><guid>https://colinoflynn.com/2011/08/making-at90usbkey-run-on-5v-easy-way/</guid><description>&lt;p&gt;I needed to use my AT90USBKEY at higher than 3.3V for ADC input purposes. It&amp;rsquo;s not documented in the manual, but the schematic shows they anticipated this. You can easily convert the AT90USBKEY to run on 5V with a few changes. The changes needed are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Remove resistor R20 (0-ohm resistor)&lt;/li&gt;
&lt;li&gt;Remove resistor R16 (0-ohm resistor)&lt;/li&gt;
&lt;li&gt;Place a 0-ohm resistor on pads at R21 (move R16 or R20)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&amp;rsquo;s it! The DataFLASH chip&amp;rsquo;s VCC needs to be in the 2.5-3.6V range, but with those changes it is &lt;em&gt;still powered by the 3.3V regulator&lt;/em&gt;. Thus you don&amp;rsquo;t need to remove the DataFLASH chips. The DataFLASH devices have 5V tolerant I/O, so even though your MCU is running at 5V, it won&amp;rsquo;t fry the DataFLASH. Note the logic high levels of the DataFLASH may not be sufficient to actually work with the MCU, since it&amp;rsquo;s logic high will only be using 3.3V logic.&lt;/p&gt;</description></item></channel></rss>