Shop OBEX P1 Docs P2 Docs Learn Events
1307 data to 7 Seg Display — Parallax Forums

1307 data to 7 Seg Display

Hello,
Thanks to this forum, I have created a digital clock using the 1307 RTC with spin. My results (Time) is going to the serial terminal. I would like the time to be displayed to 4 seven segment displays (common anode). Any ideas would be appreciated. Thanks, Curtis

Comments

  • Well, first you need to be able to control the display. You will be time-multiplexing: enable the cathodes (segments) for one digit and drive the corresponding anode, repeat for the other three digits, forever. Plan to spend one cog on that. (If you had a common-cathode display you could use a MAX7219 but that's another story). You will need some sort of beefy driver to supply anode current (I have used Mitsubishi M54564). You can probably get by driving the cathodes right off Prop pins (with current limiting resistors); I prefer constant current drivers such as TI TLC5916 (can control brightness nicely).
    Then you will need to convert the binary (BCD, actually) time to segments. I would use LOOKUP if I was doing it in Spin. But long before you do that, you need to get your display working.
  • JonnyMacJonnyMac Posts: 8,929
    edited 2015-10-09 17:33
    You can use this simple method to extract a nibble from any value (byte, word, or long)
    pub get_nib(value, nib)
    
      return (value >> (nib << 2)) & %1111
    

    The DS1307 registers are BCD, so you can use this to extract the 1s and 10s digit from each register. That can be as an index into a table of segments that correspond to the value.
  • Thanks to everyone who replied. I was successful in making a digital clock with temperature using the propeller, 1307 RTC, backpack 4-segment display, and a DS1820 one-wire temperature sensor. I will post everything. This is a project for my engineering students. They want to use a common anode large (6") seven segment display to make a large digital clock. I bought 4 (6") seven segment displays (https://www.sparkfun.com/products/8530) and wired them using 12v to power them and the switching was done by a TIP31 transistor. It works as far as lighting each segment. I also made a colon for the time. I am having a hard time trying duplicate the backpack segment driver (http://www.adafruit.com/products/8780). I tried to get common cathode, but couldn't find them that size. Please help my students and I. Thank you!
    Curtis
  • Wow, that's a big display! Looks like maximum of 40 mA per segment (2 diodes in parallel at 20 mA each). To multiplex, you would need to be able to source almost half an amp.

    I would be inclined to tie the anodes direct to +12V and control the cathodes with a constant current driver like Texas Instruments TLC5916 (four pieces, one for each digit). One nice thing about the 5916 is you can program the current (and thus the intensity).
Sign In or Register to comment.