template setup with usart2 function