ASM Addressing method help needed


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563

    Unhappy ASM Addressing method help needed

    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.
    Last edited by sougata; - 28th January 2007 at 15:34. Reason: Added question no. 5 PSP mode
    Regards

    Sougata

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Some progress

    Hi,

    Well I have limited my buffer and checking the FSRH bit 2 and stopping to grab setting a bit buffer full. Then in my main PBP routine I am starting the TX dump. Checking only a single bit in the FSRH saves instruction cycle as I am worried that I will loose data. Anyway round if my incoming data is greater than my buffer then I am going to loose it. However I intended to setup a ring buffer so that my buffer is releived when the incoming data stream is less.

    Still counting on the Gurus and waiting for a Monday morning.
    Regards

    Sougata

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. Quadrature encoder and ASM Interrupts. questions..
    By godfodder in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th March 2013, 14:45
  3. PBP, ASM and LST files
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th January 2010, 13:43
  4. ASM help
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 21st October 2009, 03:08
  5. Problem with ASM IRQ using FSR0 on PIC18F252
    By mytekcontrols in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 11th March 2008, 20:48

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts