Re: hex file problem
Copy Paste from the book:
The resolution of PULSIN is dependent upon the oscillator frequency. If
a 4MHz oscillator is used, the pulse width is returned in 10us increments.
If a 20MHz oscillator is used, the pulse width will have a 2us resolution.
Defining an OSC value has no effect on PULSIN. The resolution always
changes with the actual oscillator speed.
PULSIN normally waits a maximum of 65535 counts before it determines
there is no pulse. If it is desired to wait fewer or more counts before it
stops looking for a pulse or the end of a pulse, a DEFINE can be added:
DEFINE PULSIN_MAX 1000
This DEFINE also affects RCTIME in the same manner.
‘ Measure high pulse on Pin4 stored in W3
PULSIN PORTB.4,1,W3
So the short answer is I do not think so, beyond the configs stated including the HS_OSC. I am guessing you have commented out the default configs in the 16F877A.inc file in PBP root directory.
Set up a word variable to store your results.
whatever number you get multiply by 2 micro seconds and that is your result at 20 mhz osc. Pulsin sets the tris like High / Low does.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks