It worked when removing i2c from TIM2 and use it directly in the loop.
I see now why there would be a problem with i2c inside TIM2.
Had to read the code again yesterday to see it.
Martin
Search found 4 matches
- Sat Jan 23, 2021 3:06 pm
- Forum: General discussion
- Topic: Bluepill i2c and BLDC commutation misses
- Replies: 7
- Views: 3379
- Fri Jan 22, 2021 7:56 pm
- Forum: General discussion
- Topic: Bluepill i2c and BLDC commutation misses
- Replies: 7
- Views: 3379
Re: Bluepill i2c and BLDC commutation misses
This fairly depends on your code. I2C works with IT and I guess priority is higher than the one you used for the HALL sensor, that's probably explain why you have this issue. Hi fpiSTM, I have tried to find a way to set the hallsensor update to a higher priority than i2c. What I have found and trie...
- Wed Nov 25, 2020 8:23 am
- Forum: General discussion
- Topic: Bluepill i2c and BLDC commutation misses
- Replies: 7
- Views: 3379
Re: Bluepill i2c and BLDC commutation misses
I’m using a DRV8323 with 3xPWM signal.
There is a SIN table that analogWrite uses to create sin waves for commutation.
No sure what core I’m running. Installed STM32Duino into the Arduino IDE.
I’ve attached the IDE setup
There is a SIN table that analogWrite uses to create sin waves for commutation.
No sure what core I’m running. Installed STM32Duino into the Arduino IDE.
I’ve attached the IDE setup
- Mon Nov 23, 2020 2:34 pm
- Forum: General discussion
- Topic: Bluepill i2c and BLDC commutation misses
- Replies: 7
- Views: 3379
Bluepill i2c and BLDC commutation misses
Hi, I am using a Bluepill board to drive a BLDC motor trough 3 PWM pins and hall sensors. Hall sensors are connected to interrupt and commutation is using hardware timer. The motor runs smooth without sending data through i2c, but when I send 20 bytes every 50ms the motor stutters and are missing co...