View Single Post
  #1   Spotlight this post!  
Unread 07-03-2006, 01:59
ericand's Avatar
ericand ericand is offline
Registered User
AKA: Eric Anderson
FRC #3765 (Terrabots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: St. Paul, MN
Posts: 148
ericand is a jewel in the roughericand is a jewel in the roughericand is a jewel in the rough
Time available between NEW_SPI_DATA and Putdata

It is well documented that we need to send data back to the master microprocessor every 26.2 ms and that the data from the master is signaled by the setting of the NEW_SPI_DATA flag.

I would like to know how much time is available between the time the NEW_SPI_DATA flag is set and the Putdata is called, before the Master flags a code error.

The default code says:

Getdata(&rxdata); /* Get fresh data from the master microprocessor. */

Default_Routine(); /* Optional. See below. */

/* Add your own code here. */

Putdata(&txdata); /* DO NOT CHANGE! */

But there is no indication of how much time can be taken prior to calling Putdata().

My concern is that NEW_SPI_DATA may become active imidiately following the check for NEW_SPI_DATA. This means that one fast loop execution time may pass before we notice that it is set. Thus we may have more or less time to execute in Process_Data_From_Master_uP() before we are too late to call Putdata().

I think that this is related to our robot seeing intermittant code error conditions. I think that knowing exactly how much time we take (maximum) in our fast and slow loops, we can do a better job of time management and avoid the code error.