1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Incrementing POSCNT

Discussion in 'Oshonsoft' started by camerart, Jan 23, 2016.

  1. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,420
    Likes:
    11
    Location:
    Dorset UK.
    Hi,

    Does anyone know if there is a way of incrementing:
    CAP2BUFL POSCNT.LB
    CAP2BUFH POSCNT.HB
    up and down in Oshonsoft SIM please?

    Camerart.
     
  2. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,420
    Likes:
    11
    Location:
    Dorset UK.
    Hi,

    STOP THE PRESS, I think I've got it!!!
    DIM posinc as word

    If PORTB.0 = 1 Then
    posinc = posinc + 1
    Endif
    If PORTB.1 = 1 Then
    posinc = posinc - 1
    Endif
    CAP2BUFL = posinc.LB
    CAP2BUFH = posinc.HB

    Thanks, if you started to work on it.

    C.
     
  3. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi C,
    I have already placed a up/dwn count option for CAP2BUF when using the IDE sim.
    Look at the earlier test/demo's I posted for you.

    E;)
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,420
    Likes:
    11
    Location:
    Dorset UK.

    Hi Eric,

    I thought so, and looked, but could only find the POT/PWM one. I've just had a longer look and found them, thanks:)

    C.
     

Share This Page