• 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.

pic 16f877 questions

Not open for further replies.


New Member
hi, im new to this forum. my name is fernando and im form argentina. the purpose of this message is to introduce myself to all the people who visist this forum and, obviously, start asking questions. im just starting with pic programing and some doubts came to me...

1-what should be the correct settings in configuration bits in MPLAB? i know what does oscillator, watchdog timer and code protect mean, but what about the rest? how should i set them?

2- can i set the program memory end addres to a lower value so i dont have to wait so much to program my pic? at least when i know that the code is small.

3- does anybody know where i could get proyects or info of pics measuring time? i mean, a pic that receives pulses through a pin and then compares the time between pulses to a value (eg. 5 sec) and with certain presicion decides if it is correct or not.

i hope i make myself clear.
ok, bye.


Active Member
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

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

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.
Not open for further replies.

Latest threads

EE World Online Articles