Shop OBEX P1 Docs P2 Docs Learn Events
DS1302 Real Time Clock with SX Video module display modification — Parallax Forums

DS1302 Real Time Clock with SX Video module display modification

T&E EngineerT&E Engineer Posts: 1,396
edited 2010-03-17 00:01 in Robotics
I am new to the BS2 Stamp and SX Video Module. I just received them last week and wanted to get to work to come up with a good use for the SX Video Module. I also bought a DS1302 Real Time Clock (RTC) and 32.768 KHz crystal. However, the leads were very small so I soldered it to pins 2 and 3 of the DS1302 for strength.

I have attached BS2 code originally taken from Parallax website http://www.parallax.com/dl/docs/books/sw/exp/sw30.pdf·.

I modified it very easily to display the RTC information on a video display (or TV with video / audio inputs). This is accomplished by adding a Parallax / Hitt Consulting SX Video module. I couldn't believe how easy it was to do the modification as the original BS2 code used DEBUG commands which overlayed well with the SX video module. I am giving Parallax credit for the original coding and wanted to take credit in modifing it for the SX video module.

I didn't add audio to it but it would not be hard (although I would not know what to add to a Video Clock).

Let me know what you think. I have a 6" portable LCD screen used for the cellphone screen shot and also took a picture of the Board of Education (rev C) used in the project. I bought a BOE-BOT and mainly using the board for experiments.

I thought the idea was pretty cool and got it written in a couple of hours after a weekend of learning how the SX video module programming works. Very nice!

Comments or sugestions appreciated.

====================================
I have reduced the variable usage in the second program

Disregard the original program.
====================================



Timothy Gilmoreturn.gif


Post Edited (tdg8934) : 10/25/2005 1:22:24 AM GMT
«1

