Help ?


Closed Thread
Results 1 to 21 of 21

Thread: Help ?

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Puerto Rico
    Posts
    133


    Did you find this post helpful? Yes | No

    Thumbs up

    a change of the pic18f252 to pic18f2620 expect that this work myself

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jetpr View Post
    a change of the pic18f252 to pic18f2620 expect that this work myself
    Good switch, but don't expect it to work without changing some of the code around a bit. I made a switch from a '452 to a '4620 awhile back...basically the same chip, but more memory, more hardware, etc.etc...
    Are you going to attach the code or not?

  3. #3
    Join Date
    Jan 2005
    Location
    Puerto Rico
    Posts
    133


    Did you find this post helpful? Yes | No

    Thumbs up

    hello this is my code of 3 Years off my hobbies Turbines for Models
    Attached Files Attached Files

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jetpr View Post
    hello this is my code of 3 Years off my hobbies Turbines for Models
    A few things to note at first look at your code...

    There's a few places where you've got a GOTO followed by a GOTO. The code isn't ever going to get to that 2nd GOTO. You might have actually meant to put a GOSUB followed by a GOTO...unless it's just a change that you haven't removed.

    There's at least 1 IF/THEN statement that doesn't look right. I think it's in the Autostart file.
    Code:
     if (EGT > 300) and (RPM > PumpAdd +10) and (FlameOut_1=0) then FlameOut_1=1: gosub opengasoff 'Close Gas Valve
    A single line If/Then with a colon in it generally doesn't work. If it was me, I'd use:
    Code:
    if (EGT > 300) and (RPM > PumpAdd +10) and (FlameOut_1=0) then
    FlameOut_1=1 : gosub opengasoff 'Close Gas Valve
    endif
    Is that zip file the actual code you are programming into your PIC and using right now?
    Oh...987 lines is what I got it down too

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    ROFL!

    And I thought you were the High Colonic Master.

    IF colons separate multiple statements on the same line as an IF, they are ALL executed if the condition is TRUE, and none will execute if it's false.

    So the 2 examples shown, are the same thing.

    .
    DT

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    ROFL!
    And I thought you were the High Colonic Master.
    IF colons separates multiple statements on the same line as an IF, they are ALL executed if the IF condition is TRUE, and none will execute if it's false.
    So the 2 examples shown, are the same thing.
    .
    I know that's what the manual says, but in the past, I've had certain situations where if one of those statements after the THEN is a goto or a gosub, the If/Then 'acts up' under certain circumstances. I can't quantify exactly what those circumstances are...I just know that I've been avoiding that certain way of doing the IF/THEN statements for a reason ever since it bit me way back when.
    Maybe that's one of those things that got fixed back in PBP 2.2, or it might've gotten fixed since, I don't know...I just avoid it...

  7. #7
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Here's a how to save on some code space a long with a marginal increase in speed. Avoid using the AND operator where possible by multiple nesting IF's.

    Code:
    if (EGT > 300) then
       if (RPM > PumpAdd +10) then
          if  (FlameOut_1=0) then
              FlameOut_1=1 
              gosub opengasoff  'Close Gas Valve
          endif
       endif
    endif
    Also try to avoid GOTO and GOSUB where possible. Most often, programs which make extensive use of them turn out to be spaghetti code.

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