WiiCamera Object Causes Resets?
Chris The Carpenter
Posts: 18
I am using a Wii Camera via i2c and the wiicamera.spin object. I am quite happy with my results and the numbers coming from the camera. I am almost able to "dock" my robot solely off the camera, without the need for any of his sonar sensors.
The issue I have it seems, are spontaneous resets when the wiicamera object is "running". If I start and "init" the object, the whole darn chip will reset itself every minute. Almost exactly a minute, actually. It resets, and gets right back to working like nothing happened.
Back info:
I stripped the code to bare bones for "testing" of this problem.
I have 3-4 cogs running with a ton of head-room in terms of stack:
*main routine
*TV
*One robot-related cog that had to be left in to get the main routine to compile
*The wiicamera opens its own cog
The robot-related cog includes a poor-man's timer that keeps an eye on the cnt and increases a variable called "seconds" --not accurate but I use it to time different modes and "personalities" of the robot. The TV object is the ORE_TV_TEXT_009 object. I am using the Prop Board USB from Gadget Gangster. I think that's it. Any thoughts?
The issue I have it seems, are spontaneous resets when the wiicamera object is "running". If I start and "init" the object, the whole darn chip will reset itself every minute. Almost exactly a minute, actually. It resets, and gets right back to working like nothing happened.
Back info:
I stripped the code to bare bones for "testing" of this problem.
I have 3-4 cogs running with a ton of head-room in terms of stack:
*main routine
*TV
*One robot-related cog that had to be left in to get the main routine to compile
*The wiicamera opens its own cog
The robot-related cog includes a poor-man's timer that keeps an eye on the cnt and increases a variable called "seconds" --not accurate but I use it to time different modes and "personalities" of the robot. The TV object is the ORE_TV_TEXT_009 object. I am using the Prop Board USB from Gadget Gangster. I think that's it. Any thoughts?
Comments
Could you post your code? I'll take a look at it.
If it's reseting after one minute is seems like it has to do with the system counter rolling over and causing a problem.
Duane
I think that's been known to power up the FTDI USB chip and cause a spontaneous reset...
An attachment is better than having your code in a code block. [CODE ]code you want in the block [ \CODE] but without the spaces is how to have your code display correctly. It's best to use code blocks for small bits of code. It's a lot easy to download an attachment than to try to cut and paste code from the blocks.
The Propeller Tool has an archive feature File\Archive\Project. By archiving your project, we don't have to track down all the objects you are using. I might be nice enough to take a look at someone else's code, but I'm not so nice as to hunt down all the objects it uses.
When I've had trouble with some code, I've tried to pare it down to just the code causing the trouble. The act of simplifying the code has lead me to find the problem myself without ever having to post it. You don't have to do this, I'm just letting you know what I've done.
This looks like a really cool project. I hope you share some pictures and/or video of it.
By the way, welcome to the forum.
Duane The Chemist
Oh, I tried an after-market wii camera with much frustration and no results. I tried different pin-outs, different frequencies for the clock feed, different levels of pull-ups on i2c and reset, etc. No go. --It was a Nyko "Wand" from Radio Shack and I tried it via Prop and Arduino, BTW.
Oh, and Walter is here. And I just started building a "Little Buddy" for him as well. The whole "wiicamera" thing is partially so Walter and his "Little Buddy" can play a little follow-the-leader and hide-and-seek.
Thanks again, folks.
Stack size problems are very common...
With complex code, it's very hard to know how much you need.
100 longs seems enough for most things though.