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.

Howto use PSP I2C module



I've spent several days pouring through examples, docs, specs, and internet searches.  But I cannot find the information I need.

Using a 6748 evm I am trying to simulate throughput for our project.  Part of this is sending blocking of data through the I2C.  I have modified the i2csample to more or less match but it is performing very poorly.  It takes over a second to transfer 40kb of data.  This is 10+ times slower than one would expect.  I do not understand how the clock is setup, and how transfers work, using the PSP I2C module.  And I cannot find the information anywhere that I look.

I2C.h contains all the definitions but no usage information. 

I2C.h contains the mysterious "I2c_peripheralClkFreq" that is referenced once in the wiki but really never explained.

i2csample_main.c contains the equally mysterious statement "i2cParams.busFreq = 200000".  "i2cParams.busFreq" cannot be found anywhere online (that I have searched...)  One would guess that 200000 means 200kb/s.  In that case 40kb should take 200ms to transfer.  And if I change it to 400000 will it -really- take effect?

Is there any other PSP I2C software information out there?  Or examples?  Or anything?

  • Hi,

     

    The PSP package has two examples to demonstrate the interrupt mode of operation. It would be better to use EDMA mode of operation. Also the example demonstrates only a (max) transfer of 4 bytes per transaction, since you are using it for large amount of data transfer, you will typically need to increase the size of buffer per transaction to get improved throughput.

     

    I2cParams.busFreq = 400000; will program the frequency of i2c to 400KHz.This should also help with your throughput numbers

     

    For through put information please refer to the "C6748_BIOSPSP_Datasheet.pdf" . you can also refer to the "C6748_BIOSPSP_Userguide.pdf" for the usage of the i2c peripheral. please let me know if you any other queries

     

    Regards,

    imtiaz

     

     

  • Hi Kurt Jensen

    Kindly let me know the PSP release  version you are using?

    Please confirm if any modifications were done on the sample application (ofcourse except the ones related to 40Kb transfer) during your tests.

    Thank you

    Regards

    Vichu

  • I searched the web for "C6748_BIOSPSP_Datasheet.pdf" and "C6748_BIOSPSP_Userguide.pdf" with no results.  Please post a link.

    P.S.  I do not understand how changing "i2cParams.busFreq=400000" could ever work.  1) This statement is after the call to I2c_init().  2) The documentation, sprufl9a, states that changing the clock dividers will not have any effect unless the I2C module is in the reset state (IRS=0 in ICMDR).

  • pspdrivers_01_30_00_06

    .far (wBuffer) segment moved to DDR

    I created two copies of wBuffer, wBufferON and wBufferOFF. 

    I initialize"wBufferON[0] = I2C_EXP_CMD_WRITE_PORT0", and fill the rest of wBufferON with 0x00.

    I initialize "wBufferOFF[0] = I2C_EXP_CMD_WRITE_PORT0", and fill the rest of wBufferOFF with 0xc0.

    I changed ledBlink() and i2cExpander_WritePort0() to alternately write wBufferON then wBufferOFF to the I2C.

  • Hi,

    You should be able to get the documents from your psp drivers installation directory

    they wil be located at <installdir>/pspdrivers_01_30_00_06/docs/C6748.

    Also please note that the latest version of PSP drivers is 01.30.01

    regards,

    imtiaz

  • That's it!  Hopefully...  I was not looking in the right DOC folder.

    Thanks.

     

    and...I just spent another 20 minutes searching google and TI.  Please...post links.  Please post a link to the PSP 01.30.01 download.

  • I traced through the I2C.c source and now understand how the clock is computed and configured when the channel handle is created.  Sorry.  I just couldn't see that far until I asked the question...

    This still leaves the question of why it is going so slow.  I'll read the Datasheet and User Guide.  Any new ideas will be much appreciated!  TIA!

  • Hi,

    The link for the BIOS PSP download is given below

    http://software-dl.ti.com/dsps/dsps_public_sw/psp/BIOSPSP/index.html

    regards,

    imtiaz