On Sep 8, 2005, at 5:36 PM, Gerhard Fiedler wrote: >> Traditionally, logging serial data at 115200bps to anything other >> than ram is relatively difficult. > > This is not a continuous 115.2kbps data stream. The data rate averaged > over > a few seconds is probably less than 500 bytes per second. With a few k > of > buffer RAM Flash storage should be possible Should be... > >> most "storage" code isn't very happy being interrupted every 100us >> either. > > Why is that? I never had problems with my storage code being > interrupted... > Usually it is not a problem checking back a bit later. > I think it's because turning off interrupts is the easiest way of ensuring exclusive access to a resource that you're quite sure is not reentrant. For instance, if you start that block write to the flash or floppy, you sure don't want anything else coming in and trying to use the flash/floppy while you are doing so. The easiest way to do that is to sit there in a busy loop with interrupts disabled. Sure, with a little discipline and some systems design, you can guarantee and trust that your serial driver will never touch your flash memory, but frequently that discipline is lacking. Long ago I worked on a serial data logger for DOS (to floppy, IIRC.) What a PITA that was. The serial code wanted to initiate a write to floppy from the ISR (after all, not multithreading or multiprocessing in DOS above the ISR level), but went through hoops trying to ensure that it didn't do so if the foreground DOS program was already withing a DOS system call of any kind (all of which has rather unpredictable characteristics WRT reentancy!) BillW -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist