Questions and discussions about the software that runs on the TD RF module itself.
francois
 
Posts: 47
Joined: Tue Jun 16, 2015 6:13 am

I2C regressions when migrating from TD1208 to TD1508

by francois Sat Dec 03, 2016 7:38 am

Hi
We did manage the Firmware migration from TD1208 to TD1508. For both firmware we use SDK6 for building.
We observe some regression on I2C communications between the TD1508 chip and external I2C based sensors. We can not manage any I2C transfert.
Is there any change in the way to initialise or manage the I2C bus with the new TD1508 chip?

Here is what we use for initialization:

CMU_ClockEnable(cmuClock_I2C0, true);
GPIO_PinModeSet(I2C_SDA_PORT, I2C_SDA_PIN, I2C_SDA_MODE, I2C_SDA_DOUT);
GPIO_PinModeSet(I2C_SCL_PORT, I2C_SCL_PIN, I2C_SCL_MODE, I2C_SCL_DOUT);
I2C0->ROUTE |= I2C_ROUTE_SDAPEN | I2C_ROUTE_SCLPEN;
const I2C_Init_TypeDef init = I2C_INIT_DEFAULT;
I2C_Init(I2C0, &init);
I2C_Enable(I2C0, true);
I2C_BusFreqSet(I2C0,
0,
10000,
i2cClockHLRStandard);
ramon2015
 
Posts: 51
Joined: Mon Jul 06, 2015 4:06 pm

Re: I2C regressions when migrating from TD1208 to TD1508

by ramon2015 Wed Dec 14, 2016 3:45 pm

Hello,

I am findigng the same trouble with I2C transfers.
It worked OK in the TD1208 and it is not working in the TD1508.

Please, any suggestion would be very helpful.

Regards, Ramon.
User avatar
mstempin
 
Posts: 168
Joined: Thu May 07, 2015 9:24 am

Re: I2C regressions when migrating from TD1208 to TD1508

by mstempin Wed Dec 14, 2016 4:14 pm

Because the chip in the TD1508 (EZR32LG230F128) is different from the TD1208 (EFM32G210F128), and the module SDA/SCL pins are mapped to different GPIOs on these chips:
  • PE0 / PE1 respectively for the TD1508
  • PA0 / PA1 respectively for the TD1208

Please check the corresponding datasheet for the MCU pin <=> Module pin mapping.

Thus, a diffrent I2C peripheral must be used and mapped to different GPIOs with a different multplexing location in order to appear on the same module pins: peripheral I2C1 on PE0/PE1 at location 2 for the TD1508, vs. I2C0 on PA0 / PA1 at location 0 for the TD1208.

Here is a sample code:
I2C_Init_TypeDef i2cInit = I2C_INIT_DEFAULT;

// Initialize the I2C clock
CMU_ClockEnable(cmuClock_I2C1, true);

// Using PE0 (SDA) and PE1 (SCL) for TD1508
GPIO_PinModeSet(CONFIG_I2C_SCL_PORT, CONFIG_I2C_SCL_BIT, gpioModeWiredAndPullUpFilter, 1);
GPIO_PinModeSet(CONFIG_I2C_SDA_PORT, CONFIG_I2C_SDA_BIT, gpioModeWiredAndPullUpFilter, 1);

// Enable pins at location 2 for TD1508
I2C1->ROUTE = I2C_ROUTE_SDAPEN |
I2C_ROUTE_SCLPEN |
(2 << _I2C_ROUTE_LOCATION_SHIFT);

// Initialize I2C1 module for TD1508
I2C_Init(I2C1, &i2cInit);

// Clear and enable interrupt from I2C1 module
NVIC_ClearPendingIRQ(I2C1_IRQn);
NVIC_EnableIRQ(I2C1_IRQn);
ramon2015
 
Posts: 51
Joined: Mon Jul 06, 2015 4:06 pm

Re: I2C regressions when migrating from TD1208 to TD1508

by ramon2015 Thu Dec 15, 2016 12:18 pm

Thanks so much.

That helped a lot. Now my TD158 is runing the I2C bus perfectly.

Reagrds, Ramon.
Return to Firmware

Who is online

Users browsing this forum: No registered users and 26 guests