Calculating MSP430 BSL Checksum
Posted: February 11, 2013 Filed under: Hardware, Software | Tags: MSP430 Leave a comment »Texas Instruments has a quick little java tool for calculating the checksum of a MSP430 dataframe. Recently, I’ve been seeing some forum posts looking for information on how to calculate the checksum so I thought I would post my quick Python 3 function for others.
def checksum_bsl_frame(frame):
# http://docs.python.org/3.2/library/struct.html#format-characters
fmt = "<" + len(frame) // 2*"H"
words = struct.unpack(fmt, frame)
words_xored = 0;
for word in words:
words_xored ^= word
checksum = words_xored ^ 0xFFFF
return checksum.to_bytes(2, 'little')
Here, frame is a bytes or bytesarray object and checksum returns a bytes objects.
Remember, strings are strings in Python3 and bytes and bytearray are data in Python3. Of course, if you are running PySerial on Python3 then this is the format you will be using.
The above code could be simplified I’m sure but it’s nice to have endianness defined out and in the open.
When you want to “human” check the data frame there is an easy one liner way of printing a formatted output.
def print_bsl_frame(frame):
print(" ".join('{:02X}'.format(byte) for byte in frame))
Now, it’s easy to do things like…
password = bytearray.fromhex("80 10 24 24 00 00 00 00" + 32*" FF")
password.extend(checksum_bsl_frame(password))
print_bsl_frame(password)
The previous would print “80 10 24 24 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 5B CB” to the screen.
I hope this helps someone, it will help you more in a custom class definition.
Machine Mixing Cob for Barefoot Builder
Posted: July 7, 2012 Filed under: Getting Dirty | Tags: building, Cob, natural, Tennessee Leave a comment »
Christina Ott of Barefoot builder during her 2012 “Building with Cob Workshop” in Woodbury, Tennessee.
Christina Ott is a natural building consultant and owner/operator of Barefoot Builder, she also happens to be a very good friend of mine.
During the nice sun shining months of summer, Christina offers a number of natural building and permaculture related workshops. Christina hosts workshops at her home base outside Woodbury, Tennessee but she has also held workshops at various locations across the country.
During the summer of 2011, I had the unique opportunity of working with Christina on her “off grid” cob building workshop in Middle Tennessee. The workshop helped our friend Mati Karol, of the Daffodil Meadow Contemplation Center, grow his presence at the meadow.
This summer, Christina invited me back to work with her again as her tractor operator for her 2012 “building with cob” workshop at a different site in Middle Tennessee. As the tractor operator, I was responsible for machine mixing the ingredients for cob (sand, clay, water and straw) in large quantities and delivering it to the building site as opposed to the labor intensive, but educational, foot mixing method.
MSP-FET430UIF on Mac OS X
Posted: September 23, 2011 Filed under: Hardware 1 Comment »Using the MSP430 toolchain in Ubuntu 11.04 is very simple to set up but what about on Macintosh OS X? It turns out that the fink instructions on the MSPGCC wiki for Mac OS X are very good and work flawlessly, even easier than the Linux install. However, the MSP430 USB-Debug-Interface (MSP430UIF) didn’t work immediately, but here is the fix!
Read the rest of this entry »
Install MSP430 Toolchain In Minutes on Ubuntu 11.04
Posted: September 21, 2011 Filed under: Hardware 5 Comments »Installing the MSP430 GCC toolchain is very easy and quick these days if you are running Ubuntu 11.04 (Natty). Steer clear of all the MSP430 toolchain confusion, installing just eight binaries will have you building and debugging MSP430 code in minutes and not hours!
Bus Pirate, I2C, ChronoDot
Posted: September 18, 2011 Filed under: Hardware | Tags: Bus Pirate, I2C Leave a comment »Around the same time that I acquired a Bus Pirate I also acquired a ChronoDoh which is just the same as the traditional ChronoDot but the pins are soldered to the wrong side of the printed circuit board (PCB). This small error saved me 50-percent on the purchase cost. With my Bus Pirate and ChronoDot in hand I set out to learn how to use both. This document introduces using the Bus Pirate with I2C decices such as the ChronoDot’s DS3231 real time clock (RTC).
Dusting off a Bus Pirate v3a
Posted: September 18, 2011 Filed under: Hardware 1 Comment »Back in the fall/winter of 2009 I acquired a Bus Pirate from Dangerous Prototypes but I never did anything with it. Today I pulled it out of a container and performed a firmware upgrade.
EeeNote (EA-800) Init
Posted: February 17, 2011 Filed under: Uncategorized Leave a comment »There is something to this device that I personally believe makes it stick out, at least to me. I’ve been wanting a tablet without having to lug around another laptop for some time now.
Now, don’t get me wrong, I totally expect this device to be “rough.” I mean, just take a look at the screenshots of this thing running, it appears to be far from elegant at this time. But folks, I’m here for the ride.
I took several photos as I removed the packaging from the EeeNote, perhaps more will surface as time permits.



