I want to know method, How to avoid global variable in c microcontroller programing? or method to make global variable invisible. Is there any perticular functions in built in c library?, that could be supportive to avoid global variables or hide global variables.
Global variables are a perfectly valid way to communicate results from one part of the application to another. Presumably, what you want to do limit the scope of such variables so that they CANNOT be accessed by parts of the application that have no business accessing them. I hope that you already have source code that is divided into modules and perhaps you have subsystems within the application that comprise a number of modules - these mutually communicate, but these interfaces should be hidder from other subsystems. Now, for each subsystem you need to have variables that can only be accessed by modules withing the subsystem. To do this create files such as:
subsystem_name_data.c subsystem_name_data.h
subsystem_name_api.c subsystem_name_api.h
system_name_data.c system_name_data.h