my code doesn't do what it is supposed to do.the program is for the pic to increment for every closing of the switch(5 volts input to rb0). it just continuously count up to 9 and then back to zero(binary). can someone help me wiht this code or schematic? here's the code
my code doesn't do what it is supposed to do.the program is for the pic to increment for every closing of the switch(5 volts input to rb0). it just continuously count up to 9 and then back to zero(binary). can someone help me wiht this code or schematic? here's the code
hehe sorry, i forgot about the current limiting resistors, i got this schematic and code from a pdf tutorial file. i already modified the clock by connecting a capacitor at pin 16 and ground(to make an RC network) but the circuit still counts upto 9 automatically and doesn't respond to the switch :?:
why does the mclr need a resistor?for current limiting?i thought it is ok to connect it directly to 5V because the tutorial does this for all of it's circuits
why does the mclr need a resistor?for current limiting?i thought it is ok to connect it directly to 5V because the tutorial does this for all of it's circuits
why does the mclr need a resistor?for current limiting?i thought it is ok to connect it directly to 5V because the tutorial does this for all of it's circuits
It's fine to directly connect it to 5V, the only real reason to use a resistor is as a pull-up for a reset switch down to 0V.
One advantage of using the 16F628, rather than the obselete 84, is that you can switch MCLR to be an extra I/O pin, which then internally connects MCLR to 5V.
I take it as a good practice, because sometimes when I want to reset the PIC which doesn't have a MCLR button to GND, I can't do it if there is no resistor between VDD and MCLR.
And Yes, use 16F628 instead 84. 628 is cheaper and has more peripherals... (internal 4Mhz oscilator...)