Saturday, 28 April 2012

MIT 6.002x Midterm

Just completed the MIT6.002x Midterm exam with no mistakes. Good times.

MIT6.002x Midterm Celebration
MIT 6.002x Circuits and Electronics info

Good luck to those yet to complete it and/or putting it off.

Friday, 27 April 2012

Two Modelsim Tips You Should Know

Analogue Waveforms

Modelsim can display a signal in your VHDL/Verilog design as an analogue signal. One use for this is when you want to visualise the output of a digital to analogue converter to see if you have synthesised the waveform as you intended. To do this you can right-click on the signal name in the Wave window and select it's properties. Switch to the Format tab and select 'Analogue'. You can optionally set a maximum value for the signal so that Modelsim can stretch your waveform to fit the height of the row. For example, set it to 255 for an 8-bit DAC value.

Vi/Emacs Editor

You can tell Modelsim to use the key-bindings from your favourite editor (by which I mean Vi or Emacs). Do this by drilling down the Tools > Preferences > Text editor menus until you get to the option for switching from normal to Vi or Emacs key-bindings. The good news is it is slightly better than using normal mode. The bad news is, for Vi at least, many of the features are missing, probably because I'm used to using Vim. Search, file operations and the basic editing commands are all there, but it feels like an emulation rather than the real thing. My recommendation is to carry on using your favourite external editor by default and only use the Modelsim editor for minor changes.

Monday, 23 April 2012

Student Robotics 2012 was awesome

Saturday 14th and Sunday 15th of April saw the fifth annual Student Robotics competition. Thanks to the hard working 'Blue Shirts' the event was a great success! Every year the robots seem to get better and better and this year was no exception.

Here are some pictures of the SR2012 entrants which were stationary for long enough for me to photograph them! Not always a good quality in a robot!

The robot below belonged to my former secondary school, Bristol Grammar School. Unfortunately it was a bit pony. I'm sure next year they will be a force to be reckoned with:

'Aslam' was definitely the best dressed robot. Very well turned out.


ECS, Southampton
Student Robotics Website

Altium Designer Supplier Cost Rounding Error

Here's an annoying bug in Altium Designer Summer '09. Altium Designer allows you to link your schematic library components with a supplier's product inventory such as Digi-Key or Farnell. When you generate a BOM the supplier cost is retrieved from the supplier website and pumped into an Excel spreadsheet. Well that is the idea.

If you have components costing less than 1p and presumably 1 cent then they are rounded down to 0p. This is pretty unhelpful if you want to know the total BOM cost.

The workaround is to use the "Supplier Subtotal 1" field instead of "Supplier Unit Price 1" field and to set a Production Quantity of say 10, or 100 off. This forces Altium to multiply the unit cost by the quantity per board and by the production quantity before rounding! Typically this values is more than 1p and you can get an accurate per board BOM cost by dividing the sum of subtotals by the production quantity.

Of course, this is not perfect, since changing the production quantity can push you into a different supplier price bracket. I'm probably not the first person to find this bug, but because Altium developers keep their bug reporting system private I cannot be sure! I hope to log a bug report as soon as I'm granted a log in to Altium Live.

Hopefully this workaround will be useful to others struggling to calculate a BOM cost for their design.


Altium Wiki page for Live Supplier Links

Update: 27/4/2012

I've registered this as a bug on Altium's Bug Crunch site. You can follow the status here but only if you have an Altium Live account:

Friday, 13 April 2012

Example Sensible Clamz Configuration file

Stick this in your ~/.clamz/config file so that your music gets downloaded to a sensible place with sensible file names. Unfortunately an example config file isn't installed when you install clamz. I had to figure this out from the source code. This might save someone a few minutes of digging around in the future so I've posted it below:

#Sensible Config File for Clamz Amazon MP3 Downloader
#Modified by:
#Based on options.c from clamz source code

## Clamz configuration file

## Default format for output filenames.  This may contain any of
## the following variables:

##  ${title} ${creator} ${album} ${tracknum} ${album_artist}
##  ${genre} ${discnum} ${suffix} ${asin} ${album_asin}
##  ${amz_title} ${amz_creator} ${amz_asin} ${amz_genre}

## The name format may also contain slashes, if you'd like to
## categorize your files in subdirectories.
NameFormat       "${tracknum} - ${title}.${suffix}"
DirectoryFormat "${album_artist}/${album}/"

## Set to True to allow uppercase in filenames.
## False to convert to lowercase.
AllowUppercase   True

## Set to True to output UTF-8 filenames, False to output ASCII only,\n"
## UseLocale to check the system locale setting.
## Note: Using anything other than ASCII seems to be prone to falling over
## whenever the track name/artist has a hint of french
AllowUTF8        False

## The set of ASCII characters which are disallowed.  (Control
## characters and slashes are always disallowed.)
ForbidChars      "\"!\\\"$*:;<>?\\\\`|~\"

In the future, when you call clamz:
% clamz /tmp/Amazon0123456.amz
You're music will land in the current directory with the directory and file structure specified in the config file.