I'm facing a conceptual dilemma, many of the gurus here and elsewhere = recommend to keep interrupt code to a minimum. That's what I'm trying to = do, but I'm having some serious problems to transfer data gathered at = the interrupt procedure and use it on the main loop. The interrup is receiving a constant stream of UART data at 19200baud = (it will be faster as soon as I get the appropriate crystal). What I = have to do is to interface with my compactflash card and store each one = of those bytes in it. I intend to store data as FAT files (I know, 512 = bytes blocks). Thing is when I'm trying to process something on the main = loop, things are coming at a faster rate on the interrupt. One thing I've tried was to setup a circular list of 64 bytes, push data = on the interrupt and pop it on the main loop, it didn't work. Then I've = increased the circular buffer size to 128, then I started to see some of = the expected bytes on my CF (actually I'm sending them via USART to the = PC just to test, but I'll replace to writing to the CF later). When I = increased to 255, then almost got it, but still the interrupt was = winning the race. I feel that if I had a big enough buffer, eventually = it would work out, but perhaps there is a better way to solve it. Should I put all my CF writing code in the interrupt procedure? Would I = be risking to get overrun errors? I have to confess, I'm enjoying learning all these new things about PIC = and electronics, but sometimes it's frustrating, things don't happen at = the same speed of software development... or I'm too impatient to be a = newbie again. Thanks again! Padu _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist