Helper functions for PIC microcontroller