Trouble using Blinkm

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
bentutt
Posts: 1
Joined: 06 Apr 2009 07:13

Trouble using Blinkm

#1 Post by bentutt » 06 Apr 2009 07:19

I'm am trying to interface my PIC16F886 with a Blinkm, but I cannot seem to communicate to the Blinkm, because it remains always in its demo mode.

I've tried to demonstrate communication by setting a color with this code:

void main () {
Soft_I2C_Config(&PORTC, 4, 3);
Soft_I2C_Start();
Soft_I2C_Write(0x09); // Address BlinkM
Soft_I2C_Write(0x6e);
Soft_I2C_Write(0);
Soft_I2C_Write(0);
Soft_I2C_Write(150);
Soft_I2C_Stop();
}

I've also tried the hard I2C Library. Nothing seems to work. If anyone has example code or advice, it would be greatly appreciated. For those wondering, I am pretty sure the hardware connections are made correctly (with pull up resistors on the clock and data pins).
Thanks

Mince-n-Tatties
Posts: 2780
Joined: 25 Dec 2008 15:22
Location: Scotland

Re: Trouble using Blinkm

#2 Post by Mince-n-Tatties » 07 Apr 2009 20:27

bentutt wrote:I'm am trying to interface my PIC16F886 with a Blinkm, but I cannot seem to communicate to the Blinkm, because it remains always in its demo mode.

I've tried to demonstrate communication by setting a color with this code:

void main () {
Soft_I2C_Config(&PORTC, 4, 3);
Soft_I2C_Start();
Soft_I2C_Write(0x09); // Address BlinkM
Soft_I2C_Write(0x6e);
Soft_I2C_Write(0);
Soft_I2C_Write(0);
Soft_I2C_Write(150);
Soft_I2C_Stop();
}

I've also tried the hard I2C Library. Nothing seems to work. If anyone has example code or advice, it would be greatly appreciated. For those wondering, I am pretty sure the hardware connections are made correctly (with pull up resistors on the clock and data pins).
Thanks
just because you send start and address, may not actually mean the device has ACKnowledged the commands.

if you dont have a scope to probe the bus, i would start by trying to read something from the blinkm, like its address or firmware version number. if you only have 1 device on the bus you can use the 0x00 address method. I would also start with hardware I2C rather than soft_i2c. you could also try sending the command to stop the script running.

when you cant get something to work always try something lesser to start with. Like read the device before trying to write to it.

Mince-n-Tatties
Posts: 2780
Joined: 25 Dec 2008 15:22
Location: Scotland

#3 Post by Mince-n-Tatties » 09 Apr 2009 11:10

as you are posting in the mikroC pro forum i should ask... did you select (tick the box) the I2C library in the Library manager?

Post Reply

Return to “mikroC PRO for PIC General”