STM32Cube for STM32F4-Discovery
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-02-28 12:37 PM
Posted on February 28, 2014 at 21:37
Hello,
I tried and tried to connect my discovery board to i2c device and it didnt work. Today i saw, there si new version of software out, that had some changes in i2c scripts but i still cant connect. Can anyone confirm, that i2c scripts for stm32f4-discovery are working?thanks, joe #discovery #i2c #stm32f4
Labels:
- Labels:
-
I2C
-
STM32F4 Series
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2014-03-01 2:42 PM
Posted on March 01, 2014 at 23:42
Hello, just a quick update if anyone has same problem.
I didtn expext that STM32F4Cube's libs are programed so, that you actualy have to write 7bit I2c addres shifted for 1 bit in command. So if you want to write to device adressed 0x40, you have to use :
while(HAL_I2C_Master_Transmit(&I2cHandle, (uint16_t)0x40<<1, (uint8_t*)aTxBuffer, (uint16_t)TXBUFFERSIZE, (uint32_t)1000)!= HAL_OK)
More details :
http://scriptogr.am/jtech/post/note-to-myself-about-i2c-adressing-on-stm32f4-discovery
have fun