Hi,
I am trying to read and buffer LPT printer port data by a 18F452 @ 40MHz. The application is a parallel to serial converter. I am using INT_0 high priority interrupt to read the strobe (falling edge) signal and capturing the data via portd. As soon as I fall into the ISR I clear the INT_0 flag , locate the address (which array what location) where to store the data and return ( RETFIE FAST ). I have found that creating a software indexed array addressing method eats up instruction cycle time. (I haven't counted my instruction cycle time, but I am loosing data). So rather than using 5 different arrays I plan to use a single array starting from Bank1 through Bank5.
So my questions are:
1. Is the post increment method the best here ?
2. While in the interrupt if the INT_0 flag gets set can I loop around my ISR before quiting ?
3. How to define and access my array (1280 bytes @ 8bit data buffer) ? Cause without a software index I don't know where was it left and what has been already transmitted serially and what pending ?
4. Can somebody help me with the LPT port timings to decide if it is at all possible with a PIC ?
5. Would it be beneficial to use the PSP port ?
I am counting on the Gurus out there and I am desperate even to overclock the PIC to 48MHz. Please help.
Bookmarks