help with sx project
I am currently trying to·build a digital clock·incorporating the sx28 microcontroller. I have to write assembly code to set the time·and keep the time moving·and to set an alarm on the clock. The clock also·needs to display the time of the day on a standard text LCD. If anyones ever done a design like this or can offer any advice on any part of the assembly code it would be greatly appreciated.
Thanks·
Thanks·
Comments
http://www.parallax.com/sx/downloads.asp
A few weeks ago, I chose an alarm clock to be my first SX project.· I wanted to use LEDs so I can see the display at a greater distance though.· You can look at the attached file to see how I set the time (including seconds), alarm time and still keep time and update my display.· I have 4 buttons (Time, Alarm, Hours, Minutes) and 1 switch (Alarm Set).
I am multiplexing 6 seven segment LEDs with 2 74HC595 shift registers, one for the digits, and the other for the digit position.· I rotated the LED in positions 3 and 5 so I could use the decimal as the upper half of my colons between hours/minutes and minutes/seconds.· I am using the internal RTCC rollover to keep time (I gain 3 or 4 seconds per day).· The next phase in this project is to incorporate a DS1302 real time clock to get more accurate time.
I hope that some of the code will help you.
RWC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Russell Crow
Project Manager
Cohesive Automation Inc.
Post Edited (Russ61) : 1/16/2005 6:15:57 PM GMT
in my SX book, I describe a digital SX 28 alarm clock driving 7-segment LED displays. Porting the code to drive an LCD display should be doable. At least, it shows how to keep track of the time, and how to handle the alarm time.
You can download the book sample codes from the Parallax site: http://www.parallax.com/dl/src/prod/sx/SrcCodeExamples.zip
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
I downloaded your code examples from the link you gave me and studied all the files but was unable to find the clock example.
I'd greatly appreciate it if you could tell me which one of the files has the clock example code as I seem to be overlooking it.
Thanks
Derm
What a cool idea!!!
The neat thing about public forums is that everybody has a different way of tackling the same problems.
Jim
sorry, I have copied the wrong link with my last post. Please download the ZIP file at www.parallax.com/dl/src/prod/sx/ProgSXEdPre.zip. In this ZIP file, you will find App016.src which is the clock example.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
I have my design nearly completed now and have a lot of the code working. Just one thing, I've used and rewrote some of the code I got and wrote some of my own. I am having problems trying to incorporate my code for the LCD with the code I modified from Guenther's example and the code I wrote myself. My code is now starting to get very complicated.·I have been doing a bit of study on sx/B and it seems to be a lot less complicated than the sx assembly language especially with projects similiar to the alarm clock.
I have looked over the code that Russell sent me on a few weeks ago and the code in the on-line sx/B examples but am still finding it difficult to write sx/B code to interface the LCD to the board.·If anyone could offer any advice it would be greatly appreciated.
Thanks
Derm
Bean.
Thanks for the help with the code. Just·one quick question. Wat pins did you use to connect up your buttons and switch. I've set up my LCD but i'm not sure about my design with the buttons and switch
Thanks
Derm
thanks again
Derm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
·
I used RA.0 for my “time set” button, RA.1 for my “alarm set” button, RA.2 for my “hours set” button, RA.3 for my “minutes set” button and RB.0 for my “alarm is set” switch.· Press and hold the “time set” button, then press the “hours set” or “minutes set” button to increment the hours and minutes.· The seconds are incremented by pressing and holding the “time set” button while pressing the “alarm set” button.· Pressing and holding the “alarm set” button and pressing the “hours set” or “minutes set” buttons set the alarm time.· I hope this helps.
·I am currently working on converting this to assembly and integrating a 1pps signal from an atomic clock movement.
Good Luck,
RWC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Russell Crow
Project Manager
Cohesive Automation Inc.
·
I wos just wondering if you did out any schematic diagram for your alarm clock example showing your choice of pin connections. I'm still having problems with my design and I don't think it's the LCD i'm using as opposed to LEDs as i'm able to write to the LCD. Any help would be greatly appreciated.
Thanks again
Derm
yes, there is a schematic in my book. Actually, for the alarm clock I use the basic schematic for a general 7-segment driver plus two additional pushbuttons. Both drawings are attached to this post.
I have copied the following text from my book which explains the various operation states, and the functions of the two pushbuttons.
I hope this information helps a bit.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
Günther
I know this post is more than a year old. However, here is a completed project using an SX28/48/52 protoboard and a DS1302 with an LCD.
http://forums.parallax.com/showthread.php?p=643780
Also here is another one using an SX48/52 with a DS1302 going to a 16x16·LED matrix for a scrolling time/date·display effect:
http://forums.parallax.com/showthread.php?p=643775