Where is the problem? The code is correct Tasking accepts it well! I read the maunual(which is worse) and in your forum. Please help me detaily discreption and not a reference to maunual!
compiling MAIN.C... Subroutines_FOC.H(97): error: unrecognized token Subroutines_FOC.H(97): error: identifier "mov" is undefined Subroutines_FOC.H(97): error: expected a ";"
-------------------------------------------------------------
#pragma asm (@w1 = pi_parameter,@w2 = reference,@w3 = actual , @4, @5, @6, @7, @8, @9, @10)
mov @10,MCW ;Save MCW register mov MCW,#0600h ;Set shift left mov @4,ZEROS ;Load zero in R9 CoLOAD @4,@w2 ;Load Accumulator (High) with @w2(reference) CoSUB @4,@w3 ;error = reference - actual CoSTORE @5 ,MAS ;Load error in @R5 mov @6,[@w1+] CoLOAD @6,[@w1+] ;Load yn (integral buffer) in accumulator mov @7,@w1 ;Save parameters addres in R1 mov @6,[@7+] ;Load Kp (proportional Constant) in R5 mov @8,[@7+] ;Load Ki = T0/Ti (integral Constant) in R6 CoMAC @8,@5 ;yn = Ki * error + yn mov @8,[@7+] ;Load ynmax (limit value max) mov @9,[@7+] ;Load ynmin (limit value min) CoMIN @4,@8 ;Limit max yn CoMAX @4,@9 ;Limit min yn CoSTORE @w2,MAH ;Store yn-high in R4 CoSTORE @w3,MAL ;Store yn-low in R3 mov [-@w1],@w2 ;Store R4 in integral buffer(High) mov [-@w1],@w3 ;Store R3 in integral buffer(Low) CoMUL @6,@5 ;Kp * error CoSHL #6 ;64 * Kp * error CoADD @w3,@w2 ;y = yn + (64 * Kp * error) mov @8,[@7+] ;Load ymax (limit value max) mov @9,[@7+] ;Load ymin (limit value min) CoMIN @4,@8 ;Limit max y CoMAX @4,@9 ;Limit min y CoSTORE @4,MAH ;Store y-high in @4 (return register) mov MCW,@10 ;Restore MCW register
#pragma endasm (retvalue = @4)
return retvalue;