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.

CC3200: I2C operations and on-board LED working

Part Number: CC3200

I am connecting Tiny RTC chip to cc3200 to set/get time though I2C on pin P01,P02 . It works perfectly fine, but when I configure on board LEDs and try to make then on and off, LEDs seem to work fine but set/get time function from RTC does not work. In pinmuxconfig(); I've given clock to the LED port and set them as output pin.AS per I know 2 LEDS of them are pulled up I2C. So How would  I achieve both I2C function and LED on-off?

Thanks. 

  • Hi Techinspired,

    On the CC3200 Launchpads, the green and yellow LEDs are routed to pins 2 and 1. With the PinModeSet APIs, you can either set pins 1,2 as GPIOs or as I2C, but not both at the same time. This is why when you set those pins as GPIOs, your I2C functions don't work and when you set than as I2C lines you can't control the LEDs with the GPIO APIs. You'll also notice that when using those two pins as I2C, the LEDs blink at random.

    To achieve the desired LED + I2C functionality, you need to mux out your I2C signals to some other pins. For example, you can mux them to pins 3,4 or pins 5,6. Take a look at section 16.7 of the TRM for a full list of possible pin mux settings for each pin.

    Regards,

    Michael

  • Hi Michael,

    Thanks  for your reply!

    I've routed my I2C signals to pin 3 and 4 resp. But still I'm not getting the RTC values. I have tried with pin 5 and 6 also but no success.My pinmux  fuction looks like this.Any other configuration did I miss?

    void
    PinMuxConfig(void)
    {
        //
        // Enable Peripheral Clocks 
        //
    
        MAP_PRCMPeripheralClkEnable(PRCM_GPIOA0, PRCM_RUN_MODE_CLK);
        MAP_PRCMPeripheralClkEnable(PRCM_UARTA0, PRCM_RUN_MODE_CLK);
        MAP_PRCMPeripheralClkEnable(PRCM_I2CA0, PRCM_RUN_MODE_CLK);
        MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK);
       // MAP_PRCMPeripheralClkEnable(PRCM_GPIOA2, PRCM_RUN_MODE_CLK);
        //
        // Configure PIN_64 for GPIOOutput
        //
        MAP_PinTypeGPIO(PIN_64, PIN_MODE_0, false);
        MAP_GPIODirModeSet(GPIOA1_BASE, 0x2, GPIO_DIR_MODE_OUT);
    
        //
        // Configure PIN_01 for GPIOOutput
        //
        MAP_PinTypeGPIO(PIN_01, PIN_MODE_0, false);
        MAP_GPIODirModeSet(GPIOA1_BASE, 0x4, GPIO_DIR_MODE_OUT);
    
        //
        // Configure PIN_02 for GPIOOutput
        //
        MAP_PinTypeGPIO(PIN_02, PIN_MODE_0, false);
        MAP_GPIODirModeSet(GPIOA1_BASE, 0x8, GPIO_DIR_MODE_OUT);
    
    
        //
        // Configure PIN_55 for UART0 UART0_TX
        //
        MAP_PinTypeUART(PIN_55, PIN_MODE_3);
    
        //
        // Configure PIN_57 for UART0 UART0_RX
        //
        MAP_PinTypeUART(PIN_57, PIN_MODE_3);
    
        //
        // Configure PIN_03 for I2C0 I2C_SCL
        //
        MAP_PinTypeI2C(PIN_03, PIN_MODE_5);
    
        //
        // Configure PIN_04 for I2C0 I2C_SDA
        //
        MAP_PinTypeI2C(PIN_04, PIN_MODE_5);
    }
    

    Best Regards,

    Techinspired

  • Hi Techinspired,

    I2C requires that you pullup the SCL and SDA lines to VCC. On the launchpad, pin1&2 have a 3.3k ohm pullup to VCC through jumpers J3 & J2 respectively. Try connecting pins 3,4 to those jumpers and seeing if you can communicate with your RTC chip.

    Regards,
    Michael