Quote Originally Posted by bcd View Post
OK, we might need a bit more info here.

Is the voltage you want to measure AC or DC ? What's the application - if its in a vehicle you will need to add some voltage spike protection to the sense inputs and power supply lines.

The 12F683 has a Hardware PWM output from memory so it is really easy to set the duty cycle to the required value and it will stay at that level until it is next changed - have a look in the manual for the HPWM command.

You will need a voltage divider circuit to allow you to get the full scale voltage into the A/D. Try doing a search on the forums, its been discussed before.

Bill.
It's DC voltage and I'm OK with spike protection, a voltage divider and all of the rest the of the circuitry.

Through searches on the Internet and this forum and the data sheet, I did find out that the PIC12F683 will do the job, but I need help understanding the programming. I'd like to see a couple of similar projects that monitor voltage and then perform functions based on that voltage. In other words, I'd like to study the code, which has always been my shortcoming, especially with IF, greater than, less than, equal to, THEN, ENDIF and so forth.

Thanks.

~ Dave