Capture Qei position and send to usb

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by AmirHejazi on Thu Jan 31 14:24:37 MST 2013
I want to draw graphs of position of 2-phased QEI versus time, using LPC1768. it is important to draw transient state between ON & OFF (to find step response!). An ENCLK_Int interrupt occurs at the every transition of the encoder and the firmware sends the timer value to USB.
I have written some codes. but FILE_Open, FILE_Write and FILE_Close are too slow to run in the QEI ISR, so i have send the data to a buffer and send them in batch.
but i don't know how to do it! :-|
how can i buffer the data? should i use an auxiliary register?
how can i detect that number of bytes written in QEITIME(or auxilary Buffer) is 512?
should i pend the interrupt to send the data(buffer) to USB? (cause the usb functions are too slow)

Best Regards