View Single Post
  #11   Spotlight this post!  
Unread 08-12-2003, 01:47
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
Re: IFI_Initialization

Be careful of the while(1) {..} loop. There is the timed stuff (17 or 26ms packet rate) and then the "high speed loop". The problem is that if you do significant processing in the slow loop (say, reading a LEGO sensor using some delays & bit twiddling) and burn 2-3 ms, then all of a sudden your "fast" code has a big gap where it isn't being called very fast.

Better is to set up a periodic timer interrupt, say at 4 khz, and put your fast code in there.

IFI probably kept their initialization code secret to maintain control over the user chip and to allow them the flexibility to change the interface to their radio system without impacting the users.