Help with word variable


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Help with word variable

    Quote Originally Posted by Scampy View Post
    So using the formula that results in 280-2768 which results in a negative figure. What I need to do is to make TempC into a 3 digit value, 276, so that when the equation is run I get a positive error, 280-276=4.
    Can’t you either divide the 2768 by 10, or multiply the 280 by 10 first?

  2. #2
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Help with word variable

    Well I did say it was late !

    OK that works - and gives a better result for when the current temperature is below the set point, but gives values of 655xx when the curent temp exceeds the setpoint. Also the heatdriver that controlls the LED on port D4 doesn't work as it should. It should be on constant, and then start pulsing at around 1sec frequency as the temperature nears the set point, with the pulse duration getting shorter as the difference between the current temperature and setpoint gets smaller.

    I've attached the PID include file hoping someone can advise
    Attached Files Attached Files

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,631


    Did you find this post helpful? Yes | No

    Default Re: Help with word variable

    a pid_out of 65535 would be interpreted as - 1 by your code and therefore ignored

    Code:
    ASM
    HeaterDrive
    ........
    you have no code to call this routine
    as well as no interrupt code at all that might call it either

Similar Threads

  1. Word Variable and I2C
    By Scampy in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 21st May 2014, 08:45
  2. Stumped with word variable
    By Scampy in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 11th November 2013, 13:11
  3. adding new word variable ?
    By iugmoh in forum General
    Replies: 4
    Last Post: - 21st February 2008, 00:26
  4. WORD vs BYTE variable lengths
    By bartman in forum General
    Replies: 0
    Last Post: - 28th November 2005, 21:16
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 19:59

Members who have read this thread : 0

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