Programming the peripherals