output's on as power is supplied


Results 1 to 13 of 13

Threaded View

  1. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tazntex View Post
    keydata var b3
    What is 'b3' supposed to be?


    Your logic is messed up...
    Code:
    INCLUDE "bs2defs.bas"
    keydata VAR b3 <----- what is this again?
    serpin VAR porta.4 
    trisa = %00010000 : trisb = %00000000
    
    loop:
    gosub loop1
    goto keyed    <------Why GOTO the next line below?
    Let the program go to it, after all, it's right there
    keyed:
    IF keydata = 1 THEN outr1........IF keydata = 12 THEN outr12
    and again, from the last thread you posted this in, it's fairly
    bad form using all these IF/THEN statements,
    look at using BRANCH in the manual instead
    .....................
    loop1: 
    SERIN serpin,N2400,[254],keydata
    IF keydata => 1 AND keydata <= 12 THEN GOTO keyed
     You GOSUB'd into this loop1: but you GOTO to get out of it if need be.
    You can't do that, at least not for very long, depending on the program.
    That's a stack overflow waiting to happen which leads to a PIC reset,
    or at least a big mess.
    return
    Last edited by skimask; - 21st May 2007 at 21:32.

Similar Threads

  1. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 07:12
  2. Pic getting part power from Analog Port
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 22nd April 2009, 10:34
  3. Outputs high to power
    By volcane in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd February 2008, 18:29
  4. 12 Servo's together does not seem to work, Power problem
    By macx75 in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th December 2006, 19:30
  5. Power up problem
    By Ken McDonald in forum General
    Replies: 1
    Last Post: - 28th December 2004, 17:06

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