Hi Melanie and Bogdan
Thanks for your reply. I attached the screen shot of the configuration fuses and corrected the circuitry (I moved 100Om resistor on the other side of the ceramic capacitors because this is how it is on the board. I apologize for the mistake).
You are right Melanie I don’t set configuration fuses in software even though it is more convenient. This is because I use MPASM assembler which in turn requires PicBasic include files to be corrected. So I decided I will go the hard way.
This is the link I found very useful: http://www.picbasic.co.uk/forum/showthread.php?t=543. Thanks to Melanie for her time and effort.
The code does work because on the power-up the letter S is debugged, LED comes ON then the switch is polled in a loop and the LED changes state when you operate the switch. Sometimes though when you operate the switch Pic resets. Reset is indicated by debugged S on the screen of the computer.
The circuitry is assembled on two circuit boards. One with the PIC and the other with the switches, LEDs and other testing gear. Circuit boards are connected through the header pin plug. I think it is good enough to switch one LED ON and OFF
Power supply is of the wall (220 to 13v 1A) through the bridge and through LM7805 to the rest of the circuitry with 10uF capacitors on each side of the voltage regulator. Let’s estimate the maximum current needed by the circuitry. LED line will draw 5/470 = 11mA (if we consider LED being a short). Switch (when closed) will draw 5/330 = 15mA or after amendment that we performed 5/10000 = .5mA. PIC itself draws 4mA. RS232 line has 1k resistor and draws (if shorted to ground) 5/1000 = 5mA. 15 + 11 + 4 + 5 = 35mA in total or after rising the switch pull-up resistor .5 + 11 + 4 + 5 =20.5mA. Power supply provides 1000mA at 13V. I think power supply is out of concern.
Bookmarks