Grove - I2C Motor Driver - information and source code


I just bought one of these and I am looking for:

  1. more info on API and advanced motor control, for example:
  • best PWM frequency to use
  • what is & how to use the advanced “Channel set, set IN1-IN4 of H-bridge chip, only for advanced users”
  • what are all the parameters SETPWMAB, spda/b, SETFREQ, pres
    It is possible to wok out most of what these do from the schematic, but this leaves missing information about what the firmware does!
  1. I want to use the spare ATMEGA IO pins, so does anyone know where the source code and binaries for the Atmega 8 firmware are? … or a similar project by someone else that has the source available?

I had to make changes to the example code for it to compile under Arduino 1.0 GUI, will post these changes once I have finished testing.

I have the same questions… =(

And i’d like to know what is the maximum frequency of i2C port communication? Can I use the both standards data rate (100kbit/s or 400kbit/s)?

Best regards,


I also need the firmware!

I don’t know anout the IO pins but there is a download link for firmware on the wiki at: … tor_Driver

These are the links it gives (just check under the section that says ‘Resources’):


L298 dual full bridge driver -
AMS 1117CD 5v voltage regulator -
Eagle files of I2C motor_driver - …
File:Grove-I2C Motor Driver - …

Yes we got a mail with this file. Thank you for notice.

Thread can be marked as closed.

… looking at the firmware zip file mentioned above, shows that is only contains the hex firmware, not the acutal source code.

Seeed seem to have mailed the source to Schmron, but it would be really nice if they could publicly release it :slight_smile:

… come on, please - you do say you are open source :slight_smile:


My i2c motor driver does not work, I want to change the firmware but I have not enough information, I downloaded the .hex file but not as upload it to the board.
Can you help?

Hello, When I did this I never used the firmware because for me the board worked fine without it. Are you using the board with an Arduino?

It worked fine at first but it seems that is locked, now all LEDs remain lit and does not work, I have no other i2c device to test the i2c bus, the motor driver may be blocking the bus i2c. I have to buy a grove rtc to try. I dont know if there is a way to know if the motor driver works, to make it respond messages


Upps, Yes, i’m using the board with arduino

I wrote this post when I got mine working. This shows exactly how to set it up. … p-and.html

It worked fine at first, all connection are ok. I am using a shield with an arduino and the i2c Motor Driver. I tried the code of the link but it does not work, Motor Driver keep all the LEDs on.
I would like to send something to the Motor Driver and this reply through i2c but i am not sure if it is possible.


Did you use jumper wires for this connection? How long?

I used grove universal 20cm cable with a shield connected to arduino


I’m trying to flash the frimware of my I2C motor driver but I’m struggling with the AVR programmer. I bought the AVRISP programmer from seeedstudio.
Please see enclosed a picture which shows how I connect to the board.

A had the similar problem. It was wrong pinout written at the board. But my board looks quite different (may be I have an old version of it).
Try to look at atmega8 datasheet, and check wheather the MISO, MOSI and SCK pins of controller connected to the proper pins of the socket.

Which flashing-program do you use?

So is the actual SOURCE CODE of the firmware somewhere online? The wiki link File:Grove-I2C Motor Driver seems to only have a file with hex values in it, no source code.

I want to know if I can extend the firmware so it can work with dc motors with encoders.

Do you want to connect encoders to this board? How?

I have written an alternative firmware for this board. I can share the source code if it really helps you.

Yes, that would be helpful. I’m interested in using this with the DFRobot Baron-4WD Mobile Platform which has optical encoders or possibly with the Trosson Budget Bot Chassis whose motors use Hall Effect Quadrature Encoders

Here is alternative firmware for the motor driver. I would be grateful to receive any report from you.

But how do you want to connect encoders? There are only 3 inputs available: MOSI, MISO, SCL. But 2 encoders require 4 inputs.