TCPmaker : Visual Tour    Exploring and Customizing the Generated Code  

The mtFastTick event:

The mtFastTick() event handler is called quite often, each time around the main loop in Microchip's file MainDemo.c, each time mtServer() is called, 

mtFastTick() is called whether or not your device is currently connected to a PC browser.  This occurs at an interval of roughly 10's of microseconds under normal conditions.

This is the ideal place for you to add code to call your own application software, that may have to manage your custom hardware at a regular basis.

Since mtFastTick() is an event handler, the cautions about Cooperative Multitasking apply here, so any code of yours that you either execute inside of this routine or call from the mtFastTick() event handler, should obey the rules:

  • do a little work,
  • save the current state,
  • get out fast, and
  • check the current state the next time around to see how to pick up from where you left off.

In our simple PICDEM.net2 project, we do not need to add any code to the mtFastTick() event handler.

 

 

open full sized image

13 of 21
Copyright Notice and Author Information