This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problem using the printf-function

Hello,

i am having problems using the printf-function on a XC161CJ. The initialization i used is from an older project with the same controller and was running properly.

In the new projrct everything works fine until the printf, there the program hangs. Only interrupts with higher priority are still served.
Anyone an idea what's the cause for this?

Thanks in advance

Sebastian

Parents
  • This is my code:

    	ASC0_BG 	= 0x4; 					//BG für 57600 kbit/s
    
    	ASC0_FDV	= 0x76;					//Fractional Divider für 57600 kbit/s
    
    	ASC0_CON 	= 0x0811;				//8 bit daten async., 1 Stopbit, Receiver an
    
    	ALTSEL0P3 	&= 0xF7FF;				//Alternative Funktion Port 3.10 und 3.11 an
    
    	P3 			|= 0x0400;				//P3.10 auf High, P3.11 auf Low
    	DP3 		|= 0x0400;				//P3.10 als Output P3.11 als Input
    
    	ASC0_TIC	= 0x0080;				//Tx G-Lv 01, I-Lv 0101, Tx_IE = 1
    
    	ASC0_RXFCON	= 0x0102;
    
    	ASC0_TXFCON = 0x0102;
    
    	ASC0_RIC 	= 0x0000;				//Rx G-Lv 01, I-Lv 1001, Rx_IE = 1
    
    	ASC0_TIC_IR = 1;
    
    	ASC1_CON_R	= 1;					//Baudratengenerator an
    

    i got the values for the BG and fractional divider from the manual of the XC161. In Syscon3 the ASC0 is activated.

Reply
  • This is my code:

    	ASC0_BG 	= 0x4; 					//BG für 57600 kbit/s
    
    	ASC0_FDV	= 0x76;					//Fractional Divider für 57600 kbit/s
    
    	ASC0_CON 	= 0x0811;				//8 bit daten async., 1 Stopbit, Receiver an
    
    	ALTSEL0P3 	&= 0xF7FF;				//Alternative Funktion Port 3.10 und 3.11 an
    
    	P3 			|= 0x0400;				//P3.10 auf High, P3.11 auf Low
    	DP3 		|= 0x0400;				//P3.10 als Output P3.11 als Input
    
    	ASC0_TIC	= 0x0080;				//Tx G-Lv 01, I-Lv 0101, Tx_IE = 1
    
    	ASC0_RXFCON	= 0x0102;
    
    	ASC0_TXFCON = 0x0102;
    
    	ASC0_RIC 	= 0x0000;				//Rx G-Lv 01, I-Lv 1001, Rx_IE = 1
    
    	ASC0_TIC_IR = 1;
    
    	ASC1_CON_R	= 1;					//Baudratengenerator an
    

    i got the values for the BG and fractional divider from the manual of the XC161. In Syscon3 the ASC0 is activated.

Children