May 26
Arduino playground : EEPROM-Flash
Hidden Powers - storing data in Flash and EEPROMThere are three types of memory in the atmega8:
Flash memory: it’s a rewritable non-volatile memory. This means that its content will still be there if you turn off the power. It’s a bit like the hard disk on the arduino board. Your program is stored here. The ATmega8 on the Arduino board has 8 KB of Flash memory, with 1 KB taken up by the bootloader. This memory supports at least 10,000 writes.
RAM: it’s like the ram in your computer.its content disappears when you turn of the power but it can be read and writter really fast. The ATmega8 has 1 KB of RAM.
EEPROM: it’s an older technology to implement rewritable non-volatile memory. It’s normally used to store settings and other parametres. The ATmega8 has 512 bytes of EEPROM. This memory supports at least 100,000 writes.
May 26
This taken from the arduino forums may be useful:
let’s take the mc14067 (http://www.onsemi.com/pub/Collateral/MC14067B-D.PDF) as an example this is an 16 channel analogue multiplexer. i’ve use this a lot of times.
connect pin 24 to 5V and 12 to GND. then connect a 10K resistor from 5V to pin 15. this is powering the chip and enable the switch that lets you pick which input to read.
now connect pin 1 to analogue input 0.
now we need to tell the chip which channel we want to read. this is done by connecting 4 digital outputs to pins 10,11,14,13. By using a combination of digitalWrite commands you can set the input channel to read.
all the other 16 pins are inputs where you will connect up to 16 pots (or any analogue sensor)
the code will look like this:
for (i=0; i <16; i++) {
# write i in binary on 4 output pins
# this selectes the input
val = analogRead(0)
# store val somewhere or send it on the serial port
}
now the cool part is that if you hook up one of these to each analogue input you can have 96!!!! analogue inputs