SX Clock
I am a student in an electronics program and just beginning some work with the SX-28 Chip.· I have found quite a bit of literature on the Clock keeping capabilities of the SX Chip.· My interest is in building a Real-Time Clock with the SX-28 Chip.·
My desire is to use Digital Logic 7 segment drivers for each digit: 10's of hours through minutes.· However, I would like to build a seconds segment that is made up of LED's set up in 2 rows which will show the seconds and 10's of seconds in a Binary fashion.·
I NEED some help on how to program the SX chip to create a Binary output to each of the 7 segment display drivers.· (Values 1,2,4,8) These are the inputs to the 7 segment display drivers.·
This is the data which i have NOT been able to find!
Can anyone help?
·
My desire is to use Digital Logic 7 segment drivers for each digit: 10's of hours through minutes.· However, I would like to build a seconds segment that is made up of LED's set up in 2 rows which will show the seconds and 10's of seconds in a Binary fashion.·
I NEED some help on how to program the SX chip to create a Binary output to each of the 7 segment display drivers.· (Values 1,2,4,8) These are the inputs to the 7 segment display drivers.·
This is the data which i have NOT been able to find!
Can anyone help?
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
You probably will want to use some LED driver chip(s) for the display such as the MAX7219 or something similar.
Here are some of my projects with clocks that may give you ideas.
Uses obsolete SX52 but may be possible use an SX48 (also in Nuts and Volts - Jan 2009): http://forums.parallax.com/showthread.php?p=649643
6432 display (also may be in Nuts and Volts - April 2009): http://forums.parallax.com/showthread.php?p=739950
Basic Stamp 2 project: http://forums.parallax.com/showthread.php?p=553075
Basic Stamp 2 project: http://forums.parallax.com/showthread.php?p=734329
SX28 and an LCD: http://forums.parallax.com/showthread.php?p=643780
Just do a search on the forums for "clock" or "DS1302", etc.
You might be misdirected by some of the above posts...... with a little inginuity, you can very well create a complete real time clock with a multiplexed display from a single SX 28 chip.
No external driver chips of any sort are required.... just the SX, 4 Seven segment Digits, 8 leds for the 10 Seconds and Seconds, and 8 resistors. Depending on the brightness you desire, an additional 12 resistors may be required.
You would also want to include two momentary push buttons for setting the time. I use a dimming technique to indicate which digit is being adjusted for time, and the two buttons to Raise/Lower the time value for that digit. Pressing both buttons momentarily advances the adjustment to the next digit. When adjusting the time, the speed of the Raise/Lower interval even changes.
For stability, the oscillator source should be a standard crystal, probably in the 4 Mhz range.
I have created hundreds of multiplexed displays as well as discrete multiplexed LED drivers with just this approach, and the results have been excellent.
Cheers,
Peter (pjv)
if you have my book, you can find code for "pure" SX real-time clocks in the applications sample section. If not, please let me know, and I'll send you links to the sample code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
I have your book on order but it is going to be about another week before it comes in. If you could please send me the link to the sample code I would be able to start working on it sooner than that. Thank you.
ACE 227
Or because you need the day of week, day of month, month, and year as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
This is the link: www.parallax.com/Portals/0/Downloads/src/prod/sx/ProgSXEdPre.zip.
In the ZIP file, you will find the clock sample code in APP016.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
Also The SX\B language does not recognize () and when they are taken out an error is given. It say that there is an invalid number of perameters in the line. Could you please help me to get around this bit code. Here is one piece of the code that I need to change:
theDig = theDig + 1 // 4
Thank you,
Ace 227
dig = dig + 1
dig = dig // 4
Re: frequency -- time to hit the SX/B help file where everything is spelled out (directives) for setting brownout, frequency, external clock/resonator settings, etc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
It does the same thing while generating less [noparse][[/noparse]Assembly] code.
Here's another trick that works with powers of two:
I use this one a lot -- again, when the divisor that you would have used with // is a power of 2 (2, 4, 8, 16, 32, 64, 128)