> > Wade Carpenter wrote: > > > > >Hello everyone! > > > > > >I have run across the problem that I need to do some high speed sampling. High speed I mean in terms of the PIC. Running my 876 at max speed of 20MHz, I have not too much time to do things if I want to sample at 500Khz. And an analog signal at that. The good part is, I only need low analog resolutions (maybe 4-bits) so I was going to build a flash ADC from discretes; 4 bit parallel ouput faster than I can handle. > > > > > >But I have to read continuously 128x128 pixels, store it in memory, and THEN transmit it via very slow serial to a PC (wireless!). > > > > > >Now my PIC has 368 bytes of RAM - slight conflict of interest here. > > > > > >So I was considering a 16K SRAM (128x128 = 16K). Does anyone have any suggestions?? Would this be easy enough to implement? Ie connect my 4bit adc on port A, read the whole thing and write it parallel via port B to an SRAM.. that should take less than my 5 allowed instructions =) I hope!! unless the SRAM is really complicated.. but I hope not.. I only really know of SRAM and DRAM, but I know that DRAM will not do the trick =) No chance to refresh anything here! > > > > > Is my math wrong? The instruction clock at 20 Mhz is 5 MIPS. So each > instruction cycle is 200ns. Right? 500Ksamples occurs at a rate of 1 every > 20 uS. So 20 uS/.2 uS -> 100. So there's actually 100 instructions available > between each sample. > > Did I miss something? Duh. I missed a zero. 500KSamples is one every 2 uS. So there are 10 instructions inbetween each sample. That should be enough time to transfer the data directly from the A/D to the ram, restart the ADC, and increment the RAM address. Does the A/D have a Data valid output? You may be able to use it to autowrite to the RAM.... BAJ -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads