Searching \ for '[SX] Can someone prove me wrong on thisF?=' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/ubicom/devices.htm?key=sx
Search entire site for: 'Can someone prove me wrong on thisF?='.

Exact match. Not showing close matches.
PICList Thread
'[SX] Can someone prove me wrong on thisF?='
2005\12\02@204703 by cbmeeksn/a

flavicon
face
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!



;===============================================================================================
;        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)

---------- 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)

2005\12\03@044443 by beann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

When I need to count cycles in code. I put the code cycles on each instruction line.

; -- Color Burst 2.5uS
 MOV rb,#5       ' 2
 MOV W, #$31   ' 1
 MOV d1, W       ' 1
 DJNZ d1, $       ' 2/4  (4*48 + 2 = 194)
 JMP $+1           ' 3
So this routine looks like 201 cycles. so thats 2.5125 uSec @ 80MHz
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99181
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)

2005\12\03@132526 by g_daubachn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote:

cbmeeks,
I tried to make SXSim count clock cycles as accurate as possible. Nevertheless, another user made me aware of a problem concerning the increment of the RTCC in SXSim. This will be fixed in the next version. Nevertheless, I can't guarantee that there still are situations where SXSim does not exactly count the clock cycles. Seems as if I got some more work to do making SXSim simulate the SX-internal instruction pipeline exactly as it is.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99235
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)

2005\12\03@161329 by cbmeeksn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, cbmeeks wrote:

[Quoting: "Guenther Daubach"]cbmeeks,
I tried to make SXSim count clock cycles as accurate as possible. Nevertheless, another user made me aware of a problem concerning the increment of the RTCC in SXSim. This will be fixed in the next version. Nevertheless, I can't guarantee that there still are situations where SXSim does not exactly count the clock cycles. Seems as if I got some more work to do making SXSim simulate the SX-internal instruction pipeline exactly as it is.

Günther,
I think you have it really accurate.  In my NTSC code, I was getting waving and when I started counting the clocks in your SXSim, I noticed I was off.  So, I made corrections and the waving went away!  Plus, I'm not using the RTCC at the moment.

You did good work.  :-)
I guess one thing I need to do is create a 118 cycle routing on the delay code generator and actually cound all the clocks myself to see how close the SXSim is.

I'm just being picky but when it comes to NTSC and color, accuracy is king.

cbmeeks
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99257
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)

2005\12\04@061935 by g_daubachn/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, g_daubach wrote:

cbmeeks,
would be great if you could count the clocks by yourself and then compare it to SXSim's results. Should there be any difference, please let me know, and send the code you've been testing. Maybe this helps me to fix any remaining timing bugs in SXSim.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99288
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)

2005\12\06@164500 by James Newtonn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, James Newton wrote:

I assume you are using:

http://www.piclist.com/cgi-bin/delay.exe?Delay=46&Type=cycles&Regs=d1+d2+d3+d4&clock=80&name=Delay&CPU=SX



; Delay = 46 instruction cycles
; Clock frequency = 80 MHz
; Actual delay = 5.75e-007 seconds = 46 cycles
; Error = 0 %
d1 DS 1
;46 cycles
   mov w, #$0C
   mov d1, w
Delay_0:
   decsz d1
   jmp Delay_0


The mov's take a cycle each. jmp takes 3 cycles in turbo mode. decsz takes 1 cycle if the condition is false and 2 if it is true. My old SX-Key manual actually says 3, but the current datasheet says 2 and that makes a lot more sense.

So, the mov's take 2 cycles. The first 11 times through the loop, decsz takes 1 and jmp takes 3 so 4 times 11 = 44 for a total of 46 so far. On the 12th cycle, the result is zero and decsz takes 2 cycles to skip out for a total of 48 cycles.


I believe you are correct, the delay generator doesn't take into account the final 2 cycles. I'll let the author know.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99642
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)

2005\12\07@050036 by cbmeeksn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, cbmeeks wrote:

[Quoting: "James Newton"]I assume you are using:

