The compiler it was written for is MikroC if that is any help.
Max.
Max.
C:; unsigned char rpos unsigned long bres // 2. updates reference freq generator, records its position bres += 102400; ; add nS per interrupt period (512 insts * 200nS) if(bres >= MOTOR_PULSE_PERIOD) ; if reached a new reference step { bres -= MOTOR_PULSE_PERIOD; rpos++; ; record new xtal-locked reference position }
So are you trying to optimize your program, port it to another platform, or what?The compiler it was written for is MikroC if that is any help.
Max.
Nothing esoteric. Perhaps some of the C operators confuse.What would the assembly version of this be?
Max.
C:; 2. updates reference freq generator, records its position bres += 102400; ; add nS per interrupt period (512 insts * 200nS) if(bres >= MOTOR_PULSE_PERIOD) ; if reached a new reference step { bres -= MOTOR_PULSE_PERIOD; rpos++; ; record new xtal-locked reference position }
Wow... this guy is using Bresenham's algorithm to derive different frequencies from a master one! ... it's genius! ... Why didn't I think of that before? ... this could've come in handy in a previous project of mine. I'm gonna start studying his code and see if I can adapt it to my purposes.Anyone done any motor control design using Roman's methods here https://www.romanblack.com/onesec/DCmotor_xtal.htm
I am toying with the idea of variable control, but have to convert his program to Assembly if possible.
(was a forum member The_RB).
Max.
Intending to convert to assembler.So are you trying to optimize your program, port it to another platform, or what?
Yes I thought it neat, got Roman to thank also.Wow... this guy is using Bresenham's algorithm to derive different frequencies from a master one! ... it's genius!
Thanks for posting, Max.
Yeah, but his name's gone down in history... now, if I could just come up with a Martinez' algorithm to be remembered by...Sadly, he never got a dime for it.