In SX Microcontrollers, SX/B Compiler and SX-Key Tool, jdemeyer wrote: T&E Engineer, I briefly looked through the code. I am attempting to focus on the program flow and not on the parts that perform the I/O. I see the INTERRUPT, the interrupt handler, the SEROUT command, and the Main loop. This combination should perform your intended task. It sounds like the combination to perform it correctly still needs tweaking. INTERRUPT Is the syntax for this correct? I was reviewing the help and could not find a match for what is written but I've never used it myself. Do you really want it to interrupt every millisecond? If so, the subroutines that communicate with the DS1302 may get interrupted. They are async but it's possible the interrupt is affecting the communication (I think there are minimum pulse width times to consider). Have you been able to set the program up to run without the interrupt? I'm not suggesting that you remove it entirely. I'm suggesting to remove it just to isolate it as a possible cause. How does the program run without it? COMMENTED OUT CODE I noticed that the GetTimeAndData call is commented out. Is this done purposefully? Also, the IF statement surrounding the code inside the Main loop is commented out as well. Without that, the code runs everytime through the loop? Is this your intent? STEPPING THROUGH Is it possible to step through the code after the second attempt to display the data and time? This may yield some clues. If so, I would inspect the values of the data and time. If they are zero, then something may be affecting the communication with the DS1302 as I suggested above. SEROUT Does SEROUT get called with every interrupt? If so, the command may not have enough time to complete the task before the next interrupt. When I have debugged through microcontroller code, I have had to comment out whole sections of code and add them back one at a time to help isolate the main issue. As you suggested, it seems odd that a SEROUT and LCD Display are required for an INTERRUPT. Indeed, if I understand what you are attempting, the LCD and the LED Matrix should be able to operate independently of one another. Joe ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=183734#m183747 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)