Hello,
Does anyone had troubles writing more than 256 byte to EEPROM?
If i write less than 256 bytes everything is ok, but when i try to write more
it stops at 13.
I'm using an ATMega 328P with Optiboot as an Arduino UNO, but the same behavior
i get on a Duemilanove
void RomWrite(unsigned int Idx,unsigned int Val)
{
Idx *= 2;//int is 2 bytes
EEPROM.write(Idx + 1,Val & 0xFF);
Val/=256;
EEPROM.write(Idx + 0,Val & 0xFF);
}
void ResetEEPROM(int idx)
{
RomWrite(idx + ROM_Sequence, 0);//Sequence Off=0/On=1
RomWrite(idx + ROM_SDelay, 10);//Sequence Delay 0-9999[ms] between Shutter1 and Shutter2 if ROM_Sequence=1
RomWrite(idx + ROM_Bulb, 60);//Exposure in Bulb Mode[s] 0-3599
RomWrite(idx + ROM_BulbProc, 120);//Processing time in Bulb Mode[s] 0-7199
RomWrite(idx + ROM_TLH, 0);//Timelapse Hours interval [h] 0-23
RomWrite(idx + ROM_TLM, 0);//Timelapse Minutes interval [min] 0-59
RomWrite(idx + ROM_TLS, 30);//Timelapse Seconds interval [s] 0-59
RomWrite(idx + ROM_TLW, 1);//Timelapse WakeUp interval - activate camera focus to get it out from standBy [s] 0-59
RomWrite(idx + ROM_TLB, 0);//Timelapse UseBulb 0=No/1=Yes (setting from bulb menu)
RomWrite(idx + ROM_TLN, 5);//Timelapse Number of Frames 0-999
RomWrite(idx + ROM_S1_TrigAt, 0);//Sensor1 trigger at 0=Low/1=High Value
RomWrite(idx + ROM_S1_Threshold, 512);//Sensor1 trigger value 0-1023
RomWrite(idx + ROM_S2_TrigAt, 0);//Sensor2 trigger at 0=Low/1=High Value
RomWrite(idx + ROM_S2_Threshold, 512);//Sensor2 trigger value 0-1023
RomWrite(idx + ROM_D1_TrigBy, 0);//Device1 is triggered by 0=None/1=Sensor1/2=Sensor2
RomWrite(idx + ROM_D1_Delay, 10);//Delay between Device1 and his trigger [ms] 0-9999
RomWrite(idx + ROM_D1_Cycle, 100);//Device1 Period to wait until next picture[ms]0-9999
RomWrite(idx + ROM_D2_Mode, 0);//Device2 type 0=None,1=Camera,2=Flash,3=Split
RomWrite(idx + ROM_D2_TrigBy, 0);//Device2istriggeredby0=None/1=Sensor1/2=Sensor2
RomWrite(idx + ROM_D2_Delay, 10);//Delay between Device2 and his trigger [ms] 0-9999
RomWrite(idx + ROM_D2_Cycle, 100);//Device2 Period to wait until next picture[ms] 0-9999
RomWrite(idx + ROM_D2_SpitTime, 10);//Delay between Device2 Shutter and Device2 Focus
RomWrite(idx + ROM_HDR_Exp, 45);//This is the index of Exposure time in HDR mode [ms] from the array
RomWrite(idx + ROM_HDR_Inc, 11);//0-11 Size of EV
RomWrite(idx + ROM_HDR_Img, 3);//3-17No of frames in HDR Mode
RomWrite(idx + ROM_Target_Dist, 100);//0-9999 [cm]
RomWrite(idx + ROM_Gravity, 0);//0-Off 1-On
RomWrite(idx + ROM_Drop1_Size, 80);//0-999 [ms]
RomWrite(idx + ROM_Drops_Delay, 0);//0-999 [ms]
RomWrite(idx + ROM_Drop2_Size, 0);//0-999 [ms]
RomWrite(idx + ROM_Photo_Delay, 200);//0-999 [ms]
RomWrite(idx + ROM_Contrast, 50);
RomWrite(idx + ROM_BtnDelay, 5);
RomWrite(idx + ROM_ClipLen, 60);//0-999 [s]
RomWrite(idx + ROM_FrameRate, 25);//0-60 [frames/sec]
RomWrite(idx + ROM_FrameInterval, 5);//0-999 [s]
RomWrite(idx + ROM_ClipHDR, 0);//0=Off; 1=On
RomWrite(idx + ROM_HDRBtnDelay, 1000);//0-5000 [ms] how long a button will be kept pressed
RomWrite(idx + ROM_DelH, 0);//Time to wait before shooting[h]0-23
RomWrite(idx + ROM_DelM, 0);//Time to wait before shooting[min]0-59
RomWrite(idx + ROM_DelS, 0);//Time to wait before shooting[s]0-59
RomWrite(idx + ROM_MLU, 0);//Mirror LookUp
RomWrite(idx + ROM_MLU_Delay, 100);//Wait time for vibrations to end 0-999[ms]
}
where idx is 0, 1 or 2