Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 10th August 2007, 10:35 AM   (permalink)
Default

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!.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 10th August 2007, 12:44 PM   (permalink)
Default

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.
justDIY is offline   Reply With Quote
Old 10th August 2007, 02:23 PM   (permalink)
Default

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
eblc1388 is offline   Reply With Quote
Old 10th August 2007, 04:35 PM   (permalink)
Default

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
What is an OP (apart from being me)?

Nigel; I will do as you say over the weekend.

Last edited by jimfraseruk; 10th August 2007 at 05:45 PM.
jimfraseruk is offline   Reply With Quote
Old 10th August 2007, 04:39 PM   (permalink)
Default

Quote:
Originally Posted by jimfraseruk
What is an OP (apart from being me)?
Original Poster
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 10th August 2007, 05:44 PM   (permalink)
Default

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.
jimfraseruk is offline   Reply With Quote
Old 10th August 2007, 05:49 PM   (permalink)
Default

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.
eblc1388 is offline   Reply With Quote
Old 12th August 2007, 04:23 PM   (permalink)
Default

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.

Attached Images
File Type: jpg Breadboard.jpg (63.4 KB, 19 views)
File Type: jpg Circuit Diag.jpg (90.3 KB, 20 views)
Attached Files
File Type: asm StartGate1.asm (8.5 KB, 6 views)
jimfraseruk is offline   Reply With Quote
Old 12th August 2007, 04:48 PM   (permalink)
Default

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.
eng1 is online now   Reply With Quote
Old 12th August 2007, 05:38 PM   (permalink)
Default

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)
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com

Last edited by blueroomelectronics; 12th August 2007 at 05:42 PM.
blueroomelectronics is offline   Reply With Quote
Old 12th August 2007, 05:42 PM   (permalink)
Default

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
justDIY is offline   Reply With Quote
Old 12th August 2007, 07:28 PM   (permalink)
Default

Quote:
Originally Posted by justDIY
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)
My mistake it is a 12v DC supply (Transformer)

Quote:
Originally Posted by justDIY
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.
Does this mean I can leave it there? I want to see when I have power or not?

Quote:
Originally Posted by justDIY
On the PIC, Pin 4, RA5 / MCLR should be connected to the positive rail with a 10k resistor.
I have now done this, but I thought it was only required if the external MCLR is on in the config fuses in the asm code.

Quote:
Originally Posted by justDIY
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.
You are correct. I have moved the 0v wire.

Quote:
Originally Posted by justDIY
I also recommend installing a 0.1 to 0.33 uF capacitor at the input and output of the regulator.
This is where I need to do some more reading I think. Would these caps replace the ones I already have or be an addition? I do not understand the difference between 'Filters' and 'Decoupling Caps'. If in addtion where would I put them?

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.
jimfraseruk is offline   Reply With Quote
Old 12th August 2007, 07:38 PM   (permalink)
Default

Well, you posted a schematic that is different from the actual circuit.

Quote:
Originally Posted by jimfraseruk
My mistake it is a 12v DC supply (Transformer)
Do you mean transformer with bridge rectifier and filter capacitor?


Quote:
Originally Posted by jimfraseruk
My mistake it is a 12v DC supply (Transformer)
Does this mean I can leave it there? I want to see when I have power or not?
You can use it beacase - as justDIY said - it's connected properly on the board.

Quote:
Originally Posted by jimfraseruk
I have now done this, but I thought it was only required if the external MCLR is on in the config fuses in the asm code.
If MCLR is disabled in fuses, don't use an external resistor.
eng1 is online now   Reply With Quote
Old 12th August 2007, 07:48 PM   (permalink)
Default

Quote:
Originally Posted by eng1
Well, you posted a schematic that is different from the actual circuit.

Do you mean transformer with bridge rectifier and filter capacitor?
Well it was my first attempt at a circuit diagram

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.
jimfraseruk is offline   Reply With Quote
Old 12th August 2007, 08:33 PM   (permalink)
Default

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.
philba is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
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



All times are GMT. The time now is 03:00 PM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.