Ds1820 -> pid -> pwm


Results 1 to 24 of 24

Threaded View

  1. #10
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gadelhas View Post
    @malc-c

    I Allready have that code, however this code don't permite changing the variables with hiperterminal like you said, can you give me the one that does?
    I'll configure the EasyPIC5 board for use with a 16F877A and 20Mhz crystal and try the code, probably have to be tomorrow afternoon now as I won't be home from work until late. But I'm sure it does allow you to change and set the values of PID etc as it contains the code to do so (snippet attached)

    Code:
    ;----[handle incoming serial Terminal data]---------------------------------
    Term_RX:
        HSERIN [Char]
        SELECT CASE Char
            CASE "R","r"   ' Refresh
                GOSUB TerminalMenu
            CASE "S","s"   ' Enter Setpoint
                X=1 : Y=22 : GOSUB MoveCursor
                HSEROUT ["Enter SetPoint ... (340=34.0",$F8,"): "]
                HSERIN [DEC SetPoints(EditChannel)]
                GOSUB  TerminalMenu
                LOOKUP2 EditChannel,[EE_SetPoint1,EE_SetPoint2, _
                                     EE_SetPoint3,EE_SetPoint4],Bvar
                WRITE Bvar, WORD SetPoints(EditChannel)
            CASE "P","p"
                X=1 : Y=22 : GOSUB MoveCursor
                HSEROUT ["Enter P term as HEX4 ... : "]
                HSERIN [HEX4 pid_Kp(EditChannel)]
                GOSUB  TerminalMenu
                LOOKUP2 EditChannel,[EE_pid_Kp1,EE_pid_Kp2, _
                                     EE_pid_Kp3,EE_pid_Kp4],Bvar
                WRITE Bvar, WORD pid_Kp(EditChannel)
            
            CASE "I","i"
                X=1 : Y=22 : GOSUB MoveCursor
                HSEROUT ["Enter I term as HEX4 ... : "]
                HSERIN [HEX4 pid_Ki(EditChannel)]
                GOSUB  TerminalMenu
                LOOKUP2 EditChannel,[EE_pid_Ki1,EE_pid_Ki2, _
                                     EE_pid_Ki3,EE_pid_Ki4],Bvar
                WRITE Bvar, WORD pid_Ki(EditChannel)
            
            CASE "D","d"
                X=1 : Y=22 : GOSUB MoveCursor
                HSEROUT ["Enter D term as HEX4 ... : "]
                HSERIN [HEX4 pid_Kd(EditChannel)]
                GOSUB  TerminalMenu
                LOOKUP2 EditChannel,[EE_pid_Kd1,EE_pid_Kd2, _
                                     EE_pid_Kd3,EE_pid_Kd4],Bvar
                WRITE Bvar, WORD pid_Kd(EditChannel)
            
            CASE "T","t"
                X=1 : Y=22 : GOSUB MoveCursor
                HSEROUT ["Enter Ti term as DEC ... : "]
                HSERIN [DEC pid_Ti(EditChannel)]
                GOSUB  TerminalMenu
                LOOKUP2 EditChannel,[EE_pid_Ti1,EE_pid_Ti2, _
                                     EE_pid_Ti3,EE_pid_Ti4],Bvar
                WRITE Bvar, pid_Ti(EditChannel)
    
            CASE "C","c"
                X=1 : Y=22 : GOSUB MoveCursor
                HSEROUT ["Enter I term Clamp as DEC ... : "]
                HSERIN [DEC pid_I_Clamp(EditChannel)]
                GOSUB  TerminalMenu
                LOOKUP2 EditChannel,[EE_pid_I_Clamp1,EE_pid_I_Clamp2, _
                                     EE_pid_I_Clamp3,EE_pid_I_Clamp4],Bvar
                WRITE Bvar, WORD pid_I_Clamp(EditChannel)
             
            CASE "O","o"
                X=1 : Y=22 : GOSUB MoveCursor
                HSEROUT ["Enter Output Clamp as DEC ... : "]
                HSERIN [DEC pid_Out_Clamp(EditChannel)]
                GOSUB  TerminalMenu
                LOOKUP2 EditChannel,[EE_pid_Out_Clamp1,EE_pid_Out_Clamp2, _
                                     EE_pid_Out_Clamp3,EE_pid_Out_Clamp4],Bvar
                WRITE Bvar, WORD pid_Out_Clamp(EditChannel)
            CASE "M","m"
                X=1 : Y=22 : GOSUB MoveCursor
                HSEROUT ["Manual Mode not available.      "]
    
            CASE "1","2","3","4"                       ; select channel
                IF EditChannel != Char -49 THEN
                    GOSUB ClearBox
                    EditChannel = Char -49
                    GOSUB DrawBox
                ENDIF
            CASE ELSE
                HSEROUT [7]     ; bad key, send Bell
        END SELECT
    RETURN
    It might not work with the version in MCS, but works fine with the version that came with windows XP - maybe google for a similar application

    You should get something like

    Last edited by malc-c; - 13th October 2010 at 13:02.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts