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
My mistakes at beginning were ( I had only a Infineonboard) - forget to enable ASC in general (SYSCON3) - set wrong clock values - forget enable the receiver Can we check your code? Stefan
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 forgot to mention that i used also used DAvE for creating the initilization code. The values in the comments for the interrupt settings of ASC0 Rx and Tx are from an older version. Sebastian
Is it right that you set ASC1_CON instead of ASC0_CON ? Otherwise the code looks good. Did you check boardsettings? Stefan
Oops. This is supposed to be ASC0... I changed it but it still does not work. The Boardsettings should be alright according to the manual of PHYTEC. There is only one problem i just came across. When i am trying to use the PLL-Config for the CPU-clock in DAvE it is shown as to high to use but the interrupt is still working. I will have a closer look at that issue and the boardsettings. Sebastian
Ok - please keep me informed. If I can provided with my PLL settings, let me know. Stefan
I checked and corrected the PLL-settings but it is still not running. There still might be some problem with the SYSCON SFRs. I don't know where else the problem might be. Could you please post a working configuration of your SYSCON registers? Sebastian
SYSCON1 = 0x0000 SYSCON3 = 0x80C0 PLLCON = 7844 Stefan
Thanks for your help, unfortunately it is still not working. I don't have any idea what could be another possible error source. Sebastian
Maybe the rs232 driver is defctive ? Stefan
i don't think so because when i use the hello.h86 file from phytec the rs232 interface works. hello can be seen in hyper terminal. Sebastian
please send me your source to stefan_fricke@rutronik.com I will check with my board here. Stefan