I built a logic analyzer many years ago that used an oscillator that would increment the address counter of some dual port cache RAMS. You could capture using one port of the ram chip, and output the data on the other port. The dual port rams were from Cypress IIRC, and I believe they were 128K x 9. I used the 9th=20 bit as a trigger capture bit. After the capture, I would then send the captured data out to the PC for display. It worked well. You might try looking at some of these RAM chips. Again, IIRC, they would work=20 up to about 60 Mhz or so. Regards, Jim > -------- Original Message -------- > Subject: Re: [PIC] PIC32 USB - for logic analyzer > From: "Harold Hallikainen" > Date: Thu, September 29, 2011 10:19 am > To: "Microcontroller discussion list - Public." >=20 >=20 > I built a "logic analyzer" many years ago. I used the printer port on a > Cromemco CP/M computer as the logic inputs. I watched for a change in the > byte I read from the port, then saved the new value to memory and bumped = a > pointer. Once I had finished a capture, I printed out all the data in > binary, one byte per line. I used this to reverse engineer the serial bus > on a Commodore 1541 floppy disk drive. >=20 > For your application, I think it'd be easier to add external RAM to use > during capture, then send the data after capture. I've got a project usin= g > a 1MB static RAM that's easy to interface to. I used it on a PIC24 which > did not have the parallel master port, so I bit banged it. On the PIC32, > you could use the PMP for a fair amount of the work (though you'd have to > manually control higher address lines). >=20 > Here's some of my UsbTask code from a project: >=20 > if(!USBHandleBusy(USBGenericOutHandle)){ // If it's safe to look at > the receive buffer > if(count=3DUSBHandleGetLength(USBGenericOutHandle)){ // if there= 's > something in the receive buffer > if(count<=3DpUsbRxFifo->BytesFree){ // we have room in the fifo > index=3D0; > while(count--){ > PutFifo(pUsbRxFifo,OUTPacket[index++]); // get data from > usb buffer to fifo > } > USBGenericOutHandle =3D > USBGenRead(USBGEN_EP_NUM,(BYTE*)&OUTPacket,USBGEN_EP_SIZE); // > ok to read more > }// endif we had room > }// endif there was something there > }// endif not busy > if(!USBHandleBusy(USBGenericInHandle)){ // 0 if ok to transmit > if(count=3DpUsbTxFifo->BytesInBuf){ // we have something to send > if(count>=3Dsizeof(INPacket)){ > count=3Dsizeof(INPacket); // limit how many bytes we se= nd > to size of output buffer > } > index=3D0; > NumBytes=3Dcount; // remember how many bytes we're sending > while(count--){ > INPacket[index++]=3DGetFifo(pUsbTxFifo); // fill the transmit > buffer from the fifo > } > USBGenericInHandle =3D > USBGenWrite(USBGEN_EP_NUM,(BYTE*)&INPacket,NumBytes); // send the > bytes > } > } >=20 >=20 >=20 > Harold >=20 > --=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 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .