In SX Microcontrollers, SX/B Compiler and SX-Key Tool, robsubjavelin wrote: Hi, My first SX28 program (basic+asm) is for control a DC motor, it runs to a position received by an uart (2400). On the motor there is a gearbox (1:30) and on the shaft there are 12 magnets (N-Z-N-Z...). An Allegro Hall sensor gives speed and direction back. PWM signal (1960Hz, 0-255) and sensor are made in the interrupt routine (asm). Everything works well. To compensated the clock ticks caused by the interrupt, I looked at the scope and the timing for 2400 baud (4.16msec). By changing the [i]EffectiveHz[/i] parameter of [b]FREQ[/b] in 18_750_000 the timing was good and all works well. Interrupt = 500_000 (2usec) I did not compensated the assembly Hall sensor part, because it was not needed!!. Can someone explain this? So there are some questions left: - how to [b]calculate[/b] the effectivehz parameter - must i compensated the Hall sensor part as well for clock ticks - please any reaction on the source Regards Rob. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=150805 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)