2011-10-14 05:27:48     Need Help with some PPI realtime problems!

Document created by Aaronwu Employee on Aug 28, 2013
Version 1Show Document
  • View in full screen mode

2011-10-14 05:27:48     Need Help with some PPI realtime problems!

Martin Wiedemann (GERMANY)

Message: 103866   

 

Hello together,

 

i tried to ask this the developer of the userspace bfin_ppi driver but it seems his mail john.dehority@kodak.com is not available anymore. So I hope someone here in this forum can answer my simple question.

 

I think I got ppi working with the userspace driver and I am able to receive some data.

In my case I collect a 32byte array which is sended in a very high frequency.

Now I have seen a problem and need some advice.

The 32byte datas have a counter in it and this tells me that some of the 32byte packets are not received!

I think my problem is in the userspace, where I can setup a 32byte read command, then I wait until they are received because the read() command is blocking, and then I start the next read() command after I put a new buffer in the command. The work with the data will do another thread. But linux is not realtime in the userspace (blackfin about 20ms task scheduling). It seems there is too much time between the read commands. I loss there some data and the PPI driver has no internal buffer which I can activate (correct me if I am wrong).

 

I am using nearly the sample code of the userspace driver:

while (!done1)

    {

        //wait for trigger

        bytes_read = read( ppiFD, (char *)&gImage[0], 32 );

        //printf ("data reading complete....\n");

        if ( (*gImage & 0x07FF) == 0x06ad )

        {

            done1 = 1;

        }

        else

        {

            count++;

        }

    }

 

Can you tell me if there is a solution to activate a PPI buffer so I can read 32byte with the userspace driver?

 

I would be happy about any solution you can give me because I do not know where I should begin to solve this!

 

best regards

Martin

 

ps. this is my config

 

CfgTable ppiSlaveTable1D[] =

{

     { CMD_PPI_XFR_TYPE, CFG_PPI_XFR_TYPE_NON646 },

     { CMD_PPI_PORT_CFG, CFG_PPI_PORT_CFG_XSYNC1 },

     { CMD_PPI_FIELD_SELECT, CFG_PPI_FIELD_SELECT_XT },

     { CMD_PPI_PACKING, CFG_PPI_PACK_DISABLE },

    { CMD_PPI_SKIPPING, CFG_PPI_SKIP_DISABLE },

     { CMD_PPI_SKIP_ODDEVEN, CFG_PPI_SKIP_ODD },

     { CMD_PPI_DATALEN, CFG_PPI_DATALEN_16 },

     { CMD_PPI_CLK_EDGE, CFG_PPI_CLK_EDGE_FALL },

     { CMD_PPI_TRIG_EDGE, CFG_PPI_TRIG_EDGE_RISE },

     { CMD_PPI_SET_DIMS, CFG_PPI_DIMS_1D }, //

     { CMD_PPI_LINELEN, 16 },

     { CMD_PPI_NUMLINES, 1 },

     { CMD_PPI_DELAY, 1 },

     { CMD_PPI_SETGPIO },

    { 0,0 }

};

TranslateQuoteReplyEditDelete

 

 

2011-10-16 23:04:29     Re: Need Help with some PPI realtime problems!

Scott Jiang (CHINA)

Message: 103883   

 

  blackfin.uclinux.org/gf/project/uclinux-dist/forum/?_forum_action=ForumMessageBrowse&thread_id=46457&action=ForumBrowse&forum_id=39

QuoteReplyEditDelete

 

 

2011-10-17 01:01:37     Re: Need Help with some PPI realtime problems!

Sonic Zhang (CHINA)

Message: 103888   

 

  docs.blackfin.uclinux.org/doku.php?id=faq&#common_questions_about_kernel_settings

Attachments

    Outcomes