I am running a program on the ATtiny and for some reason I am way over the 512 bytes of RAM that are available to me. This is confusing because when I did the math by hand I should have 432 bytes. Here is my code:
#include <SoftwareSerial.h>
#define FASTADC 1
// defines for setting and clearing register bits
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
SoftwareSerial mySerial(0,1); //This uses 47 bytes of RAM
byte i = 0; This uses 1 byte of RAM
byte pixelsArray1[128]; //Arrays use 128 bytes of RAM each
byte pixelsArray2[128];
byte pixelsArray3[128];
void setup()
{
#if FASTADC
// set prescale to 16
sbi(ADCSRA,ADPS2);
cbi(ADCSRA,ADPS1);
cbi(ADCSRA,ADPS0);
#endif
pinMode(1,OUTPUT); //Setting the 1 pin to be used for output
pinMode(0,OUTPUT); //Setting the 0 pin to be used for output
pinMode(A3,INPUT); //Input for Camera 3
pinMode(A2,INPUT); //Input for Camera 2
pinMode(A1,INPUT); //Input for Camera 1
mySerial.begin(9600); //Setting the data transfer rate
}
It's telling me that I am using 510 Bytes of memory but my math gave me 432 bytes of RAM. Does anyone see what I'm missing?