picaxe with eeprom memory

peter howarth

New Member
is it possible to program any picaxe with a suitable eeprom, that records and displays accumulated minutes and hours from an input..onto an oled.. the application is for an irrigation pump that might run for 6 hours one day, then 4 hours the next day, then 3 hours on day 3, etc etc..when the 5 volts supply to the picaxe and eeprom is switched off on the first day, back on the second day etc, the eeprom accumulates the input active time, without the need for a memory battery of any sort..
 

papaof2

Senior Member
Depending on how long you plan to collect data, you might want to look at the FRAM chips (Ferromagnetic Random Access Memory) - basically ancient core memory in a chip. You'll need an I2C capable PICAXE to talk to the FRAM but it is probably the static memory chip with the greatest number of read/write cycles.
If you want accurate time, you probably also need one of the RTC modules - they also speak I2C. The easiest to read data would be something like 210927.1013.n for on and 210927.1427.f for off. The "." is optional but makes it easier for humans to read if you display it. If you plan to send it to a comuter, just skip the "." unless you're putting it in a spreadsheet in which case that should be "," for CSV format.
Remember that the PICAXE could read the FRAM and spit out almost any format. In this format, year, month, date, hour, minute, on/off are each one byte - two more bytes if you store the "." or "," but the PICAXE can put those in as it reads out data from the FRAM, if needed.
You will have this programmed by the end of the day, won't you? ;-)
 

westaust55

Moderator
If you are going to add an RTC then higher accuracy versions such as the DS3232 include around 256 bytes of battery backed RAM and if needed alarm settings with interrupts. The RTC battery keeps the time running and the RAM data retained which can avoid the need for external EEPROM or FRAM.
 

lbenson

Senior Member
How much eeprom do you need? If you just need the number of 6-minute periods per day (60 minutes times 24 hours divided by 255 rounded up is 6) then the standard 256 bytes of eeprom on current PICAXE chips would allow you to store 256 days worth. If you need minutes per day, then 128 days worth.

If you need to time-stamp the run times, then a bigger eeprom could be needed. DS3231 modules like this include AT24C32 eeproms. If you search the forum for AT24C32, you should find example code.
 
Top