Go Down

Topic: [Solved] Digital inputs 0 and 1 not working (Read 693 times) previous topic - next topic

Coenie

Nov 03, 2010, 05:56 pm Last Edit: Nov 03, 2010, 09:27 pm by Coenie Reason: 1
Hello there,

I just got my first board yesterday and I'm having problems with reading digital ports 0 and 1. Whenever I connect i.e. buttons to these, reading both these ports ALWAYS seem HIGH, even with 10k pull downs. I know they are serial ports, so I've also tried running a simple button test on battery power instead with USB disconnected. Set as outputs, they both work fine (blink test on both). I've already tried looking for posts about this or something in manuals, but haven't been able to find anything so far. Am I just stupid for overlooking something or do my Atmel's 0 and 1 inputs seem defective?

Thanks,

Note: Arduino Duemilanove

Tim Williams

What happens when you use the same circuit and sketch on inputs 2 and 3?

Have you measured the voltage on ports 0 and 1 when you close the switch?

Coenie

Pins 2 and up work perfectly. Haven't measured the voltage yet, good point, will do that later.

Coding Badly


Does your Sketch call Serial.begin?

Which IDE version are you using?

Grumpy_Mike

Pins 0 and 1 are used on the serial interface an are not normally used for general I/O. They are connected to the USB chip through 1K resistors so you need some signal stronger than that to pull them.

Tim Williams

#5
Nov 03, 2010, 07:36 pm Last Edit: Nov 03, 2010, 07:38 pm by timmyw Reason: 1
Grumpy's right. I just wanted you to figure out why the voltage wasn't gonna be what you expected.

You weren't overlooking anything really, you knew they were used for Serial but I bet you didn't look at the schematic and see the difference.

The other option is to remove the resistors (R8 and R9). Then it should behave like all the rest.

Grumpy_Mike

Quote
Then it should behave like all the rest.

It will but then you can't upload a program until you put them back.

Coenie

Got it working now... Pull down resistor was too high to overcome the signal from the FTDI chip. Lowered the resitor value until it accepted the button state change. But now I can't flash anymore. Think it's best to keep the line either detachable on the fianl design of the intended application, or just use two other inputs, won't need all of them anyway.

At least I've found the reason why they didn't work now. Thanks guys! :D

Grumpy_Mike

Quote
But now I can't flash anymore

Yes I said that, you can always put a switch in like in this project:-
http://www.thebox.myzen.co.uk/Hardware/MIDI_Shield.html

Go Up