In SX Microcontrollers, SX/B Compiler and SX-Key Tool, robotworkshop wrote: Well, i've done a bit more digging and gone over the SX48 datasheet and found a couple more things. It appears that from the datasheet that the register (17h) T1CNTA bit 0 controls if an Interrupt is generated from the TIMER1. It also mentions that the program should clear this bit to DISABLE OVERFLOW interrupts from occurring. That would lead me to believe that the default is set to 1 which would mean that it would generate an Interrupt in TIMER mode if an overflow occurs. Can someone confirm this? I suspect this is correct. So, I pulled opened up the assembly code for my program and went over all the code generated for working with TIMER1. It appears that it is always working with the T1CNTB register or the capture registers. I did a search through all the code for a $17 and not once did I find that it tried setting the T1CNTA register. Assuming that is the case and the default setting is bit 0 is on then as soon as I specified TIMER 1 TIMER the program would start generating extra Interrupts which would then in turn trash the incoming Serial data that is based on ISR code..... I had used the TIMER1 TIMER as a way to shut off TIMER1 PWM mode. This is something that needed to be done since it is controlling the speed of a motor and there are many times for wanting to turn off the motor. So, at the moment I am looking at alternative ways to shut down a TIMER until I need it again. An alternative may be to try and add some inline assembly at the beginning of the program to set the option register for TIMER1 to clear out bit 0. Since nothing else in the program sets it that should work and prevent the timer from generating undesired interrupts. Unless I am way off here I think that adding something like this at the start of my program might work: ' Code to disable Interrupts on TIMER1 (assumes wrkVar in current BANK) ASM MOV W,#$07 MOV M,W MOV !RB,W AND W,#$FE MOV wrkVar,W MOV W,#$17 MOV M,W MOV W,wrkVar MOV !RB,W ENDASM If all this works then perhaps some notes can be added to the next SX/B help file about this (or maybe Jon's new book) Robert ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=251534#m251716 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)