View Single Post
  #9   Spotlight this post!  
Unread 04-02-2014, 15:11
kylelanman's Avatar
kylelanman kylelanman is offline
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 186
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
Re: I2C Arduino Port (Wii MotionPlus)

When trying to troubleshoot the lockups we slowly broke the following line into multiple calls.

Code:
_wmp->Transaction(0x00, 1, &buffer[0], sizeof(buffer));
Code:
printf("I2C Write\n");
_wmp->Transaction(0x00, 1, 0, 0;
printf("I2C Read Start\n");
_wmp->Transaction(0, 0, &buffer[0], sizeof(buffer));
printf("I2C Read Finish\n");
At this point it would lockup and the console would show the following.
Code:
...
I2C Write
I2C Read Start
Whenever a lockup occurred we found that momentarily removing power from the Wii MotionPlus would unlock the system and it would continue executing for 10s of seconds before the same thing happened.

We ended the night with the following code and had successfully run 5 minutes with no lockups. That may just be a coincidence

Code:
_wmp->Transaction(0x00, 1, 0, 0);
_wmp->Transaction(0, 0, &buffer[0], 1));
_wmp->Transaction(0, 0, &buffer[1], 1));
_wmp->Transaction(0, 0, &buffer[2], 1));
_wmp->Transaction(0, 0, &buffer[3], 1));
_wmp->Transaction(0, 0, &buffer[4], 1));
_wmp->Transaction(0, 0, &buffer[5], 1));
Thanks again and appreciate your willingness to assist!!!

Kyle
__________________
"May the coms be with you"

Is this a "programming error" or a "programmer error"?

Reply With Quote