Comments

  • BeanBean Posts: 8,129
    edited 2005-10-11 01:57
    Very nice Timothy...
    You said you were looking for something for the audio output...How about chimes at the hour (or quarter hour)...Or an alarm to go off at a certain time...
    Thanks for the nice words about the video module.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available now... SX-Video OSD module $59.95 www.sxvm.com

    "Save your money. Pay with cash."
    ·
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-11 02:24
    Great idea. I will work on·Audio Chimes·next.

    I will also modify the BS2 code to allow for a CR2032 (3vdc) battery as seen from Chris Savage's circuit Binary Digital Clock Schematic.

    The problem is that this BS2 code is automatically set for 06:00:00 AM when turned on by Vdd from the Board of Education. I have to figure out how to change it so that if it also has a 3 vdc (or less than 5 vdc as taken by Vdd) battery, it will keep the current time if Vdd is removed.

    Ideas anyone. If not I will look it over tomorrow.

    Thanks to everyone!
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-13 00:52
    I have been working late and haven't had a lot of time to work on my project. However, attached you will find an audio 3 tone (simple but effective - and you can modify it to how you want it). It goes off every hour.

    I will try to work on how to modify the code to allow for a 3v watch battery source on the DS1302 to keep it's time in a power outtage.

    I will also work on setting an alarm for it with a time associated - on my things to do.

    I really enjoy my new BS2 board and SX video module!· I love programming it and adding hardware in coming up with neat ideas. Thanks Parallax and Hit Consulting.


    Post Edited (tdg8934) : 10/13/2005 12:56:40 AM GMT
  • mmmm Posts: 56
    edited 2005-10-14 17:58
    Anyone have any links to a inexpensive NTSC compatible LCD display for the sx vid module. All the ones I have found are in the triple digit dollar range. I'm looking for something around 2 to 4 inches to experiment with and eventually replace a 4 X 20 line LCD with. Color would be nice.


    Mike
  • ForrestForrest Posts: 1,341
    edited 2005-10-14 23:11
    NTSC 4 inch LCD for $47.90 here www.geeks.com/details.asp?invtid=PCM-4&cat=MON

    If you're having trouble with the link, then just go to www.geeks.com and click on the Monitors category (left side of the screen).

    Post Edited (Forrest) : 10/15/2005 1:41:29 AM GMT
  • mmmm Posts: 56
    edited 2005-10-15 00:06
    Paul,

    Thanks,
    I came up with those 3 that you sent and yes they were right at 100 with shipping out west.
    Now the last one that forrest sent didn't come up for me. It looks to be just what I'm after.

    thanks everyone.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-15 00:47
    I used a 6" LCD screen (video/audio·jacks)·that is detachable from a car DVD player I picked up at Toys-R-Us a few months ago. It works well for my video clock along with any TV as well.

    I don't think the screen is sold anymore but it is made by a company called INTEC (www.intec.com).
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-25 01:18
    I have taken Chris Savage's·advice (from another post) (modified his DS1302 program to add SX video module usage) and reduced the variable size (and fixed a couple of minor bugs I didn't see). It is now more efficient and has more variable space.

    Original program (first post listing)
    Ram Map
    INS:
    :
    REG7:
    + 1 Nibble

    New Program (posted here)
    Ram Map
    INS:
    :
    REG5:
    + 2 bits

    I will take this modified program and try to reduce space in·a modified·ISD25120 program I will write (originally written for Nuts and Volts #66 by Jon Williams) to combine them and create a "talking video clock".

    Thanks to Chris, Jon and Bean for their help!
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-28 16:42
    I was able to sort of able to get the ISD25120 to talk with the SX Video module RTC DS1302 clock. It is along ways from being complete but at least I can get both functions to happen - sort of.

    Are·there any Interupts on the BS2?

    When I display the video clock time it want's to be in a closed loop to get constant updates of the time from the DS1302 RTC. However, if I go to another routine to let's say access the ISD25120 speech, the clock stops and I hear some feedback or noise in the speaker. It's definately harder than I imagined to combine speech with the SX video module clock.

    I was thinking of possibly having it run in assembly language but that would mean I would have to so with an SX-28 or something to have interupt support to speak out the current time. I'm just thinking there are too many things going on in hardware/software for BASIC to keep up.

    Ideas...Comments?confused.gif
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-30 19:32
    The addition of speech in this project is coming along well now. I have a couple of pictures taken with my camera phone (not great but you can get the idea).

    I use the SX Video module for display and audio chime as well as to utilize some of the outputs (to save on BS2 outputs for what is meant to either be HIGH or LOW). Thanks to Jon Williams in helping me with the out.0-7 (individual access). I posted a program that demonstrates this.

    Next there is (under the wires) a 74HC595 to take over A0-A7 on the ISD25120 (2 min speech chip) - frees up 5 I/O lines (8-3 control lines) on the BS2. See the nice gap.

    As a mater of fact, unused I/O is P4, P5, P6, P7, P12, P15 but I may use one or two more before this project is done. If it wasn't for the 74HC595 and SX Video module outputs, I would have run out of I/O lines on the BS2.

    Next is the microphone electronics section feeding into the ISD25120 (2 minute speech chip) of which I think I am using only 1 minute or so - so an ISD2560 may work as well.

    Finally the last section is the LM386 audio amplifier IC and components. I had a hard time on the web trying to find a design showing how·the LM386 and the ISD25xxx series are connected. Most circuits did not work at all or had limited capability. I came up with my own design as a variance of something I saw on the web and an application in the LM386 datasheet.

    The software is about 80% complete now and I work on it when I can so it may be finished by next week. We'll see.

    The small pushbutton on the BS2 board is used to record numbers and words in the pre-programming aspect. More later on this... It is also used to play back the current time with your own recorded voice.

    Oh..yea. Another critical flaw I saw was the layout of the LM386 audio amplifier being near the DS1302 RTC IC. Keep them as far away as possible. I did have them next to eachother and I was getting a motorboat effect in the speaker at 1 Hz intervals. Noise was getting induced into the speaker creating an annoying ticking every second. I have moved the LM386 to the far end of the breadboard and it is silent now with no trace of the induced noise. Also make sure you use plenty of 0.1 uf caps at each of the IC's between Vcc and Gnd.

    Enjoy. roll.gif

    Comments....

    Timothy Gilmore
    640 x 480 - 45K
    640 x 480 - 52K
  • BeanBean Posts: 8,129
    edited 2005-10-30 19:52
    Tim,
    I like it... I like it alot... (think Jim Carey from Pet Detective).

    Someone [noparse][[/noparse]I won't mention the company, but I'm sure you've heard of it [noparse];)[/noparse] ] has me completely wiped-out of SX overlay modules, but as soon as I build some more, one is on it's way to you.

    Send me a private message with your address.
    P.S. I have an ad in that issue of N&V on page 77.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available now... SX-Video OSD module $59.95 www.sxvm.com

    Life is NOT a box of chocolates.
    Life is a journey, and 99% of the time you get where your headed.



    Post Edited (Bean (Hitt Consulting)) : 10/30/2005 7:56:06 PM GMT
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-10-30 21:17
    Bean,

    Check your PM.

    Tim
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-02 12:56
    I ran into an unforseen problem last night when coding in the logic for the speech chip. I ran out of EEPROM space. Luckily I have a 24LC32 which I beleive will add 4K bytes of additional EEPROM to the internal 2 K bytes on the BS2. I believe there is plenty of examples on how to simulate I2C transfering to the 24LC32. It just means I will need to learn how this works first and unfortunately will add a little more to the project cost - for anyone wanting do this project in the future.

    This project was fairly simple when it was just a DS1302 with a few components and the SX video module and of course the BS2 Stamp. However, adding speech capability meant the addition of an ISD 25120 chip + components, 74HC595 chip, LM386 chip + components and now a 24LC32 for more EEPROM space. I'm still surprised I haven't run out of variable space yet which is a good thing.

    More to come later this week or this weekend.

    Timothy Gilmore
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2005-11-02 16:31
    It may be late in the game, but with an EMIC you could have simplified life some what for the speech.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-02 16:38
    Ryan,

    You a probably right but as stated in an earlier message, the EMIC board is superior but far more expensive than the ISD25120 and component sets. I will probably still use the EMIC in a future design as it does have many advantages.

    Thanks for the input.

    Timothy Gilmore
  • BeanBean Posts: 8,129
    edited 2005-11-02 17:24
    Tim,
    I just mailed your overlay module.
    You should get it in a couple days.
    Enjoy...

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available now... SX-Video OSD module $59.95 www.sxvm.com

    Life is NOT a box of chocolates.
    Life is a journey, and 99% of the time you get where your headed.

    ·
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-02 17:27
    Bean, Your the best!

    Thanks so much.

    Now you have me at a disadvantage to finish this cool project. No problem. I don't give up easily.

    If possible, I will write code for·use with either·video module.

    Timothy Gilmore
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-11-02 17:59
    Tim,

    ·· Keep in mind that often there are many ways to optimize code and data to use space more efficiently.· It is truly a rare thing for an experienced Stamp Programmer to run out of space when doing something well within the capabilities of the BASIC Stamp.· It's really a matter of perspective I suppose, but you will become more adpet at it.· If you want to send the code you have I will take a look at it and see if I can offer some suggestions.· If it's something you aren't ready to post, you can always e-mail it to me directly.· Good luck!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-02 18:19
    Chris,

    Check your email.

    Thanks,

    Timothy Gilmore
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-04 18:28
    Bean,

    My wife just called and said the OSD module just came.

    I will have something to play around with this weekend!

    Thanks so much. I also plan on working over the weekend to try and get this project working - pending no other unforseen issues.

    Thanks again,

    Timothy Gilmore
  • BeanBean Posts: 8,129
    edited 2005-11-04 21:47
    Tim,
    I look forward to seeing it.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available now... SX-Video OSD module $59.95 www.sxvm.com

    Those that would give up freedom for security will have neither.
    ·
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-07 12:43
    It's almost ready.

    -- Talking Video Clock --

    I worked on it over the weekend and fixed all software bugs I was able to find and test under all conditions. It's runing well. As Jon Williams once·eluded·to,·the ISD25120 (2 minute speech chip) doesn't have great audio quality as compared to the ISD2560 (1 minute speech chip). However, I beleive it is still very acceptable for this type of a project and I am happy with the results for the most part. Remember, the user will have to record their own voice into mini speech recordings (ie one, two, three,....Good Morning...Sunday...AM..PM..hours..).

    What I have to do next is to draw out the schematic. Does anyone recommend a free electrical / electronic schematic drawing program to turn this out quickly? I may need to use VISIO at work if I can't find anything else suitable, but I would rather use what I can from home. For the time being I will work on hand drawing out a schematic and scanning it into·a PDF or something.

    One issue I had last night was trying to develop a way to set default clock values (ie. hrs, mins, day...) and I ran out of EEPROM space creating a DEBUGIN type approach. I was tired of fighting that battle and then went with the approach of adding more switches. I later decided it was more trouble than what it was worth in added expense, programming efforts. What I ended up with is a section of the program that the user can manually manipute (with comments) showing what values to make them. It is pretty straight forward with minimal effort.

    I want to thank the Pioneers in original code that I used pieces of in the end creation of this product being Jon Williams for his ISD25xx research and software and Chris Savage for his research and software on the DS1302. I added my own "Glue-ware" to make it all work together with the SX video module from Hitt Consulting / Parallax. A special thanks goes out to Bean for his encouragement and support (like Jon and Chris) in completing this project. Thanks also goes to Parallax for the BS2 stamp and BOE. I bought a BOE-BOT a little over a month ago and with no knowledge of this stamp, and came out with a fully functioning BS2 project that's·pretty cool and fun to develop. yeah.gif

    More later....

    Timothy Gilmore
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-11-07 15:39
    Tim,

    ·· To address to things in your message...One, as for setting the time, there's no·crime in just creating a small stand-alone program to set the time on the clock and then load the actual program.· I have done this before.· In this type of application (Escpecially if the clock is battery-backed) there's no need to have to keep setting the clock anyway, so it's a small inconvenience at best.

    ·· As for schematics, if you take a look at the one I posted called, "Binary Digital Clock" I created that schematic using a hand-built library of parts in a single BMP file.· I open two instances of Paint and copy the parts in and draw lines between them.· While the library isn't complete by any means, or perfect, I can post it if you like.· It may help you, it may not.· =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-07 15:46
    Chris,

    I had forgotten about the battery back up aspect. I will have to look into this. I tried it once and could not get it to work quite right. Comments? Thanks.

    I like the idea for a separate program to set the clock and another one to·set initial voice recordings.

    If you would post what you have on the BMP Paint aspect of creating parts. That would be very helpfull.

    Thanks,

    Timothy Gilmore
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-11-07 16:44
    Tim,

    ·· As for battery backup you shouldn't need to set anything up.· Simply connecting a battery to ground and pin 8 of the DS1302 should protect it from power-loss.· I have used 3V Coin Cell batteries (CR2032) as well as 2 AA batteries in a holder.· Here is the current file I am using for circuit schematics...AS-IS!· LOL

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • BeanBean Posts: 8,129
    edited 2005-11-07 16:54
    Tim,
    · A free schematic package is from www.expresspcb.com I think that Jon uses it.
    · I haven't gotten the hang of it, but I haven't given it a good chance yet either.
    · I use autocad to do my schematics and layouts.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available now... SX-Video OSD module $59.95 www.sxvm.com

    Those that would give up freedom for security will have neither.
    ·
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-07 17:09
    Thanks Guys!
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-08 05:59
    The project is now ready!

    I used the schematic capture program from www.expresspcb.com as recommended from BEAN and it was great and easy to use.

    If anyone wants to build this cool conversation piece and has any questions ask.

    It is a 'Talking Video Clock' as described in previous posts.

    Let me know what you think.

    Thanks,

    Timothy Gilmore

    (Not bad for a first BS2 project).

    hop.gifhop.gifhop.gifhop.gifhop.gif
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2005-11-08 17:48
    There are some higher resolution photo's taken of the

    "Talking Video Clock" on www.sxvm.com
Sign In or Register to comment.