In SX Microcontrollers, SX/B Compiler and SX-Key Tool, sounddezign wrote: We are launching a new product that uses SX28 micros and have encountered an undocumented feature of the SX that has been causing problems for the last week. I am using the rtcc to count the number of instructions through pieces of code of different lengths so that it can be used to calculate how many more clocks are required to complete a set delay. The number of clocks to enter into the section of code is deterministic, so I set the rtcc to the value I want (mov rtcc,#7). I then let it run through the code before it comes to check the value of rtcc to see how much delay is left (mov w,rtcc). I have found that the rtcc stops counting after the "mov rtcc,#7" instruction. It will then recommence counting again after 4 instructions. The code below shows where rtcc will read an incremented value. I just output the value to ra and rb to view the pins value. [code] mov w,#7 mov rtcc,w ;move rtcc with cycles since op0 was set (1) nop ;rtcc = 7 here nop ;rtcc = 7 here nop ;rtcc = 7 here nop ;rtcc = 7 here mov w,rtcc ;rtcc = 8 here (started counting again) mov isr_temp,w mov ra,isr_temp swap isr_temp mov m,#$0f mov !rb,#$f0 mov rb,isr_temp jmp $-1[/code] Any help or information as to why this occurs would be greatly appreciated. We need to understand the functionality of the SX28 fully for our time critical application. Cheers, Andy ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=261659 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)