SW and HW for master module of battery management system