The inner workings of PULSIN?
basicstampede
Posts: 214
When you program PULSIN,·what exactly does the BS do?
I'm asking about the inner workings of the PIC micro. (not how it works at high level).
Does it use Capture and Compare module?·
If anyone has some good understanding of what exactly the PIC on BS does, I would appreciate it.
·
I'm asking about the inner workings of the PIC micro. (not how it works at high level).
Does it use Capture and Compare module?·
If anyone has some good understanding of what exactly the PIC on BS does, I would appreciate it.
·
Comments
Update -- This when State is = 1.
PULSIN will also timeout when the user specified maximum time is exceeded. There is no need for capture-compare, as far as I can see. Two timed loops would be sufficient.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
I'm assuming that it starts by putting 0 to a 16 bit timer (which is free-running)·when it sees a 0 to 1 transition (or 1 to 0 transition).· Then, when it sees 1 to 0 (or 0 to 1) transition, it stops the 16 bit internal timer.· Then, knowing the internal frequency of PIC, it can calculate the duration.
Can someone from Parallax say with authority if above scenario is close?
·
The Stamp certainly does not use the single external timer input pin (RTCC). Every single pin of the Stamp can do PULSIN. The more recent Stamps are based on the SX28 or SX48 chip (Parallax aka Ubicom aka Scenix), but the code for those was kept backward compatible to a large degree with the original Stamp II.
The PIC or SX prescaler is in the Stamp assigned to the Watchdog function, which is used for timing the NAP and SLEEP commands.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com