These situations require isolation of the application circuit (and the battery itself, in some cases) from the 5-V programming-device voltage used to power the PIC while programming it. In addition, application circuits may draw more current than the programming device can source, so unpowered circuits operating on 5 V may require isolation between the programming device and the application circuit. In summary, if you haven't got a frequency counter, this is better than nothing.Many PIC processors require 5-V power while being programmed, yet battery-powered systems may contain low-voltage devices that will be damaged at voltages above their maximum voltage ratings. Duty cycle measurements are not good at high frequencies but seem to be good below 100kHz. Frequency works fine with a 50% duty cycle up to 1MHz (I haven't got anything faster handy to test). I've soldered it up on stripboard and now (unsurprisingly) it works a bit better. It seems to work fine up to about 100000Hz but seems to have problems above that (or it might work better if it wasn't on a breadboard). Pins RB6 and RB5 are connected together and used as the input. Realterm works fine for this, I haven't tested anything else. The duty cycle is calculated by sampling the input 16384 times during the quarter second so won't be very accurate especially at some frequencies. Frequency is in Hz (just a count for 1/4 second so only 4Hz accuracy which also means low frequencies can't be measured accurately or at all). Measured duty cycle is 0-255, rather than % because that is more useful to me. Not the best frequency counter in the world, but OK for free (assuming you've got a PIC programmer, a MAX232 or ST232, and a PIC16F628A.)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |