help with PIC16F628 conditional program


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by joseph View Post
    RA7 won't be an input until i independently configured it as an input so i placed this line
    Code:
    INPUT neut
    Did you notice IF you want Porta.7 as an input ... the TRIS value must be > 127 ???

    here you have 95 ... tadaaaa ...

    this works, but for some reason instead of revers/portb.0 going steady high when the input condition rules i got some oscillations, the led connected on this on my simulation blinks
    no reason for that ... simulators are just toys , so do not believe what they say ...
    may be you could add some debouncing to your inputs ... but simulation won't show anything.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    Apr 2009
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    i didn't notice that

    here's a screenshot:


    this happens to all ports on portb except rb0 where i get a straight line


    thanks
    Last edited by joseph; - 4th July 2010 at 19:01. Reason: changed image link

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Could you post your ISIS file here ??? ( xxx.DSN )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Apr 2009
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    here
    direct link:
    http://dc187.2shared.com/download/D7...42736-ef003566

    if the direct link doesn't work, here:
    http://www.2shared.com/file/D7VAeRiX/ecu.html


    thanks
    Last edited by joseph; - 4th July 2010 at 19:32.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi, Joseph

    Definitly a simulator issue ... ( one MORE for Proteus ... )

    Just run your program in MPSIM ( MPLAB Simulator ) in step by step mode, and you won't see any change for the output ...

    I did told you Sims are toys ... , forget about them !!!

    BTW, Correct code is:

    Code:
     IF ( FWD ^^ REVS ) AND NOT NEUT THEN   
            forward = FWD : revers = NOT forward
           ELSE
            forward = 0 : revers = 0
           ENDIF
    Doesn't change anything ... but brain satisfying !!! ( it's a logical EXOR, and not a bitwise one )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    Joseph,

    Add some resistors in series with the LED's that are being overdriven.
    It will stop blinking.

    Proteus Rules.
    MPSIM is Lame.
    DT

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by Darrel Taylor View Post
    Joseph,

    Add some resistors in series with the LED's that are being overdriven.
    It will stop blinking.

    Proteus Rules.
    MPSIM is Lame.
    Hi, Darrel ...

    did you try to close Forward, then the two other switches ( or/and ) ...

    you said " lame " ??? ... funny ...

    Alain

    Judge of peace: my EasyPic5 ... Proteus is OUT !!!
    Last edited by Acetronics2; - 5th July 2010 at 13:13.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  8. #8
    Join Date
    Apr 2009
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Joseph,

    Add some resistors in series with the LED's that are being overdriven.
    It will stop blinking.

    Proteus Rules.
    MPSIM is Lame.
    whoa it seems that proteus simulates the overload protection, it worked

    thanks Darrel, thanks Alain

    i will try to complete the code. i'l update this thread soon

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