This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to get UPP to perform *contiguous* block transfers

I'm having trouble getting the Universal Parallel Port (UPP) to make contiguous block transfers.  (Using the  c6748 on the LogicPD EVM board.)

Here is my code:

 #define BLOCK_LENGTH    0xFFC0
// This load the address of the data buffer
UPP->UPID0 = (uint32_t)&data_buffer;                                    
// This calls for 2 lines of BLOCK_LENGTH bytes to be transferred
UPP->UPID1 = BLOCK_LENGTH + 0x00020000;                 
// Offset between lines -- so the data should be contiguous in memory
UPP->UPID2 = BLOCK_LENGTH;                                            

Unfortunately, my UPP is not offsetting the blocks of data into contiguous memory locations.  Instead, it overwrites the previous memory locations (and leaves the trailing memory locations empty). The memory then contains only the last block of data, following by many unfilled memory locations. 

When I change solely the number of lines to 1 (as with the last line of code as UPP->UPID1 = BLOCK_LENGTH + 0x00010000), then the UPP transfers only one block of data, and does it correctly.  In other words, my code works properly when transferring one block of data, but not for multiple block transfers.

What am I doing wrong?

  • Through trial-and-error, I discovered two things (both undocumented) that seem to provide an answer.

    1)  The UPP seems to be triggered only when a specific one of the three control registers is loaded. That is, the UPP->UPID2 registor triggers the UPP to begin its data transfers.

    I discovered that if this register (of the three) is loaded first, then the UPP will not begin its transfers until this register is loaded again (a second time). In fact, I found the following sequence of events can occur:

    Load UPID2;
    Load UPID0;
    Load UPID1;
    RESET the UPP, (using the correct process of disabling, software reset, enabling ,etcetera, with all its peculiar timing requirements);
    Load UPID2;
    THEN THE UPP BEGINS ITS DATA TRANSFERS!!!

    This strange behavior is not documented in the user manual.

    2) Just as strangely, I discovered that my problem (discussed in my previous post) can be cured by reducing the byte-count and the offset. My problem occurs when these are set to 0xFFC0, and the problem disappears when these are set to 0x7FC0.  It appears there exists a threshold (perhaps related to the most significant bit?), which causes a problem. With this lower number, I can correctly get multiple block transfers into contiguous memory locations. This too is undocumented in the user manual.