Minimizing resource usage in microcontrollers for cost effective solutions