typedef unsigned char BYTE ;
typedef unsigned int WORD ;
typedef unsigned long DWORD ;
typedef signed char SBYTE ;
typedef signed int SWORD ;
typedef signed long SDWORD ;
Also, please use your mcu's port variables while defining below tags:
DATA_OUT
DATA_IN
SCK
TRIS_DATA
Use your mcu's timer functions to increase periodically TickCount variable, i.e. in every 20ms. Set below constants for your timing requirements: