hello,
I'm work on infineon XC2267.
I'd like to send data through UART I configurate the XC2267 for that purpose
void UartInit(void) { U2C0_CCR = 0x0000; /// ----------------------------------------------------------------------- /// 1. baud rate generation and the PPP configuration /// baud rate = 19200, /// ----------------------------------------------------------------------- U2C0_FDRL=((uint16)2<<14)|(0x312<<0); //DM=2 (fractional divider),STEP=0x312 U2C0_BRGL=(15<<10)|(1<<8)|(0<<4)|(0<<0);//DCTQ=15,PCTQ=1,PPPEN=0,CLKSEL=0 U2C0_BRGH=(0<<14)|(0<<13)|(9<<0); //SCLKCFG=0,MCLKCFG=0,PDIV=99 /// ----------------------------------------------------------------------- /// 2 . Configuration of the U2C0 Input Control Register /// ----------------------------------------------------------------------- // CM SFSEL DPOL DSEN DFEN INSW DESL U2C0_DX0CR=((0<<10)|(0<<9)|(0<<8)|(0<<6)|(0<<5)|(0<<4)|(2<<0)); //P1.5(DX0C) /// ----------------------------------------------------------------------- /// 3. Data format: shift control signal, word/frame length control /// ----------------------------------------------------------------------- //TRM=01b(ASC) DOCFG PDL SDIR=0(LSB first) U2C0_SCTRL = (1 << 8) | (0 << 6) | (1 << 1) | (0 << 0); U2C0_SCTRH = (7 << 8) | (7 << 0); //WLE=7, FLE=7; /// ----------------------------------------------------------------------- /// 4. data transmission control (TBUF single shot mode) /// ----------------------------------------------------------------------- // TDEN=1 TDSSM=1 U2C0_TCSRL = (1 << 10) | (1 << 8); U2C0_TCSRH = 0x0000; /// ----------------------------------------------------------------------- // 5. protocol-related information /// ----------------------------------------------------------------------- // PL SP FFIEN FFIEN RNIEN CDEN SBIEN IDM STPB SMD U2C0_PCRL=(0<<13)|(7<<8)|(0<<7)|(0<<6)|(0<<5)|(0<<4)|(0<<3)|(0<<2)|(0<<1)|(0<<0); U2C0_PCRH=(0<<15); // MCLK not used /// ----------------------------------------------------------------------- /// 6. Configuration of the interrupts point and interrupt control registers /// ----------------------------------------------------------------------- //AINP=SR0, RINP=SR0, TBINP=SR0, TSINP=SR0 U2C0_INPRL = (0 << 12) | (0 << 8) | (0 << 4) | (0 << 0); U2C0_INPRH = (0 << 0); //PINP=SR0 U2C0_0IC = (0x80 * 0 + 0x40 * 0 + ((10 << 2)|0)); //IR=0, IE=0, ILVL=10, GPX=0 U2C0_1IC = (0x80 * 0 + 0x40 * 0 + ((10 << 2)|1)); //IR=0, IE=0, ILVL=10, GPX=1 U2C0_2IC = (0x80 * 0 + 0x40 * 0 + ((10 << 2)|2)); //IR=0, IE=0, ILVL=10, GPX=2 /// ----------------------------------------------------------------------- /// 7. Configuration of the U2C0 Channel Control Register // enable/disable general interrupt // enable/disable the parity mode // select the protocol mode /// ----------------------------------------------------------------------- // AIEN=0, RIEN=0, TBIEN=0, TSIEN=0, DLIEN=0, RSIEN=0 U2C0_CCR = (0 << 15)|(0 << 14)|(0 << 13)|(0 << 12)|(0 << 11)|(0 << 10); U2C0_CCR |= (0 << 8); // PM=0(no parity generation) U2C0_CCR |= 0x0002; // active ASC mode /// ----------------------------------------------------------------------- /// 8. input/output pins configuration /// ----------------------------------------------------------------------- P1_IOCR06 = 0x00B0; // P1.6=output(ALT1 Push/pull) }
after the configuration is done, I put data in the TBUFF:
U2C0_TBUF00 = 0x51;
to visualize the data I used the hyperterminal
but there's no data sent.
is there any one who can help me
Thanks