In SX Microcontrollers, SX/B Compiler and SX-Key Tool, cbmeeks wrote: Ok, according to Gunther's SXSim (awesome!!), the "Delay Code Generator" at SXList is not accurate!!!! At least with my tests. For example, on the breezeway (for NTSC), you need 0.6µS. Well, I am still running at 80 Mhz so that should be 48 clocks. Now, subtract two for the "mov rb, #5" command gives you 46 clocks. Well, even though I put 46 clocks into the code generator, it was doing 48!!! Just about every one of them over about 20 clocks had 2 extra!!!! So, I have been running my code in the SXSim and setting breakpoints and literally watching/counting clocks to make sure all is accurate after I adjusted for the error. Now, below is a sub-routine I am using that should setup the beginning of a scanline (10.9µS). I have ran this through SXSim and it says 872 clocks exactly! So, could someone point out if this is wrong? If not, I assume I am correct. hehe Thanks! [code] ;=============================================================================================== ; LINESETUP ; ; returns in exactly 872 clocks 10.9µS @ 80Mhz ; The 872 clocks includes the call and the return (6 clocks) ; Some of the call/return is taken from the back porch and one clock is taken from the ; Sync Tip because it was returning with 873 clocks :-/ ;=============================================================================================== LineSetup ;-- Front Porch 1.5µS --------------------------------------------------------------- mov rb, #( 5 ) ;(2) BLACK mov w, #$1D mov d1, w frontporch_0: decsz d1 jmp frontporch_0 nop nop ;-- Sync Tip 4.7µS --------------------------------------------------------------- mov rb, #( 0 ) ;(2) Sync mov w, #$5D mov d1, w synctip_0: decsz d1 jmp synctip_0 nop ; nop ;removed to make entire subroutine EXACTLY 10.9µS ;-- Breezeway 0.6µS --------------------------------------------------------------- mov rb, #( 5 ) ;(2) BLACK mov w, #$0B mov d1, w breezeway_0: decsz d1 jmp breezeway_0 nop nop ;-- Color Burst 2.5µS --------------------------------------------------------------- mov rb, #( 5 ) ;(2) BLACK mov w, #$31 mov d1, w colorburst_0: decsz d1 jmp colorburst_0 jmp $+1 ;-- Back Porch 1.6µS --------------------------------------------------------------- mov rb, #( 5 ) ;(2) BLACK mov w, #$1E mov d1, w backporch_0: decsz d1 jmp backporch_0 ret ;(3 + 3 = 6) [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)