Loading...
  Show Posts
Pages: 1 ... 12 13 [14]
196  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Static electricity? Fried board? on: April 11, 2007, 09:20:21 pm
The digital inputs have such large resistance that if you do not tie them high or low with a resistor they will float in the middle. Their level will depend on how many electrons are trapped on them. This is easily changed by a static charged touch.

Wire up the switch and resistor and everything will be good.
197  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: sketches on attiny2313 on: April 08, 2007, 11:05:01 am
Arduino sketches are bigger than 2k. The serial bootloader alone is 1k. You could use an ICSP instead of the bootloader and save that space.

The simple "blink a single led on and off" example takes 3676 bytes in Arduino-0007 so that is out. The in-development Arduino-0008 code blinks an LED in 876 bytes, so that might be possible, but any libraries would probably put you over the top. You won't be able to use the serial port library, for example.

RAM space is also going to be a problem.
198  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Help. on: April 07, 2007, 08:38:52 am
I'd recommend starting with at least one official Arduino so you have a known device to learn how things work, from there...

You can use an Arduino to put a bootstrap loader into other chips.
http://www.arduino.cc/playground/BootCloner/BootCloner

The schematics are in the hardware section if you want to make your own Arduino. It is simple enough that you can put it together on a prototyping board. The part that gets complicated is if you want the USB<->RS232 converter. These don't come in DIP packages. I'm not sure if there is one that works at 5V, but I've used a Nokia cell phone data cable in other cases. Some models of these are just USB<->3.3v RS232 converter cables.

If you are cost sensitive and close enough to the US, SparkFun sells the Olimex 28 pin AVR board for $16 (+$4 for an Atmega8) http://www.sparkfun.com/commerce/product_info.php?products_id=29 It is serial interfaced instead of USB and its LED is in a funny spot from the Arduino perspective, but it has a good amount of holes for piecing things together. You'll probably want to put in a 16MHz crystal so you don't have to mess with making a different boot loader image. And you have to connect the RX and TX pins to the level converter on board. Remember to cross them.
199  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Using several accelerometers, feasibility? on: March 28, 2007, 06:21:58 pm
I haven't used those accelerometers, but from a quick look at at the specs and code...

It will take 20ms worst case to get a reading. If you need two axis on 7 cups that will be 14 readings, or 280 milliseconds. You could sample the who setup about 4 times a second. With really clever coding you could double that rate by watching several of them at once.

There are 14 inputs, but if you used them all you would have no outputs to do anything, you would have consumed your serial port.  Fortunately there are devices called multiplexors which allow you to select one of many inputs. You could use a 16 channel multiplexor (MUX), that would take 4 outputs to tell it which channel you wanted then only 1 for an input leaving you plenty of pins for other functions.

There are also analog multiplexors if you went with analog sensors. You could probably get a higher sample rate this way if that was an issue.

And ah, the best.... Will people rip it apart? Absolutely! If it is possible they will rip it apart. Theymay not mean to, but it will happen. I might experiment with using a low stretch, braided sheath rope of the sort used by small sailboat sailors. This has a braided cover in a pretty color with a core of straight, very strong fibers. You can easily get hundreds of pounds of breaking strength in a few millimeters of rope diameter, but the best part is when you 'scrunch' the sheath a bit it gets bigger and you can snake a couple twisted pairs through the inside where they are protected. If you are very clever with your knot work you could encase the sensor in the rope as it is tied around the handle of the bowl... assuming they have handles... otherwise you will have to glue it on somewhere and hope for the best.
200  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Equivalent of Pulsout command? on: March 29, 2007, 10:51:26 pm
You can do this, but you need to use the IO registers directly.
Figure out which port and pin number you are needing to alter and then you can do something like...
Code:
PORTD |= _BV(3);  // turn on pin 3 of port d
PORTD &= ~_BV(3); // turn off pin 3 of port d
_BV(3) is just a macro that makes the bit mask for bit 3, PORTD is the IO register. That will get you a fraction of a microsecond of on time for your pin. You can use the high level functions like pinMode() to set up the pin and then use these for the timing critical part. Don't use a variable in the _BV() if you can help it, it makes dramatically slower code.

The hardware page has a link to the pinout picture for Arduinos. You can see which port and pin a given digital pin is on.
201  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Equivalent of Pulsout command? on: March 29, 2007, 05:43:13 pm
If you set a digital pin to be an output, then digitalWrite() it to 1 and digitalWrite() it back to 0 you will have made a pulse just under 10 microseconds long. That is pretty close to Pulsout.  You could put a delayMicroseconds() call in between to make it longer.
202  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Reading a pushbutton on the analog ins. on: March 17, 2007, 10:29:15 am
Should work. Use a pull-up resistor, say 10k, and let the switch pull it down. You can read it as an analog value and decide if it is a large or a small number.

I think at the hardware level there is nothing stopping you from just using those pins as digital inputs, but you couldn't use digitalRead() on them. You'd have to read the port and check the proper bit.
203  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Blinking LED help! on: January 23, 2007, 02:08:11 pm
if ( countdown = 1) ... you mean to have a "==" there.
That will get you to your next bug.  (timer will go down by 100 each time into negative numbers, causing huge delays or near zero delays depending how delay() is written.)

You may wish to put in some serial printing as debugging info while you work out the logic...
Code:
Serial.print("count=");
 Serial.print(count);
 Serial.print(" countdown=")
 Serial.print(countdown);
 Serial.print(" timer=");
 Serial.print(timer);
 Serial.println();
.. click the little rectangle with a lollypop sticking out of the top in the toolbar to get the serial monitor running after you download your program.
Pages: 1 ... 12 13 [14]