Playing with EZ430 chronos watch in OSX
I have Chronos watch from TI for a year now, and I’m using it as a watch, not
as a development platform.. :-D
Original battery lasted for more that a year, and three days ago, clock has rebooted and reseted! I tought that it was because of battery, but clock states that battery is at ~85%, and I tried with new battery anyway...
No luck, still reboots. So, I decided that is time to reprogram it! ;-)
Since I’m using OSX (10.9 currently), this guide will be targeted to it, but probably with small modifications, should work on linux.
I’m using MacPorts, so lets start first by installing msp430 toolchain, since this watch is based on msp430 micro controller.
sudo port install msp430-gcc msp430-libc msp430-gdb sudo port install makedepend
This will install GCC compiler, libc and gdb for msp430 target. Also, it will install, as dependency, msp430mcu (Device capabilites database for MSP430 toolchain), mspdebug (free debugger for use with MSP430 MCUs, pulled in by msp430-gdb) and msp430-binutils (FSF Binutils for msp430 cross development), and we need makedeped utility.
Also, you will need urwid module for python. But, since I’m using python 2.7 from macports, I needed to change PATH variable so that make config command use python2.7 and not one that came with OSX! If you are changing PATH like shown here, it will stay like that until you close terminal session, so you will need to change it like this every time your need macports python…
And now we can install needed python module
sudo port install py27-urwid
Once that’s finished, we need to clone openchronos-ng repository
cd /opt/local/src git clone git://git.code.sf.net/p/openchronos-ng/code openchronos-ng-code cd openchronos-ng-code
Now comes configure part, which on my OSX (10.9) didn’t work because of character encoding! :-S
After googling and experimenting for few hours (I don’t know anything in python, and I don’t like it), only one line needs to be added for config step to succeed, so we can get ncurses based config!
All we need to do is to add following line of text to tools/config.py file just below line 430
but be careful! there is a TAB before this line of text. If there is no TAB python will throw an error! So, last 6 lines should look like this:
if __name__ == "__main__": ->>>urwid.set_encoding("UTF-8") ->>>App = OpenChronosApp() ->>>App.load_config() ->>>App.main() ->>>App.save_config()
(‘->>>’ stands for single TAB space. usually this is not visible…)
Now we can continue to configuring our build of openchronos-ng!
So, just run
and you will see ncurses based config. Select what ever you like, BUT disable accelerometer, because that one doesn’t work yet (link), and then you can just type
and you are done!! Now, all is needed is to upload new program to watch! But that will be in next post...