Menu

Pulsein use Timer0

Gigi
2023-08-04
2023-08-05
  • Gigi

    Gigi - 2023-08-04

    The PULSEIN command uses a Timer or is implemented in software

     
  • Anobium

    Anobium - 2023-08-05

    PULSEIN is a software implementation ( as follows ).

    macro PulseIn (PulseInPin, PulseTime as Word, TimeUnit)
      PulseTime = 0
      Do While PulseInPin = On
        WaitL1 1 TimeUnit
        PulseTime += 1
        If PulseTime  = 0 Then Exit Do
      Loop
    end macro
    

    If your chip has Signal Measurement Timer ( SMT) then you can implement/use the SMT library ( there are demos for SMT).

     
  • Gigi

    Gigi - 2023-08-05

    OK, ok so it's not blocking either, i think it's fine for me.

    I have an old 16F819 with no SMT I don't need great accuracy.
    Thank you

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.