Search  
Sunday, November 23, 2008 ..:: Forum ::.. Register  Login
 HomePage Minimize

 Print   

 Products Minimize

 Print   

 MSRS Minimize

 Print   

      
 RoboticsConnection Forum Minimize
SearchForum Home
  Discussions  Robot Sensors  Line Following ...
 Line Following Sensor question
 
 10/12/2007 5:09:24 AM
steve
5 posts


Line Following Sensor question
I am testing your Line Following Sensor.

After 7 reads from my Brainstem controller it seems to stops responding, (always 7)

If I loop 6 or less times, no problem - 7 times and it locks.

void main(){
char result;
aCore_Outportc(aPortIICBaud, 0); /*set bus to slowest speed (std iic)*/

for (y = 1; y <= 6; y++)
{
    result = aI2C_ReadChar((unsigned char)0x50,0);
    aPrint_CharDec(result);
    aPrint_String("\n");
    aCore_Sleep(10000);
};}

Also, If I run the above program for 6 loops and then unplug and plugin the sensor I can run the program again with no lock up.  But if I run the program a 2nd time without unpluging then it will lock up the second time on the 1st loop thru the 2nd run (7th overall).

- Different bus speeds
- Tried different I2C cable
- Tried different "Sleep" values (up to 5 seconds between)
- LEDs on sensor still respond even after "lockup"

Any suggestions for a next step?
Steve
 10/12/2007 2:10:36 PM
jason
158 posts
5th


Re: Line Following Sensor question

Steve,

I'm not that familiar w/ the BrainStem, but let me read more about it, and understand their I2C interface to help you debug the problem you are seeing.

Is the aI2C_ReadChar() method something you wrote, or is it part of a library associated w/ the BrainStem?   If you wrote it, could you post the src code?

Best Regards,


Jason Summerour
President,
Summerour Robotics Corp
Microsoft MVP
www.roboticsconnection.com
 10/12/2007 2:28:45 PM
jason
158 posts
5th


Re: Line Following Sensor question

Steve,

You might try:

   result = aI2C_ReadChar((unsigned char)0x50,1);   // register 1, instead of 0

And see if that alleviates the problem.

We do have several OOPics that we can use to test the Line Follower with.  I know that doesn't directly help you, but it would allow us to see if the Line Follower plays well w/ controllers other than the Serializer. :)

Ringo, do you have any ideas?


Jason Summerour
President,
Summerour Robotics Corp
Microsoft MVP
www.roboticsconnection.com
 10/13/2007 10:20:29 AM
steve
5 posts


Re: Line Following Sensor question
In answer to your suggestions:
    The aI2C_ReadChar is part of the brainstem's library (I've included it below)
    The register change from 0 to 1 had no effect

I've also:
    changed to a different power supply, just in case.
    changed the port I'm reading, to a voltage sensor on my motor control board, and everything works fine.  

Once the sensor locks up after 7 reads, repowering just the sensor gets things going for another 7 reads.  Resetting the controller and not the sensor has no effect, the next read it attemps will not work but if I repower the sensor, I get 7 more reads!
Steve

Library Routine:
char aI2C_ReadChar(char addr, char reg)
{
  char val=0;
  asm
  {
   /* write address */
   pushsb    5    /* IIC address       */
   pushlb    1    /* data size         */
   pushsb    6    /* push reg         */
   pushlb    3    /* cmd size          */
   popcmd

   /* read byte from device  */
   pushsb    5    /* IIC address       */
   pushlb    1    /* set read bit      */
   orb
   pushlb    1    /* bytes to read     */
   popsm    aPortIICRead
   popbs    1    /* store as char     */
  }
  return val;
}

   
 jason wrote

Steve,

You might try:

   result = aI2C_ReadChar((unsigned char)0x50,1);   // register 1, instead of 0

And see if that alleviates the problem.

We do have several OOPics that we can use to test the Line Follower with.  I know that doesn't directly help you, but it would allow us to see if the Line Follower plays well w/ controllers other than the Serializer. :)

Ringo, do you have any ideas?

 10/13/2007 8:28:01 PM
jason
158 posts
5th


Re: Line Following Sensor question

Steve,

We have a Brainstem on the way. I'll also ping Tim at Acroname to see if he has any ideas.

Best Regards!


Jason Summerour
President,
Summerour Robotics Corp
Microsoft MVP
www.roboticsconnection.com
  Discussions  Robot Sensors  Line Following ...

SearchSearch  Forum HomeForum Home    Print   

Copyright 2004-2007 Summerour Robotics Corp   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2008 by DotNetNuke Corporation