I2C Motor Driver V1.2

Hi all,

I just get this board, but I would like to have more information : what is this switch for ?
I trie to have a look at the wiki and also schematic, but seems there is no information on this.
Can you please help ?

Thank you

Best regards,

Denis

Hi,

Replying to myself, I found the information on another post :

http://www.seeedstudio.com/wiki/Grove_-_I2C_Motor_Driver_V1.2

But still, when I plug the module all LED are light up, and it seems the I2C bus is in short as I detect no I2C…
Want can be the issue ?

Best regards,

Denis

Hi, please confirm that your I2C address is right.

such as:If your switch is 1011, your I2C address is 0x0b.

Hi,

I will test as soon as I will program the firmware on the Atmega, seems there is no firmware yet.

Best regards,

Denis

Hi,there is firmware of I2C motor driver 1.2
mega8motor.zip (1.13 KB)

I do not have the AVR ISP programmer yet, bought it and I should receive it soon.
Cross fingers :slight_smile:

Br,
Denis

Enjoy yourself. Have a nice day.

Hi,

I have programmed it using ATmega8 (and not ATMega8L as I do not have it in the list) and i have exactly the same issue.
All LED are on. Maybe i am doing something wrong ?
I have programmed Flash memory and not EEPROM. Also before programming something I saved the program from this flash, editing data, this is something completely different.
I do not know what to do.

Best regards

Denis

hey, does you use 0023 to driver it?

And if all leds are lighted , maybe you need modify its’ code

maybe you could try these code

[code]#include <Wire.h>

//#define MOTORSHIELDaddr 0x0f
#define SETPWMAB 0x82
#define SETFREQ 0x84
#define CHANGEADDR 0x83
#define CHANNELSET 0xaa
#define MOTOR1 0xa1
#define MOTOR2 0xa5
#define SAVEADDR ‘S’
#define NOTSAVEADDR ‘N’

static unsigned char MOTORSHIELDaddr = 0x28;

void speedAB(unsigned char spda , unsigned char spdb)
{
Wire.beginTransmission(MOTORSHIELDaddr); // transmit to device MOTORSHIELDaddr
Wire.send(SETPWMAB); //set pwm header
Wire.send(spda); // send pwma
Wire.send(spdb); // send pwmb
Wire.endTransmission(); // stop transmitting
delayMicroseconds(100);
}

void fre_pre(unsigned char pres)
{
Wire.beginTransmission(MOTORSHIELDaddr); // transmit to device MOTORSHIELDaddr
Wire.send(SETFREQ); // set frequence header
Wire.send(pres); // send prescale
Wire.send(0); // need to send this byte as the third byte(no meaning)
Wire.endTransmission(); //
delayMicroseconds(100);
}

void change_adr(unsigned char new_adr, unsigned char save_or_not)
{
Wire.beginTransmission(MOTORSHIELDaddr); // transmit to device MOTORSHIELDaddr
Wire.send(CHANGEADDR); // change address header
Wire.send(new_adr); // send new address
Wire.send(save_or_not); // save the new address or not
Wire.endTransmission(); //
delayMicroseconds(100); //this command needs at least 6 us
}

void channel(unsigned char i4) //0b 0000 I4 I3 I2 I1
{
// delayMicroseconds(4);
Wire.beginTransmission(MOTORSHIELDaddr); // transmit to device MOTORSHIELDaddr
Wire.send(CHANNELSET); // channel control header
Wire.send(i4); // send channel control information
Wire.send(0); // need to send this byte as the third byte(no meaning)
Wire.endTransmission(); //
}
void motorAndspd( unsigned char motor_s,unsigned char Mstatus, unsigned char spd)
{
Wire.beginTransmission(MOTORSHIELDaddr); // transmit to device MOTORSHIELDaddr
Wire.send(motor_s); // motor select information
Wire.send(Mstatus); // motor satus information
Wire.send(spd); // motor speed information
Wire.endTransmission(); //
delayMicroseconds(100);
}

void setup()
{
Wire.begin(); // join i2c bus (address optional for master)
delayMicroseconds(10); //wait for motor driver to initialization
}

void loop()
{

motorAndspd(0xa1,0b01,225);
motorAndspd(0xa5,0b01,30);
delay(2000);

motorAndspd(0xa5,0b10,225);
motorAndspd(0xa1,0b10,30);
delay(2000);

change_adr(0x12, NOTSAVEADDR );
MOTORSHIELDaddr = 0x12;

for( int i = 0;i< 16;i++)
{
fre_pre(i);
channel(i);
delay(100);
}
speedAB(0 , 0);
change_adr(0x28,NOTSAVEADDR );
MOTORSHIELDaddr = 0x28;

}[/code]