Sure! I'm out of town right now, but I'll see what I can do tomorrow when I get back. I'm doing this on a pic32. What processor are you using? Harold > Harold, > > It sounds like similar to what I was thinking to do. Can you share the > code? > I just want to see how things are done. how do you keep track of counts > and > locate next log? are you using FAT file system? > > thanks > > Andre > > > > ________________________________ > From: Harold Hallikainen > To: Microcontroller discussion list - Public. > Sent: Wed, March 30, 2011 8:18:27 PM > Subject: Re: [PIC]: what's the best way to save large data in flash > memory > > I'm doing something like what you described. I'm suing a 2MB SPI flash to > do logging in a system. I save 64 byte records sequentially. I keep track > of the address I'm going to write the next record to. I have a function > called FlashStreamProgram. I pass in the starting address, a pointer to > the data I want to write, and the number of bytes to write. Every time th= e > FlashStreamProgram detects we have gone over a sector boundary and need t= o > erase, it does so before moving on. I pull the data back by reading an > array similarly. When reading the log, I specify a log record number, > which converts to an address, then gets the log record. On power up, when > the system does not know where the next log record would go, it scans > through memory starting from the bottom looking for the first erased > record (0xff in all bytes). It then uses this as its next llog address. > > Harold > > > > > > -- > FCC Rules Updated Daily at http://www.hallikainen.com - Advertising > opportunities available! > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > > > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .