The ATtiny44 and 84 are both pin-compatible, and as far as I know, just the same microcontroller but with different EEPROM and flash memory sizes.

However, for some reason, my code here for this Simon Says game (see bottom of post) only works on an ATtiny84, not an ATtiny44A. At first I thought it was a voltage issue. I'm only using 2 AA batteries, and I was using an ATtiny84V, which requires less voltage according to the datasheet. However, I tried it on a regular ATtiny84 (which should require the same amount of voltage an ATtiny44A does) and it worked just fine.

I'm kind of stumped on this one. Can anyone think of why the code won't work? I'm running them at 8MHz, internal oscillators. When I use the ATtiny84, everything works right - the startup sound plays, and then the light sequence flashes. When I use the ATtiny44A, no startup sound plays, no light sequence flashes. Here's a video of how it works with the ATtiny84:

This code uses cores from the arduino-tiny project, and is designed for use on an ATtiny84. For more information and to download the cores, visit the arduino-tiny Google Code page: http://code.google.com/p/arduino-tiny/

*/

#include <EEPROM.h> // We're going to be writing some stuff to the microcontroller's EEPROM

const int maxTurns = 100; // The maximum number of random numbers that will be generated.int randomArray[maxTurns]; // Array that will store the random numbers for the gameint inputArray[maxTurns]; // Array that will store user input

int eepromValue = 0;

boolean playedThisTurn = false; // Boolean variable for if the sequence has been played alreadyboolean buttonPressed = false; // Boolean variable for f a button has been pressed

void setup(){ //Serial.begin(9600); // Serial is commented out as the ATtiny doesn't support it. Useful for debugging on an ATmega328.

for (int x=1; x <= turnCount; x++) { // Play all of the moves in the random array at the beginning of each turn LEDandTone(ledPin[randomArray[x]], buzzerTone[randomArray[x]]); //Serial.println(randomArray[x]); } //Serial.println("---------"); }

const int maxTurns = 100; // The maximum number of random numbers that will be generated.int randomArray[maxTurns]; // Array that will store the random numbers for the gameint inputArray[maxTurns]; // Array that will store user input

...alone is 400 bytes of memory. How much SRAM does the ATtiny44 have?

Like it has been said, not enough RAM available...Most of your variables can be changed to byte instead of int. Also I noticed, that you constantly write to eeprom in loop(), considering the eeprom have a life of only 100.000 write/erase operations, I think it's a bad idea!

You can use the Arduino Enhanced IDE and it will report a warning if you use too much memory

Thanks for the quick replies, everyone. I don't know how I missed that. I temporarily brought the arrays down to 50 instead of 100 and sure enough, it works fine now that it's not using as much memory.

const int maxTurns = 100; // The maximum number of random numbers that will be generated.int randomArray[maxTurns]; // Array that will store the random numbers for the gameint inputArray[maxTurns]; // Array that will store user input

...alone is 400 bytes of memory. How much SRAM does the ATtiny44 have?

Can the arrays be changed to an eight bit data type?

Well, I'm not sure to be honest. My technical knowledge of the different data types and their memory footprints is fairly basic. Would it be as simple as changing the 'int' to 'byte', or is it more complicated than that?

Like it has been said, not enough RAM available...Most of your variables can be changed to byte instead of int. Also I noticed, that you constantly write to eeprom in loop(), considering the eeprom have a life of only 100.000 write/erase operations, I think it's a bad idea!

You can use the Arduino Enhanced IDE and it will report a warning if you use too much memory

Yeah, I started using the EEPROM to get a better random seed. I guess my analog pins were grounded too well on my PCB, because I wasn't getting anything by using them. Basically it just keeps track of how far into the sequence the user gets, then adds that to the value already in the EEPROM. This creates a somewhat random number that I can use for a seed. Another user suggested an even better way using a timer, so I may try that out as well. I was aware of the 100,000 operations limit, but I don't think most people would actually hit that limit. People might get, max, 15-20 turns in before failing, so it'd take 5000-6500 games played to exhaust the limit. Still, I might go with the timer solution just in case.