Most of the objections I see to using global variables make sense since they refer to issues of multiple threads, thread safety, etc.
But in a small, single threaded
Global variables are necessary in a small embedded application written in C. For example, you need to use a global variable in order to pass information between an Interrupt Service Routine and another module. These are some tips, that will help you make effective use of global variables in embedded applications:
Make a distinction between static variables and global variables. Static variables can be used from all functions in the same C file. They are the equivalent of private members in a C++ class. In C you have to do the compiler's job yourself. Use the static keyword to avoid accidental use of the variable outside of the module and make evident its scope. You may want to prefix the variable with the module's name.
Follow a naming convention for global variables (used by many C files). Make it clearly evident that they are global.
If you need a lot of global variables, consider bundling them in a struct.
Use the volatile keyword, when necessary. This is needed if a global variable is modified by an ISR.