...
POST No. 2408040
OpenCM 9.04 + OpenCM 485 EXP + OLED 0.982 Display
2021-04-22 17:34:10 Daisuke71
Dear Sirs,

For a project I am working on I am using an OpenCM 9.04 + OpenCM 485 EXP to drive a number of Dynamixel AX-12a servos.
I would be interested in adding an OLED 0.96" LCD display to be used for showing messages to the user.
I read into the specs that the I2C pins of the OpenCM 9.04 board (pins 24 and 25) are used for the Serial3 port, that according to the examples provided is used for the Dynamixel communication via OpenCM 485.
With the above setup can I connect the OLED display to said pins AND to the OpenCM 485, or does this interfere with the communication with the expansion board/Dynamixels?

I also have a second question about the libraries to drive the OLED display.

I downloaded the libraries provided here "https://emanual.robotis.com/docs/en/popup/opencm904_ex_oled/", copied the test sketch into the Arduino IDE (ver. 1.8.13), and successfully tested it with an OpenCM 9.04 connected to the display via breadboard.

However, if I update the Adafruit libraries to the current versions (Adafruit GFX Library 1.10.7, Adafruit BusIO 1.7.3, Adafruit SSD1306 2.4.4) I got the following compilation errors:

In file included from /Users/luca/Library/Arduino15/packages/OpenCM904/hardware/OpenCM904/1.5.0/variants/OpenCM904/bsp/opencm/stm32f1xx.h:149:0,
                 from /Users/luca/Library/Arduino15/packages/OpenCM904/hardware/OpenCM904/1.5.0/variants/OpenCM904/bsp/opencm/bsp.h:22,
                 from /Users/luca/Library/Arduino15/packages/OpenCM904/hardware/OpenCM904/1.5.0/variants/OpenCM904/hw/hw.h:18,
                 from /Users/luca/Library/Arduino15/packages/OpenCM904/hardware/OpenCM904/1.5.0/cores/arduino/Arduino.h:36,
                 from /Users/luca/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GFX.h:5,
                 from /Users/luca/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.h:25,
                 from /Users/luca/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.cpp:36:
/Users/luca/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.cpp: In member function 'void Adafruit_SPITFT::initSPI(uint32_t, uint8_t)':
/Users/luca/Library/Arduino15/packages/OpenCM904/hardware/OpenCM904/1.5.0/variants/OpenCM904/bsp/opencm/stm32f103xb.h:722:55: error: lvalue required as unary '&' operand
 #define SPI1                ((SPI_TypeDef *) SPI1_BASE)
                                                       ^
/Users/luca/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.cpp:568:28: note: in expansion of macro 'SPI1'
         || (hwspi._spi == &SPI1)
                            ^
exit status 1
Errors while compiling for the OpenCM9.04 Board.

Are the latest Adafruit libraries supported, or must be used those supplied by Robotis?

Thankyou
2021-04-22 17:34:10
Daisuke71
2021-04-28 10:40:28 Will Son

Hi,


I'm sorry about the delayed response.

The example is written with the modified Adafruit library.

For example, in the Adafruit_SSD1306.cpp #208, the code defines which I2C channel to use when OpenCM9.04 is defined.

By default, it uses channel #2 which is used for the DYNAMIXEL communication between OpenCM9.04 and OpenCM485EXP board.

Therefore, if you need to use I2C, you should modify the code so that I2C channel #1 can be used.

However, please be aware that I2C SDA pin is already used for the Status LED.

Thank you.

2021-04-28 10:40:28
willson