ThunderBorg I2C communication questions
Forums:
Hello!
I've been using my ThunderBorg cards for some weeks now and there are some things that arent clear for me.
1, Since i have 2 boards atm, i have to change at least one of the addresses to be able to work with them - which works fine. However when i want to check it by requesting the new address from the card (COMMAND_GET_ID 0x99) via I2C it always returns the same value (the out of the box value =15) no matter what i just set it. Is it intentional or is it a bug or am i doint something wrong? As I said the card works fine with the new address (I can control the motors, LED,...).
2, Is there a way to disable the motors? By disabling i mean cutting the power from them with the program. I know that i can set the speed to 0 and it stops turning but the motors are still enabled and powered by the card. (I dont want to use a switch between the battery and the controller).
3, It took me a while to realize how i can control the LED on the Thunderborg - I have to set this registers: "COMMAND_SET_LED_BATT_MON 6" value to zero first and after that i am able to write the RGB value. Here's a sample code from arduino:
Wire.beginTransmission(0x58); //thunderborg address
Wire.write(6); //led control register
Wire.write(0); //turn on/off the led control register
Wire.endTransmission(true);
Wire.beginTransmission(0x58);
Wire.write(0x01); //set rgb register
Wire.write(0); //red value
Wire.write(0); //green value
Wire.write(200); //blue value
Wire.endTransmission(true);
My problem is that i have to upload this code to the arduino twice till the LED changes its color to blue. And i have to do it twice too when i turn on the register so it changes the color back based on the battery's level. Is there some kind of delay in the ThunderBorg's controller or should i set/reset another register too to make it working at the first try? Or any idea about what could cause this or how can i avoid this issue?
4, Do you have an accessable electrical schematic for the board? It could be useful sometimes. For example atm im looking at the right side of the PCB where are 4 holes next to each other (between the 2 big holes for the screws) and if im right 3 of them is a pwm output for the Lid LED and the forth is a GND. Can is simply control them by setting the Lid registers value in the program? Whats the current limit for them?
thanks
piborg
Sun, 12/08/2019 - 22:47
Permalink
ThunderBorg I2C details
In answer to your questions:
1. It is intentional. The idea of the get ID command is to check what the board actually is. The same command (0x99) is implemented on all of our boards where the I2C address can be changed.
2. Unfortunately there is no way to fully disable the motor connections on a ThunderBorg :(
3. From memory it takes a short time for the ThunderBorg to change mode and it is possible that it is in the process of updating the colour when the second command arrives. I would try adding a small delay between the two commands to see if it fixes the issue.
4. We do not have a full schematic available. The connector in question has pins for V+, GND, 5V, and the LED comms line. The signal to the LED is a 1-wire communication specific to the type of 4-pin LEDs we are using on the ThunderBorg and Lid. The LED actually gets its power from the 5V line.
If you have any more questions ask away :)