You are here

(SOLVED) I2C, change pins

7 posts / 0 new
Last post
CTSchorsch
Offline
Last seen: 3 months 4 weeks ago
VESC Free
Joined: 2018-07-13 09:55
Posts: 101
(SOLVED) I2C, change pins

Hi all,

i want to move the I2C pins from PORTB 10/11 to PORTB 8/9. I have no CAN device, so this PINS are free to use.

i set:

#define HW_HAS_NO_CAN

#define HW_I2C_DEV              I2CD1

#define HW_I2C_GPIO_AF          GPIO_AF_I2C1

#define HW_I2C_SCL_PORT         GPIOB

#define HW_I2C_SCL_PIN          8

#define HW_I2C_SDA_PORT         GPIOB

#define HW_I2C_SDA_PIN          9

and enable I2C1 in mcuconf.h

but now signal on this pins :( is it correct, that the defines for the PINs and PORTs are nowhere used in the code ? grep found no match

do i have to change something more ?

Georg

tecnologic
Offline
Last seen: 2 years 4 months ago
Joined: 2020-05-06 12:12
Posts: 3

Hi Georg,

Does ur hardware have the i2c start stop functions in? There the pin config is done.

 

 

CTSchorsch
Offline
Last seen: 3 months 4 weeks ago
VESC Free
Joined: 2018-07-13 09:55
Posts: 101

yes it has, and you are right, there is the config. but this seems to be okay

CTSchorsch
Offline
Last seen: 3 months 4 weeks ago
VESC Free
Joined: 2018-07-13 09:55
Posts: 101

strange, there is some communication right after reset.

Is there something that blocks the process or overwrites the pin function

 

CTSchorsch
Offline
Last seen: 3 months 4 weeks ago
VESC Free
Joined: 2018-07-13 09:55
Posts: 101

mmh, the thread goes to sleep state. it seems that the thread is waiting for a mutex release, but why?

Is the I2CD1 Device use per Default for some VESC internals ?

Nunchuk app is dissabled

CTSchorsch
Offline
Last seen: 3 months 4 weeks ago
VESC Free
Joined: 2018-07-13 09:55
Posts: 101

On default Hardware I2C shares the pins with UART and when using the UART-APP hw_i2c_stop is called....

 

woodmastr
Offline
Last seen: 1 month 6 days ago
VESC Free
Joined: 2020-03-09 10:25
Posts: 2

Hello
we are trying to interface to a peripheral via I2C . after a while of periodic i2c transmissions the i2c_running variable seems to be unset. might the uart-app be interfering? where is the uart app initiated.
thanks h