Ti eZ430-Chronos : First program changes and Fixing wireless upload.

One thing to keep in mind right away, this is NOT a watch designed to keep accurate time.  This is an embedded processor in a watch form factor.  it CAN function as a watch, but it's not going to be as accurate as a $25.00 Sieko or Timex.  So remove all thoughts that it is a watch in the traditional sense out of your head.   That said, I'm calling it a watch for simplicity.

let's start  by hacking the project to make a small change.   Using the miChronos project I pointed at in the getting started.   Open that up and head into the logic folder.   we are going to change the display for date from the stock "Dayname 2 letter" and day of the month number.   To  MM-DD

This will be an easy change, but it teaches you a wierdness of this watch.  TI decided that left to right for a display is far to easy to deal with.  They made the display Right to left.  top line is L1 and has 4 characters numbered  3210  and the bottom line is L2 with characters numbered 43210..  nice of them to mix things up for us!   In the logic folder you will find the date.c  open that and scroll to the bottom.

void display_date(u8 update)

    if (update == DISPLAY_LINE_UPDATE_FULL)
        if (sDate.display == DISPLAY_DEFAULT_VIEW)
            // Convert day of week to string
            display_chars(LCD_SEG_L2_4_2, int_to_array(sDate.month, 2, 0), SEG_ON);
            display_char(LCD_SEG_L2_2, '-', SEG_ON);

            // Convert day to string
            display_chars(LCD_SEG_L2_1_0, int_to_array(sDate.day, 2, 0), SEG_ON);
            // Convert moon day to string
            display_chars(LCD_SEG_L2_1_0, int_to_array(get_cycle(), 2, 0), SEG_ON);
    else if (update == DISPLAY_LINE_CLEAR)
        // Show day and month on display when coming around next time
        sDate.display = DISPLAY_DEFAULT_VIEW;

The bold lines are what we changed.  instead of calling the  get_day() function. we are instead going to display the number kept inside sDate.month struct.  but we need a seperator, so add a line using the display_char function.

Now you can compile and upload.   The watch as default from TI seems to have a broken program in it.  So remove it from the case and plug it into the debugger USB dongle with the battery removed.  Now plug it in and run the debugger to compile and load.  This will do an initial load for you over the USB dongle.  Exit the debugger and unplug and reassemble your watch.

Now you can do a wireless upload with a working program in the watch.    After compiling with the hammer icon you will find the compiled ready to upload file at C:/Users/user/workspace_v5_3/ez430_chronos/915MHz - Limited CCS Core Edition/ez430_chronos_915MHz.txt

Replace user with your username on your computer.

congratulations!  you modified, compiled and uploaded your first project.  And fixed a problem with the watch by blowing out the stock broken program.


Popular Posts