/******************************************************************************
*                                                                             *
*              Copyright (C),  Philips Semiconductors SLH                     *
*                                                                             *
*  All rights are reserved. Reproduction in whole or in part is prohibited    *
*           without the written consent of the copyright owner.               *
*                                                                             *
*  Philips reserves the right to make changes without notice at any time.     *
* Philips makes no warranty, expressed, implied or statutory, including but   *
* not limited to any implied warranty of merchantibility or fitness for any   *
*   particular purpose, or that the use will not infringe any third party     *
* patent, copyright or trademark. Philips must not be liable for any loss or  *
*                      damage arising from its use.                           *
*                                                                             *
*******************************************************************************
*                                                                             *
*       Project: 336355/105 - Control SW Library for HTRC110/HTRC120/HITAG2   *
*                                                                             *
*       File: RC_WSET.C                                                       *
*       Author:  St. de Zeeuw                                                 *
*                                                                             *
*******************************************************************************
*      DATE      *          CHANGES DONE                        *   BY        *
*******************************************************************************
*                *                                              *             *
*  Dec 04,1997   * Start implementation                         *   de Zeeuw  *
*  Dec 10,1997   * Version 1.0, tested Version                  *   de Zeeuw  *
*  Apr 27,1998   * Version 2.0, tested Version                  *   de Zeeuw  *
*                *                                              *             *
*******************************************************************************/

#include "portab.h"
#include "reg51.h"
#include "htrc110.h"


#pragma regparms



void Write_Settling (void)
/******************************************************************************
*                                                                             *
* Description:                                                                *
* Implementation of the after-write fast settling sequence described in the   *
* application note AN97070. Before calling the routine the following          *
* operations should have been executed:                                       *
*  SET_CONFIG_PAGE(CF_PAGE_2+THRSET1+FREEZE0);                                *
*  WRITE_TAG(_N)();                                                           *
*  "sending bits to transponder;n"                                            *
*                                                                             *
* Parameters: none                                                            *
* Return: none                                                                *
*                                                                             *
******************************************************************************/
{
   TR0 = 0;
   TMOD &= 0xF0;     /*timer 0 = 16 bit counter */
   TMOD |= 0x01;   
   TL0 = (-NO_200US) & 255; /* init timer for 200 us */
   TH0 = (-NO_200US) >> 8;
   TF0 = 0;
   TR0 = 1;

   while(!TF0);   /* wait......*/

   TR0 = 0;
   TF0 = 0;
   TL0 = (-NO_250US) & 255;   /* init timer for 250 us */
   TH0 = (-NO_250US) >> 8;
   TR0 = 1;

   SET_CONFIG_PAGE(CF_PAGE_2+THRESET+FREEZE1+FREEZE0);

   while(!TF0);  /* wait......*/

   TR0 = 0;
   TF0 = 0;

   SET_CONFIG_PAGE(CF_PAGE_2);
}




  