Maintenance notice: These forum archives are read-only, and will be removed shortly. Please visit our forums at their new location, https://www.evilmadscientist.com/forums/.

Open pins on Alpha Clock Five

edited July 2012 in Clock Kits
Just wanted to see if I'm reading the schematic (pdf) right, are these pins open for possible use for hacks?

PC3-PC7, PA7, PD4, PB4

I assume so since they have solder spots on the board too.   Hoping to try experimenting with adding a WWVB receiver I ripped out of another old clock I had.

Love the clock :)

Comments

  • Yes to all of those-- and thanks!

    A few more points of interest, too:

    - PD7 is "designated" as a place for an extra LED, but is actually also available for hacking in any way that you like.  

    - PD0 and PD1 go to an extra serial interface (J5).  We plan to use this for serial data out, for daisy-chained displays, in the next firmware revision, but you're also welcome to repurpose those in any way that you see fit. :)

    - O10 - O15 can potentially be used to drive additional LED "segments," should that happen to come in handy.
  • Any idea when the new daisy-chain code will be available ? And will there be some new enclosure and kit for the slave displays?

    I'd like to have a clock which would also grab weather info from sources like this: 
    http://aviationweather.gov/adds/tafs/?station_ids=kslc&std_trans=standard&submit_taf=Get+TAFs and scroll that terse data such as:
    KSLC 062337Z 0700/0806 34010KT P6SM FEW100 SCT150 
    FM070400 15006KT P6SM SKC
    FM071900 34009KT P6SM FEW100
    You can see the longest string here is 9 characters, but that might not be the longest possible (not sure what is; have to think about that).
    There are some interesting dot matrix ways to do this but there are things I like about these 16-seg displays. Might have to do one each way...
    Thanks

    Bruce
  • Revised firmware is one of our active projects right now; likely will be complete within the next few weeks. 

    We do not currently have a plan for a new case design (except for a few minor updates).  For daisy-chained use, if you don't need the buttons, we'd suggest mounting the displays with angle brackets to a horizontal surface-- you can fit an arbitrarily large number next to each other.
  • Can any of these PINs do PWM?  

    I'm thinking to make a "sunrise clock" from the alphaclock basic kit, using:
     - a larger PSU, 
     - a buckpuck, 
     - and a 40W LED.

    I'd like to PWM dim the LED.
  • There are two available PWM pins specifically for driving LEDs. One is the standard nightlight, D2, on OC2B. You can use the "nightlight" function to dim it-- see the "sleep" nightlight mode for an example of how to do this.

    The second one is D1, on OC2A. There's normally no LED here, so if you want to add a signal to drive a big LED, this is a good place to do it. Or, put it at location D2, so you can use the nightlight code directly.
  • edited November 2013
    Dr WHO, I'm trying to make D1 act just like D2, but I'm having trouble. I added OCR2A = Brightness; to a5nightLight and pin 20 is still the only one with nightlight-related activity.

    Then I found TCCR2A = (_BV(WGM20) | _BV(COM2B1)) and added TCCR2B = (_BV(WGM20) | _BV(COM2B1)), although I don't fully understand what that does. Still nothing on pin 21.

    Can you suggest something else to try?
  • LED D2 is controlled by pin PD6/OC2B.  LED D1 is controlled by pin PD7/OC2A.

    The definitions and functions of TCCR2A and TCCR2B are given in the ATmega644's datasheet.  

    The default code to configure those two registers is as folows: 

     TCCR2A = (_BV(WGM20) | _BV(COM2B1)); // PWM, phase correct, top: FF, overflow at bottom 
     // Drive output OC2B (nightlight) with value OCR2B 

     TCCR2B = (_BV(CS20)); // System clock w/o prescaler.
    // so overflow happens at 16 MHz/2*256 = 31.250 kHz

    I would suggest *not* changing the clock source bits of TCCR2B, as those select the clock source used by the PWM subsystem, not which outputs are enabled.

    If you do look at the datasheet, it will tell you what the different bits actually do.

    In TCCR2A, the enabled bits are WGM20 and COM2B1.   
    * WGM20 being enabled (Without WGM21 or WGM22) sets the mode of the timer to "Phase correct PWM."   You don't need to change that.   
    * COM2B1 (without COM2B0) is a command to set Clear OC2B on Compare Match when up-counting, and set OC2B on Compare Match when down-counting.  This is what actually hooks the timer to the output pin. 

    For a proper analogy, we should set OC2A to behave the same way, by enabling bit COM2A1, as follows: 

    TCCR2A = (_BV(WGM20) | _BV(COM2B1) | _BV (COM2A1)); 

    Why don't you give that a try, and see how it does.
  • That's it! Thanks for the explanation.
Sign In or Register to comment.