@ -173,6 +173,7 @@ void PDITarget_EnableTargetPDI(void)
/* Set up the synchronous USART for XMEGA communications -
/* Set up the synchronous USART for XMEGA communications -
8 data bits , even parity , 2 stop bits */
8 data bits , even parity , 2 stop bits */
UBRR1 = 10 ;
UBRR1 = 10 ;
UCSR1B = ( 1 < < TXEN1 ) ;
UCSR1C = ( 1 < < UMSEL10 ) | ( 1 < < UPM11 ) | ( 1 < < USBS1 ) | ( 1 < < UCSZ11 ) | ( 1 < < UCSZ10 ) | ( 1 < < UCPOL1 ) ;
UCSR1C = ( 1 < < UMSEL10 ) | ( 1 < < UPM11 ) | ( 1 < < USBS1 ) | ( 1 < < UCSZ11 ) | ( 1 < < UCSZ10 ) | ( 1 < < UCPOL1 ) ;
/* Send two BREAKs of 12 bits each to enable PDI interface (need at least 16 idle bits) */
/* Send two BREAKs of 12 bits each to enable PDI interface (need at least 16 idle bits) */
@ -182,9 +183,10 @@ void PDITarget_EnableTargetPDI(void)
void PDITarget_DisableTargetPDI ( void )
void PDITarget_DisableTargetPDI ( void )
{
{
/* Turn of receiver and transmitter of the USART, clear settings */
/* Turn off receiver and transmitter of the USART, clear settings */
UCSR1B = 0 ;
UCSR1A | = ( 1 < < TXC1 ) | ( 1 < < RXC1 ) ;
UCSR1C = 0 ;
UCSR1B = 0 ;
UCSR1C = 0 ;
/* Set all USART lines as input, tristate */
/* Set all USART lines as input, tristate */
DDRD & = ~ ( ( 1 < < 5 ) | ( 1 < < 3 ) ) ;
DDRD & = ~ ( ( 1 < < 5 ) | ( 1 < < 3 ) ) ;