Thursday, August 9, 2012

Wise Clock 4 - Status update

It's been a slow (and hot, temperature-wise) summer, spent mostly answering customer (and other Arduino fellows asking for help) emails, with almost no notable achievements.
  • Improved the design of the Wise Clock 4+ board by adding support for the JY-MCU bluetooth module connected as shown in the next photo (and controlled using the SoftwareSerial library on pins D20 and D21).

  • Created the software framework for a Scheduler (subject of a future post); this should support features like multiple alarms, job activation at given times etc.
  • Beside his great contribution to the code, MikeM found a fix for the SoftwareSerial bug on ATmega1284P (D20 and D21 did not work because JTAG is enabled); he also sent this photo of his stack of Wise Clock 4s with dual 5mm LED displays.

  • Added to my to-do list:
    • Android app to remote-control Wise Clock 4;
    • remote sensors to start and stop the chronometer function of the clock (request from Javier);
    • join a WiFi network in a user-friendly, easy-to-configure, manner;
    • automatic adjustment of the display brightness with an LDR, as suggested by Adam, who already hacked his Wise Clock 4, as shown below.



I also got a bit upset with Sure Electronics for the (mechanical) change on their latest revision of the 3216 LED display: the vertical distance between the holes is about 3mm greater. I thought I would have to give away the small stock of laser-cut plates I had, since they would not fit anymore. Turns out that there is a non-wasteful solution though: enlarge the holes with a small file (which I do myself to all displays, until I finish the old stock of plexiglass plates).

As always, any comments, suggestions and contributions are appreciated.

18 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. I haven't setup a forum yet. (Actually I have never setup any forum.)

      Delete
  2. Is it possible to provide a ready-to-run binary image for the latest WISECLOCK4?

    ReplyDelete
  3. The processor in the kit comes programmed with the latest software, you don't need to upload any sketch or burn any hex file.
    Are you sure you really want to burn the hex file? You will need a programmer. You will overwrite the bootloader. Once you do that, I cannot offer any help.

    ReplyDelete
  4. I have a wiseclock4. Then what is the purpose of the FTDI connector?

    ReplyDelete
    Replies
    1. Oh, I see what you mean. You want to upload the hex files from the IDE, without the compilation phase. I've never done that, so I cannot help, but I can provide the hex file. The question then is, can you manage on your own if something goes wrong with that upload?

      Delete
    2. Ted, you can find the hex file here:
      http://code.google.com/p/wiseclock2/downloads/detail?name=TheClock644_20120811.hex&can=2&q=
      It is generated for ATmega644P.

      As I said, you are on your own on this one.

      Delete
  5. well, if I could figure out how to load the sketch. maybe my problem is I need to copy all the source code files into a specific folder, where the IDE can see them.

    ReplyDelete
    Replies
    1. Do you have any experience with Arduino? I wouldn't start playing around with the WC4 board. The WC4 software is pretty complex, the set up for Sanguino core files requires a bit of tweaking. Overall, it's a pretty steep learning curve.

      Delete
  6. As for uploading the HEX to the wiseclock4, do you think this might work? http://xloader.russemotto.com

    ReplyDelete
    Replies
    1. This looks good but I would try it first on an Arduino, with any sketch/hex. In the worst case, you damage the bootloader.

      Delete
  7. Hi Florin,

    Is the code for the Dual Time display that you show in the top picture in the right column (under the search box) available?

    Thanks,

    Kenny

    ReplyDelete
  8. Yes. Part of the latest release. This is displayed if you select UTC menu option.

    ReplyDelete
  9. Hi Florin,

    trying to compile WC4 with 2displays and Arduino1.0.1, using http://ryanmsutton.com/2012/09/sanguino-for-arduino-1-0-release
    The code compiles with a lot of warnings...
    The clock is beeping every hour, but nothing is on the display. The #DEBUG Switch ist not very helpful...

    Thanks

    Konrad

    ReplyDelete
    Replies
    1. Konrad,
      Use the sanguino core files in this sip file:
      http://code.google.com/p/wiseclock2/downloads/detail?name=sanguino_10.zip&can=2&q=#makechanges

      For 2 displays, you need to modify this line in file HT1632.h:
      #define NUM_DISPLAYS 1

      Also, modify the file WiseClockVer.h to reflect the version of Wise Clock you have (either 3 or 4).
      Please let me know how it goes.

      Delete
    2. Ok, I took these core file and it goes:
      In file included from /Volumes/lokal/Users/skr/Google Drive/Arduino/hardware/sanguino/cores/arduino/Arduino.h:212,
      from /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:43:
      /Volumes/lokal/Users/skr/Google Drive/Arduino/hardware/sanguino/variants/standard/pins_arduino.h:48:1: warning: "TIMER5A" redefined
      In file included from /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:43:
      /Volumes/lokal/Users/skr/Google Drive/Arduino/hardware/sanguino/cores/arduino/Arduino.h:181:1: warning: this is the location of the previous definition
      In file included from /Volumes/lokal/Users/skr/Google Drive/Arduino/hardware/sanguino/cores/arduino/Arduino.h:212,
      from /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:43:
      /Volumes/lokal/Users/skr/Google Drive/Arduino/hardware/sanguino/variants/standard/pins_arduino.h:49:1: warning: "TIMER5B" redefined
      In file included from /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:43:
      /Volumes/lokal/Users/skr/Google Drive/Arduino/hardware/sanguino/cores/arduino/Arduino.h:182:1: warning: this is the location of the previous definition
      In file included from /Volumes/lokal/Users/skr/Google Drive/Arduino/hardware/sanguino/cores/arduino/Arduino.h:212,
      from /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:43:
      /Volumes/lokal/Users/skr/Google Drive/Arduino/hardware/sanguino/variants/standard/pins_arduino.h:50:1: warning: "TIMER5C" redefined
      In file included from /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:43:
      /Volumes/lokal/Users/skr/Google Drive/Arduino/hardware/sanguino/cores/arduino/Arduino.h:183:1: warning: this is the location of the previous definition
      /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:59: warning: only initialized variables can be placed into program memory area
      /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)':
      /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:396: error: 'digitalPinToPCICR' was not declared in this scope
      /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:398: error: 'digitalPinToPCICRbit' was not declared in this scope
      /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:399: error: 'digitalPinToPCMSK' was not declared in this scope
      /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:399: error: 'digitalPinToPCMSKbit' was not declared in this scope
      /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp: In member function 'void SoftwareSerial::end()':
      /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:414: error: 'digitalPinToPCMSK' was not declared in this scope
      /Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/SoftwareSerial/SoftwareSerial.cpp:415: error: 'digitalPinToPCMSKbit' was not declared in this scope

      Delete
    3. Good. Now add these lines to pin_arduino.h:


      #define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 31) ? (&PCICR) : ((uint8_t *)0))
      #define digitalPinToPCICRbit(p) (((p) <= 7) ? 1 : (((p) <= 15) ? 3 : (((p) <= 23) ? 2 : (((p) <= 31) ? 3 : 0))))
      #define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK1) : (((p) <= 15) ? (&PCMSK3) : (((p) <= 23) ? (&PCMSK2) : (((p) <= 31) ? (&PCMSK0) :((uint8_t *)0)))))
      #define digitalPinToPCMSKbit(p) ((((p)<= 7) ? (p) : (((p) <= 15) ? ((p) - 8) : (((p) <= 23) ? ((p) - 16) : (((p) <= 31) ? ((p) - 24) : 0 )))))

      Delete
    4. Sorry, same as above, only beeps every hour...
      and sometimes garbage on the display.
      I will investigate later.

      Delete