From: Jonathan B. <jbr...@ea...> - 2005-07-22 02:35:44
|
On Thu, 2005-07-21 at 20:58 -0500, Terry Frederick wrote: > Would anybody help me get started? I need to bring 16 bits of data > into the gumstix at a rate of 1 Million 16-bit samples per second. I > have an additional 1 bit signal that tells me when the data is valid. > I'd like to interrupt on the "valid data" signal, and then capture the > 16-bit data to a buffer. When the buffer gets full I want to signal a > program in the XScale to process he data, and then start storing new > data into a second buffer while processing the first buffer. I can > reduce the 1 Million 16-bit samples per second requirement some, but > that's my goal. I'll warn you now that getting a consistent < 1 us interrupt latency will be extremely (maybe impossibly) hard. You should seriously consider using a hardware interface that will do some level of buffering and DMA work for you, like the NSSP. That will reduce you interrupt load considerably, but you will still fall short of your bandwidth criteria. > I plan on building a device driver to handle the interrupt, and to > buffer the data. I plan on a user mode program to process the data, > and a usr_signal sent by the driver to trigger the user code. Would a > semaphore be better? I have one of the breakout-gs boards, and from a > cursory examination of the PXA255 developers manual it looks like the > LCD ports can be set up as GPIO'S, so until I find a problem I plan on > using the LCD GPIO's for the 16 bit data. I don't know which pin to > use for an interrupt pin. To the best of my knowledge, you can't gang up a group of the GPIO's to make a parallel bus, at least not with the bandwidth you're talking about. Maybe someone knows if the connex allows you to do 16-bit addressing? Since I'm not using an LCD in my work, I use the LCD pins for scrap GPIO. It is very easy to make your interrupt pin runtime-configurable. You can just choose a pin from whatever auxiliary device you aren't using right now, and it will be easy to reconfigure your software if your hardware choices change. > > I've done this stuff before, but I'm new to Linux, and to the PXA255. > Does any of this approach sound bad? > > Does anyone know of any sample code that does anything like this? I've got some code that received GPIO interrupts, but does other things with the information. It will be going into the buildroot in the near future; you can download it here in the meantime: http://www4.ncsu.edu/~jdbrandm/gumstix-pwm.tar.gz HTH, -Jonathan |