In SX Microcontrollers, SX/B Compiler and SX-Key Tool, kingneb wrote: The nibble is read off PC a parallel port. There are only 10 posible settings (speeds) for the PWM. Zero means off and Ten means full speed. The number 15 means activate a relay for the direction of the motor. The number 14 means turn the relay off. 13 12 and 11 are used for nothing. This is the code generated for a 100 cycle delay. I am puzzled because I cannot see how to calculate the values that go into a loop like this. d1 DS 1 ;98 cycles mov w, #$19 mov d1, w Delay_0: decsz d1 jmp Delay_0 ;2 cycles nop nop ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=90755#m90846 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)