In SX Microcontrollers, SX/B Compiler and SX-Key Tool, jdemeyer wrote: I am using the 2x16 Parallax display which has a serial interface. It accepts ASCII characters for display and for control. So, the SendByte subroutine (repeated here) provides for sending a byte to the LCD. [code] SendByte: temp1 = __PARAM1 ' save the byte IF __PARAMCNT = 2 THEN ' "count" specified? temp2 = __PARAM2 ' yes, save ELSE temp2 = 1 ' no, set to 1 ENDIF DO WHILE temp2 > 0 SEROUT DISPLAYComPort, DisplayBaud, temp1 ' transmit DEC temp2 LOOP RETURN [/code] DISPLAYComPort can be any I/O port; mine is [code] DISPLAYComPort VAR RE.7 [/code] DisplayBaud is T19200. The output of the DS1302 is binary coded decimal. This is pretty easy to convert as described by Sparks-R-Fun, and implemented in an attachment of one of my posts. My previous attachment would probably have to have the SendBytes subroutine above included in order to fully operate (my code that I am using now has not changed since my original post). In the previous attachment: SetTimeAndDate Fill the array named TimeDate before calling this. It places the information in TimeDate into the DS1302. GetTimeAndData Retrieves the complete time and date from the DS1302 and places it into the TimeDate array. ToggleBatteryBackUp The provides for turning the charging circuit off and on. For the following subroutines, I recommend setting the cursor to the far left so that the display accomodates the information. WriteTimeToDisplay This writes the hour and minute to the display. WriteDateToDisplay This writes the date to the display. WriteDayToDisplay This writes the day of the week to the display. WriteDataToDisplay This is a single subroutine that provide for sending information to the display. The information is delivered in arguments. So, to display the date and time might go something like [code] 'set up TimeDate array SetTimeAndDate DO GetTimeAndDate IF TimeDate(Secs) <> temp1 THEN WriteTimeToDisplay WriteDateToDisplay ENDIF temp1=TimeDate(Secs) LOOP [/code] Does this help? Let me know. Joe ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=159072#m181249 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)