http://www.piclist.com/cgi-bin/delay.exe?Delay=46&Type=cycles&Regs=d1+d2+d3+d4&clock=80&name=Delay&CPU=SX



; Delay = 46 instruction cycles
; Clock frequency = 80 MHz
; Actual delay = 5.75e-007 seconds = 46 cycles
; Error = 0 %
d1 DS 1
;46 cycles
   mov w, #$0C
   mov d1, w
Delay_0:
   decsz d1
   jmp Delay_0


The mov's take a cycle each. jmp takes 3 cycles in turbo mode. decsz takes 1 cycle if the condition is false and 2 if it is true. My old SX-Key manual actually says 3, but the current datasheet says 2 and that makes a lot more sense.

So, the mov's take 2 cycles. The first 11 times through the loop, decsz takes 1 and jmp takes 3 so 4 times 11 = 44 for a total of 46 so far. On the 12th cycle, the result is zero and decsz takes 2 cycles to skip out for a total of 48 cycles.


I believe you are correct, the delay generator doesn't take into account the final 2 cycles. I'll let the author know.


Well, I knew I wasn't crazy...lol
Every loop I checked had two extra clocks.  I spent a lot of time trying to figure out why my display didn't look correctly.  My fault for assuming.  :-)
Günther's, SXSim saved the day.

Oh, Günther, I haven't been able to count in the last couple of days due to a heavy work load but I should be back on it this week...and it looks like James has verified this too.

Thanks guys cbmeeks
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99677
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)

2005\12\07@060007 by beann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

cbmeeks,
 You can use SX/B as a delay generator. And it's code is not affected by code pages.
 For example with freq as 80MHz a "PAUSEUS 0.575" generates the following code:

 MOV __PARAM4, #9   ; 2 cycles
 DJNZ __PARAM4,@$   ; 8*5 + 3 cycles
 NOP                          ; 1 cycle
 This takes exactly 46 cycles.
Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99682
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)

2005\12\07@060259 by cbmeeksn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, cbmeeks wrote:

Hey, I haven't thought about that!

Thanks, I will give it a try.

I wished the next version of SX-Key would have a tool for generating loops.  Something that would take your FREQ value and just ask you for how many clocks or seconds(µSeconds).  Then, plop the code down.

For now, I use the online version and just copy/paste.  No biggie but would be a neat tool.
cbmeeks
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99683
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)

2005\12\07@125832 by dkemppain/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, dkemppai wrote:

[Quoting: "cbmeeks"]
Hey, I haven't thought about that!

Thanks, I will give it a try.

I wished the next version of SX-Key would have a tool for generating loops. Something that would take your FREQ value and just ask you for how many clocks or seconds(µSeconds). Then, plop the code down.

For now, I use the online version and just copy/paste. No biggie but would be a neat tool.
cbmeeks

Or even just counting clocke in debug mode...

-Dan
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99735
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)

2005\12\08@085102 by James Newtonn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, James Newton wrote:

The delay code generator at sxlist.com has been fixed and now produces the correct delay code for the SX. For example:
http://www.piclist.com/cgi-bin/delay.exe?Delay=46&Type=cycles&Regs=d1+d2+d3+d4&clock=80&name=Delay&CPU=SX
produces:


; Delay = 46 instruction cycles
; Clock frequency = 80 MHz
; Actual delay = 5.75e-007 seconds = 46 cycles
; Error = 0 %
d1        DS        1
                       ;44 cycles
       mov        w, #$0B
       mov        d1, w
Delay_0:
       decsz        d1
       jmp        Delay_0
                       ;2 cycles
       nop
       nop
; Generated by http://www.piclist.com/cgi-bin/delay.exe>; Thu Dec 08 16:48:30 2005 GMT
; See also various delay routines at http://www.sxlist.com/techref/ubicom/lib/flow/delays_sx.htm  

Thanks for letting me know!

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99838
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)

2005\12\08@093655 by cbmeeksn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, cbmeeks wrote:

Hey, glad I could have been of service.  I know a lot of people use that.

cbmeeks
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=99163#m99851
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)

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...