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.

I2C using CCS

Genius 4530 points

Other Parts Discussed in Thread: TMS320DM6446

Hi,

I am working on developing a code for I2C on DM6446EVM board using CCS (not using Linux)

I am facing the following problems-

1. When I write 1 byte of data to the output LEDS, on running the program using CCS + emulator, I dont get an output on the LEDs. But when I disconnect the emulator, I get valid output on the LEDs.

2.TO debug this, I checked the memory map of the processor, and found that the I2C registers are being written to correctly. But the same data is reflected in the subsequent reserved registers of the I2C and that to periodically with a gap of 80h addresses in between.

3.Does this have anything to do with my cmd file? What can I do to solve this problem?I am using I2c in master transmitter mode.

Thanks and Regards,

Sidharth Garde

 

  • Sidharth Garde said:
    2.TO debug this, I checked the memory map of the processor, and found that the I2C registers are being written to correctly. But the same data is reflected in the subsequent reserved registers of the I2C and that to periodically with a gap of 80h addresses in between.

    3.Does this have anything to do with my cmd file? What can I do to solve this problem?I am using I2c in master transmitter mode.

    This is unlikely a problem with your .cmd file, though I have not looked closely at the I2C peripheral in particular it is not unusual for values to appear mirrored in reserved locations in memory, I would not be suprised if the I2C register space wraps a few times before the next peripheral's register space begins (like if you had a memory with fewer address pins than the bus that was accessing it). Essentially I would ignore the values that you read back from reserved spaces as they will generally provide little to no insight into the actual issue. For the issue at hand, based on the symptom of it working as soon as you disconnect, my first thought would be to try setting the FREE bit in ICMDR as discussed in section 3.9 of SPRUE27.

  • Hi Bernie,

    Thanks a lot !!!![:)]

    Its working now.

    Sidharth

  • Hi   Sid

     I have  some quertions to ask .

    1.           How to  power  on  I2C module ? 

                   P.72 on "tms320dm6446  ARM  subsystem .pdf"(Rev. B)) says I2C module is alwayson.

     

    2.          I configure  Module Control  18 Register (I2C)  (MDCTL18,address= 0X01c41a48)   ,   the value is 3h.  

                 Have  I t urn on  I2C module's clock ??

    3.          I use 27M  crystal .    And  I configure  ICPSC = 2 h    ICCLKL = 28h    ICCLKH = 28h

                 But  when  I test  the clock on C4 pin of  DM6446  .   I get  27 MHz .

                  ICPSC ,   ICCLKL  and   ICCLKH    do not  work .  Why ?

    Thank you !! 

  • Hi Wang,

    I assume you are using CCS to interface your I2C module with DM6446.

    Have you turned On the corresponding bit in CKEN (PLL Controller 1 Clock Enable Register) which controls the I2C clock ? I think it is the LSB bit.

    Make Sure it is turned ON, because it controls the PLL which generates appropriate I2C clock

    Regards,

    Sid