Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC beginner - digital input randomly turns 1

Status
Not open for further replies.

Synaps3

Member level 1
Member level 1
Joined
Oct 14, 2014
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Visit site
Activity points
358
I wired up a project using a PIC18F26K22, a 16x2 LCD, and three buttons. I first tested the project in proteus and everything worked fine. However, in real life the buttons seem to randomly activate from me putting my finger near them or just attaching an open wire to the pin on the chip. Any idea why it's doing this?
 

Possible, no pull up or pull down resistor present. You can use internal pull up also, but actauly, realize random number generator is a very difficult task. Possible, you can share your project. We can try to sell it for real big money?
 

I needed pull down resistors (facepalm). I also needed to fix my code a bit because the buttons I'm using are kind of low quality so they sometimes contact multiple times with one press. I added a delay in addition to the repeat check to make sure it doesn't register multiple times.

It would be interesting to set a whole port to digital input and just have some long wires coming out of each pin. Then you just wave your hand over the thing to generate a random seed/number. I know it sounds funny, but it was actually doing this for me without the pull downs on the buttons. It wasn't super reliable though :)
 

it was actually doing this for me without the pull downs on the buttons

The fact that you are dealing with a high impedance input through an artifact willing to carry induced EMI as real antennas sounds very weird. I´m not totally sure if the lack of the pull-up resistors is the reason for such a sensitivity of the circuit. I suspect that you are probably using comparator module as input for the buttons.
 

It would be interesting to set a whole port to digital input and just have some long wires coming out of each pin. Then you just wave your hand over the thing to generate a random seed/number. I know it sounds funny, but it was actually doing this for me without the pull downs on the buttons. It wasn't super reliable though :)

I think you can make your this idea a bit more funny and playable by using LDRs instead of wire and using the ADCs for playing around with the code .. Just a thought :D ..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top