![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
I know it's not much help?, but it's either a design error (your circuit design is flawed in some way), a construction error (you've made an error building it), or a software error (you've written the software wrong).
I suggest you post the FULL circuit, every capacitor, every resistor, every single component (the partial diagram above is of no use). Then take a picture of your construction, and post that!. |
|
|
|
|
|
|
(permalink) |
|
stronger pull-up means less resistance ... 1000 ohms < 10000 ohms
edit: I'm not sure why a higher pull up is suggested ... if your 10k is connected correctly and you're still experiencing high sensitivity on the pin, then the pull up is not strong enough, and your mere touch is enough to pull down the pin. a stronger pull up uses more current to bias the pin to the high rail - more current will also be required to affect a change in the state of the pin, pulling it low. I = V / R tells us a 1kohm pull-up at 5v will limit current to 5 ma - so to change the pin from high to low, you'll need to sink more than 5ma of current. This is no problem for a mechanical switch or most modern digital parts, but double check your component ratings just to be sure.
__________________
If you don't have a planet, what good are gold bars? want to contact me directly? gmail gordonthree check out my project website: http://projects.dimension-x.net Favorite numbers: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 Last edited by justDIY; 10th August 2007 at 12:54 PM. |
|
|
|
|
|
|
(permalink) |
|
Extremely likely that the OP has not masked other bits from the result of reading the input port and then performs a software test based on zero/not zero instead of testing specific bit position.
__________________
L.Chung |
|
|
|
|
|
|
(permalink) |
|
eblc1388 what does that mean, below is the code i use to check a button press.
Code:
Check_Keys btfss PORTA, IRR ; is there an input (low) call Send_StartStop ; Yes send start/stop signal to display return ; No do nothing Nigel; I will do as you say over the weekend. Last edited by jimfraseruk; 10th August 2007 at 05:45 PM. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
JustDIY; I tried a 1K resistor and it was better but not fixed. I had to touch the button (but not press it) to trigger.
Mike; LVP is off in fuses, I attached 10K resistors between +5 and RB4 (LV PGM) and +5 and RA5 (MCLR). No change. Philba; I measured the resistance with the power off it was 9.99K which is very close to the expected 10K. See above for the MCLR suggestion. Nigel; I am charging the batteries for my camera. |
|
|
|
|
|
|
(permalink) |
|
Your code is fine. So it is likely that the pull up resistor or its connection is faulty in your initial setup.
To trouble shoot this situation, just connects a voltage meter to the PIC pin and watch. If your "magic hand" activates the PIC but the voltmeter reading shows no effect, you can then be absolutely sure that the signal is not "entered" via the PIC pin with pullup. You have other floating pins. Edited: OP corrected coding error.
__________________
L.Chung Last edited by eblc1388; 10th August 2007 at 05:51 PM. |
|
|
|
|
|
|
(permalink) |
|
OK I have taken photos of the breadboard and had a go at drawing the circuit diagram. They are attached.
Most of the code and circuit diagrams are from Nigels Tutorial Site or Mike Predo's (spelling?) with my twist which is probably the reason for it not working. I also tried the test elbc suggested however when the multimeter probes go anywhere near the pin in question it goes low, so my finger is not the only magic thing in the world. |
|
|
|
|
|
|
(permalink) |
|
Try removing LED1 and R1, the Vdd pin of the microcontroller should be connected to the output of the voltag regulator.
In your schematic LED3 is backwards. |
|
|
|
|
|
|
(permalink) |
|
Yep the output of the regulator goes to the PICs VDD. Here's a typical hookup (it's missing the filter caps yours correctly has but does have the 0.1uf decoupling caps)
![]() Last edited by blueroomelectronics; 12th August 2007 at 05:42 PM. |
|
|
|
|
|
|
(permalink) |
|
on your picture, you have the incoming power "POWER IN 9V AC" but on your diagram you label the power as "+12v" (ac or dc not specified)
feeding 9v ac into the regulator is going to make it rather hot, and should have blown out that big capacitor you have on the input in the diagram, you show the LED being in series with the regulator, and a 330 ohm resistor connecting the positive rail to ground. On the breadboard, it appears the led and resistor are connected correctly, in parallel with the regulator. On the PIC, Pin 4, RA5 / MCLR should be connected to the positive rail with a 10k resistor. On the left side of the breadboard, there appears to be four wires leaving the circuit - where do these go? If I am to assume two of them are power coming in, and two of them are for the switch, I recommend moving the 0v (ground) connection from the incoming power directly to the ground terminal of the regulator, instead of having it travel around the entire breadboard before reaching the regulator. I also recommend installing a 0.1 to 0.33 uF capacitor at the input and output of the regulator.
__________________
If you don't have a planet, what good are gold bars? want to contact me directly? gmail gordonthree check out my project website: http://projects.dimension-x.net Favorite numbers: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 |
|
|
|
|
|
|
(permalink) | |||||
|
Quote:
Quote:
Quote:
Quote:
Quote:
Thanks again for all your help. I am learning lots (although everyone seems to have a different way of doing things). Last edited by jimfraseruk; 12th August 2007 at 07:34 PM. |
||||||
|
|
|
|
|
(permalink) | |||
|
Well, you posted a schematic that is different from the actual circuit.
Quote:
Quote:
Quote:
|
||||
|
|
|
|
|
(permalink) | |
|
Quote:
I have no what type of transformer it is, (maybe its not even a transformer)its a black box I plug into the wall, it takes in 220v AC and spits out a DC voltage of my selection (6, 9, 12, 15, 19, 24) upto 1.5A. It has no datasheet that I know of and its made in China. |
||
|
|
|
|
|
(permalink) |
|
proto boards like yours tend to suffer from poor connections, especially if they are old. I'd "buzz out" the connections - ie check continuity. Check the resistance between the PIC pins and where ever they are supposed to go. for example, check the input pin lead (RA1, not the resistor lead) and the +5 rail (not the resistor lead). Do so for all your pins.
Also, verify that you don't have bent pins on the PIC and make sure it is firmly seated. Then power it up and verify voltages on the pins. to your earlier question, you should be able to verify fuse settings in your programmer. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| odd project, 1 button adds a light 1 button takes a light away with sound. | KevinAlaska | Electronic Projects Design/Ideas/Reviews | 15 | 6th June 2007 04:38 AM |
| 1 Hour Timer PIC 16F628A (Set Button) | Suraj143 | Micro Controllers | 11 | 26th April 2007 03:54 AM |
| button midi keyboard | jjjjjj | General Electronics Chat | 2 | 20th March 2006 04:10 PM |
| Push Button On/Off power to PIC | eblc1388 | Micro Controllers | 8 | 17th February 2006 01:31 PM |