In SX Microcontrollers, SX/B Compiler and SX-Key Tool, tdg8934 wrote: Joe, To answer your questions... The Interrupt and its correct syntax is part of the LED matrix function that turns on the LED's every millisecond. It originally was part of a CGoL program that JonnyMac wrote and helped me modify for my 16x16 LED matrix for scrolling messages. It is this scrolling message program and your DS1302 (originally sent to an LCD) that I combined to get the DS1302 time / date scrolled on the 16x16 LED matrix. What I noticed originally is that if I connected the LCD to the DS1302 modified program (with the Interrupt based 16x16 LED matrix scrolling program), I always had to comment out the Interrupt 1000 and Goto Interrupt lines of code. This would allow the LCD to display the Time and Date correctly on an LCD display. However, if you comment out the Interrupt calling code then the LED display would never turn on. So since the main idea of this program was to scroll the Time and Date on the LED matrix, then the Interrupt calling code is required. However, when trying to "slowly" start eliminating the DS1302 LCD functions (so that the LED matrix functions can work), I was able to get everything to work EXCEPT for the SEROUT routine which originally came from the SendByte subroutine. Since it doesn't really matter where the SEROUT command is (as long as it is after the Start: label), then the TimeDate( ) coding gets wiped out or changed if SEROUT is commented out OR if the Serial LCD is removed. What's even more strange is that the Serial LCD doesn't need full power (+5v, Ground and RX), TimeDate( ) will update correctly with a minimum of RX and either +5v AND / OR Ground attached. I don't understand this at all. You will also notice that the GetTimeAndData statement is commented out in the Main Loop as TimeDate( ) would also not update correctly. The IF THEN routine in the Main Loop is based on the GetTimeAndDate statement so if it is commented out then so would the IF THEN routine in the Main Loop too. However, if you look in the beginning of the StringWriter routine, you will see the GetTimeAndData there. It works well at this location. Don't ask me why. I have spent many nights testing many parts in the code to get it "working". Currently it does work well IF AND ONLY IF you have a SEROUT command somewheres after the START: Label AND you have a serial LCD connected with at least RX and either GND AND / OR +5v. Take one of these items out of the picture and TimeDate( ) does not get the correct updating. Also the SEROUT command doesn't really matter what is in the command (any defined pin will work - not tied to RA.3 and any legal Baudrate and even a 0 for the byte is ok)Weird! I can try stepping through the program and check the TimeDate( ) statements like Hrs or Secs in DEBUG. However, since it doesn't mater per say where the SEROUT command is, I think it is INTERRUPT related and may not provide much information. But I will look anyway to see what I can find. Therefore SEROUT is probably getting called with every INTERRUPT - but I don't know enough about INTERRUPTs to know for sure. Help for this weird occurance... [table height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0] [tr ][td class=msgThread2 vAlign=top height="100%"][/td][/tr][/table] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=183734#m183760 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)