Category: Hack

Home CNC breadboard power adapter

One really nice thing about having a CNC to make PCBs at home is the ability to whip up a quick adapter board in one night. Tonight I needed two adapters for a 5.5mm barrel jack, one to go to wires and one that can plug into a breadboard. Eagle allows you to make a board without a schematic which is exactly what I needed, just draw some traces on copper and route it out on the CNC. I used 40-60 mil traces and slapped on random switches I had laying around and an LED with resistor. The boards came out to be about 1.75″x0.4″ and routed perfectly with a 0.8mm router bit. I uploaded a zip with the Eagle board files and G-Code for anyone else who wants them. – Eagle files and G-Code


Linux idle time one-liner

I regularly need to see how much time an embedded Linux box is spending idle, so I can determine what impact performance improvement fixes have on the system over time.  Since ‘w’ is pretty much useless I use the following one-liner to parse the /proc/uptime

awk '{print ($2*100)/$1 " % idle over "$1/60 " min"}' /proc/uptime

De-obfuscation of CSS

Here is a little command line fu I worked today, it seemed post worthy.

I found a site I wanted to emulate so I checked out the CSS file only to see a “obfuscated” version, missing new lines and spaces.  I whipped up this little sequence of sed commands to de-obfuscate the CSS.

cat site.css |sed “s|}|}\n|g”|sed “s|;|;\n|g”|sed “s|{|{\n|g”|sed “s|^\([^}]\)|  \1|g”|sed “s|^ *\([^{]*\){|\1{|g” > out.css

List each line of the CSS file, add a new line after all }, { and ; characters.  Add 2 spaces to all lines, then remove the spaces from lines that have a { at the end.  This results in some pretty readable code.

Install MPLABX and C30 on Linux Mint

I just upgraded from the cluster that is Ubuntu to Mint and tried to install MPLABX and the C30 compiler from Microchip.  The install went flawless on Ubuntu 11.10 however there was a problem running the .bin files on Mint, something about GTK themes or something.  There is an easy fix add “–mode xwindow” after the bin files

sudo ./ --mode xwindow
sudo ./ --mode xwindow

Installs just fine

Tesla Roadster Logs and Python

A few days ago I mentioned on my sustainable fuel site TheSmartDrive that I was given a Tesla Roadster to drive for a few days. I was asked to see what ECU information is available, collect and parse the data from it….enter python

Take a look at the full write up:

Esquire E-Ink code disassembled

Originally posted September 9th, 2008

I got the Esquire magazines today (2) and ripped one apart before even looking at the first page.  I have to say I’m a little  underwhelmed considering the E-Ink is only 2×5 inches and isn’t a matrix like I hoped :-(.  However that underwhelmedness lasted only a few minutes until I discovered the whole thing was controlled by a PIC16F629 and there are connections for an ICSP connector!

A little about the setup, like the post on the Make blog said there are two panels that change shapes and text black then white.  The top panel has 11 distinctly controllable cells with 4 blocks, 3 rectangles, “The 21st Century”, “Begins”, “Now”, and the space in between.  I read a little today on how eInk works and it doesn’t surprise me they made distinct blocks, an addressable matrix seems complicated.

Tonight after work I soldered some wires onto the controller and downloaded and disassembled the firmware.   I was a little surprised there was no Code Protection enabled. It’s all PIC asm so it’s going to take some time to decode/modify, however expect some different animation sequences.

Reading Esquire eInk controller

I’ve decided to not post the code since it is copyright to Hearst Media or the engineer who wrote it.  If you want to pull the firmware here’s how:

  • Get/borrow/make a ICSP programmer (parallel programmers will work, just lead out the Vdd,Vss,MCLR,CLK,DATA pins
  • Remove the battery since it is only 3v and most likely you will be using 5v
  • Hook up the programmer and read the HEX (Code protection is NOT enabled)
  • Disassemble the code using your software of choice (mine is PikDev and gpasm)

I uploaded a new album to the gallery with some photos, take a look:

If you have any questions leave a comment here, on or talk to me on EFNet #geeksinside

Esquire E-Ink cover

So I guess the Esquire E-Ink issues came out a little earlier than I thought! Who knew the October issue would be release like September 8th!

I’ve been waiting for these issues since they were announced a few months ago.  For those who don’t know Esquire magazine has put an E-Ink section in the cover of their October magazine,  some people have already opend the cover and went over the guts.  Looks like the whole thing is run using a PIC16F629!  I am going to go pick one (or two) up and see what I can do with it!

WordPress Themes