Bug in mgos_i2c_create for CC3200

ulsoulso Stockholm

I was trying to use pins 16 and 17 for I2C on my CC3200 board but always got an error message about wrong pin defs. It would seem that there is a bug in source file cc3200_12c.c on line 54 in the function mgos_i2c_create.

Line 54 says:

} else if (sda_pin == PIN_16) {

but, it should say:

} else if (scl_pin == PIN_16) {

Comments

  • rojerrojer Dublin, Ireland

    thanks for reporting! copy-paste is my mortal enemy :)
    fixed by cf4d57e.

  • ulsoulso Stockholm

    Now I no longer get the error message, which is fine. But, I still don't see any activity on pins 16 and 17 when trying the c_i2c example fw.

    I think I remember reading somewhere that you need to do the following call if using I2C on pins other than 1 and 2:

    MAP_PinTypeI2C(PIN_01, PIN_MODE_0);

    I tried to include that line in the main.c file but that didn't build.

    I would like to try a local build on my Mac but I haven't yet found any how-to on that procedure.

  • rojerrojer Dublin, Ireland

    we set mode just below. the code i just fixed picks the right mode for the pin you specify (it's not always the same PIN_MODE).
    hm. ok, i'll take a look.

Sign In or Register to comment.