Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 16 Dec 2006 03:31 AM by
Problem in using I2c Bus
 0 Replies
You are not authorized to post a reply.
Author Messages
New Member
New Member

16 Dec 2006 03:31 AM
    I am trying to interface a keyboard with the dev kit through the MAX7349 controller using the I2C module of the 79524.
    I have taken connection form Expansion slot J38's pin 57 (MFP23,K2) as SCL and pin 58 (MFP24,K3) as SDA

    I first wrote a small C program in Logic Loader but when I tried to access the MUXCTRL4 register to define I2C for the i/o pins, I get a segmentation fault. What am I doing wrong?
    So instead I tried to create a small module inside the Linux kernel. This is what I do inside the code (I am writing directly to the internal registers of the 79524 and not using any other software routines provided in the kernel.

    To configure PA7 as SCL, i have set MUXCTL4 (addr 0xfffe5018) register's pin 11 : 10 = 1 : 1 and
    To configure PA6 as SDA, i have set MUXCTL4 (addr 0xfffe5018) register's pin 9 : 8 = 1 : 1
    To configure this registers as pull-up, i have set RESCTL4 (addr 0xfffe501c) register's pin 11 : 10 = 1 : 0 and pin 9 : 8 = 1 : 0
    and then set ICCON register mode with 7 bit master mode (10), enable with 1, & speed with std mode (0)
    and ICHCNT register with 0xc9 and ICLCNT register with 0xec

    I set the ICDATA register to the 7-bit address of the slave/peripheral I2C device with a read/write control bit set to 1 (for reading)
    (8bit value7 bit Address + Read/Write bit)

    Then I initiate an I2C transaction by setting the Start bit in the ICCON register.
    Next I set the ICDATA register to the command byte( select the type of register to read from the peripheral device)

    I wait till the IDLE state in the ICSTATUS register becomes 1 again.

    However no data seems to be read back to the ICDATA register. (It still contains the command byte rather than the value of the command register of the peripheral device). The above instructions are written in a kernel level program. In this case we are able to access all the registers. But no I2C transaction seems to take place.

    Can someone point out what I need to do in order to get the I2C module in the 79524
    You are not authorized to post a reply.