1:
Configuration settings for the '877:
Power on timer (PWRT): When enabled there is a short delay before the pics starts running on a power-up.
Brown-out-detect: When enabled the pic will be kept in a reset state when the power suppy drops below a certain brown-out voltage. This is done to prevent the pic from acting 'weird' due to too low power supply.
Low voltage programming (LVP): When anabled the pic can be programmed by using low valtage (no need for the 14V on normal programmers) - requires special lvp programmer.
Flash program write: When enabled the pic is allowed to write to its own program memory (for bootloaders)
debug: chooses whether to allow in circuit debugging or not
Data EE protect: Protects the data EEprom from beeing overwritten. Disable if your program wants to write to data eeprom
Note that settings these bits in the mplab configuration bits window does NOT apply these settings to your code. It only generates a configuration word for you (i.e 0x3FFF). You then have to place this config word in the code yourself, by adding this line to the top of your code:
__CONFIG <word> example __CONFIG 0x3FFF
2:
If it takes so long for your program to be written to the pic, even when its a small program, then the programming software you use is likely to be the cause. Try using another program, winpicprog for example works like a charm, and only writes to adresses that need updating
www.winpicprog.co.uk
3:
how to measure time between pulses depends on the project. Are there other tasks that need to be performed while the time is beeing measured?
If so; then you will have to use an interrupt routine, if not time can be measured directly by using a loop of fixed lenght.