Hot!PORTB incorrect condition when simulate in proteus

Author
Burgunsky
New Member
  • Total Posts : 25
  • Reward points : 0
  • Joined: 2014/12/31 09:44:19
  • Location: Russia
  • Status: offline
2017/10/07 02:05:09 (permalink)
0

PORTB incorrect condition when simulate in proteus

The condition of the PORTB.RB4 is incorrect when simulating in Proteus. There is logical zero all the time. In MPLAB simulation works fine. Here is the code example and scheme.


#1

6 Replies Related Threads

    DarioG
    leaving this planet
    • Total Posts : 53071
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: porcodioland
    • Status: offline
    Re: PORTB incorrect condition when simulate in proteus 2017/10/07 02:12:29 (permalink)
    0
    Could it be RB4 is also LVP on this PIC?

    Dario Greggio
    --
    how does it feel, never having been loved? as life fades away, day after day, on this planet made of s h i t...

    #2
    qhb
    Superb Member
    • Total Posts : 6247
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: online
    Re: PORTB incorrect condition when simulate in proteus 2017/10/07 03:31:36 (permalink)
    +1 (1)
    DarioG
    Could it be RB4 is also LVP on this PIC?

    Yes it is.
    That means the displayed code is incomplete, because the CONFIG settings are not visible.
     
    #3
    Burgunsky
    New Member
    • Total Posts : 25
    • Reward points : 0
    • Joined: 2014/12/31 09:44:19
    • Location: Russia
    • Status: offline
    Re: PORTB incorrect condition when simulate in proteus 2017/10/07 09:33:02 (permalink)
    0
    Sorry, but the table in datasheet describes RB4 only like "RB4/AN11/P1D ". Seems LVP on RB3 pin.
    #4
    Burgunsky
    New Member
    • Total Posts : 25
    • Reward points : 0
    • Joined: 2014/12/31 09:44:19
    • Location: Russia
    • Status: offline
    Re: PORTB incorrect condition when simulate in proteus 2017/10/07 09:36:52 (permalink)
    0
    It seem to be that that could be CONFIG problem, because CONFIG enters via "edit components" option in Proteus, not in source code, like in MPLAB. But CONFIG has not any reference to RB4 pin.
    post edited by Burgunsky - 2017/10/07 09:40:25
    #5
    DarioG
    leaving this planet
    • Total Posts : 53071
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: porcodioland
    • Status: offline
    Re: PORTB incorrect condition when simulate in proteus 2017/10/07 09:38:24 (permalink)
    0
    Indeed, it's on RB3. Not sure then...

    Dario Greggio
    --
    how does it feel, never having been loved? as life fades away, day after day, on this planet made of s h i t...

    #6
    davekw7x
    Entropy++
    • Total Posts : 1230
    • Reward points : 0
    • Joined: 2012/01/16 12:01:07
    • Location: Left Coast, USA
    • Status: offline
    Re: PORTB incorrect condition when simulate in proteus 2017/10/07 11:14:23 (permalink)
    +2 (2)
    As you note in post #4:  RB4 is AN11.
     
    Therefore, to read digital input values on RB4 you must clear the ANS11 bit of ANSELH.   (Section 3.4.1 of the Data Sheet.)
     
    Bottom line:
    Simulation of physical I/O is like bear hunting---sometimes you get the bear; sometimes the bear gets you.
     
    Personally, I wouldn't spend a New York minute on simulating physical I/O.  (But that's just me: I'm funny that way.)  Ars longa, vita brevis.


     
    Regards,
     
    Dave
    post edited by davekw7x - 2017/10/07 11:19:48

    Sometimes I just can't help myself...
    #7
    Jump to:
    © 2017 APG vNext Commercial Version 4.5