AnsweredAssumed Answered

KM34Z128 uart config for 300bd 7E1

Question asked by raja m on Jun 4, 2019
Latest reply on Jun 17, 2019 by Felipe García

I used KM34Z128.  it is working 300 bd and 8N1. but not able configure  7E1 mode. how to configure 300bd 7E1

 

UART3_Init(UART_MODULE_INTRMODE_CONFIG1(SET_300_BR,SystemState.SysClk));
UART_InstallCallbackUART2_UART3(UART_INTERRUPT_PRIORITY, OpticalEventHandler);

 

 

 

#define UART_MODULE_INTRMODE_CONFIG(brate,bclk) \
(tUART){ \
/* BDH */ CLR(UART_BDH_RXEDGIE_MASK)|((CALC_SBR(brate,bclk)>>8)&0x1f), \
/* BDL */ ((CALC_SBR(brate,bclk)>>0)&0xff), \
/* C1 */ CLR(UART_C1_LOOPS_MASK)|CLR(UART_C1_RSRC_MASK)| \
/* .. */ CLR(UART_C1_M_MASK)|CLR(UART_C1_WAKE_MASK)| \
/* .. */ CLR(UART_C1_ILT_MASK)|CLR(UART_C1_PE_MASK)| \
/* .. */ CLR(UART_C1_PT_MASK), \
/* C2 */ CLR(UART_C2_TIE_MASK)|CLR(UART_C2_TCIE_MASK)| \
/* .. */ SET(UART_C2_RIE_MASK)|CLR(UART_C2_ILIE_MASK)| \
/* .. */ SET(UART_C2_TE_MASK)|SET(UART_C2_RE_MASK)| \
/* .. */ CLR(UART_C2_RWU_MASK)|CLR(UART_C2_SBK_MASK), \
/* S2 */ CLR(UART_S2_RXEDGIF_MASK)|CLR(UART_S2_MSBF_MASK)| \
/* .. */ CLR(UART_S2_RXINV_MASK)|CLR(UART_S2_RWUID_MASK)| \
/* .. */ CLR(UART_S2_BRK13_MASK), \
/* C3 */ CLR(UART_C3_T8_MASK)|CLR(UART_C3_TXDIR_MASK)| \
/* .. */ CLR(UART_C3_TXINV_MASK)|CLR(UART_C3_ORIE_MASK)| \
/* .. */ CLR(UART_C3_NEIE_MASK)|CLR(UART_C3_FEIE_MASK)| \
/* .. */ CLR(UART_C3_PEIE_MASK), \
/* MA1 */ SET(UART_MA1_MA(0x00)), \
/* MA2 */ SET(UART_MA2_MA(0x00)), \
/* C4 */ CLR(UART_C4_MAEN1_MASK)|CLR(UART_C4_MAEN2_MASK)| \
/* .. */ CLR(UART_C4_M10_MASK)|((CALC_BRFA(brate,bclk)>>0)&0x1f), \
/* C5 */ CLR(UART_C5_TDMAS_MASK)|CLR(UART_C5_RDMAS_MASK), \
/* C7816 */ CLR(UART_C7816_ONACK_MASK)|CLR(UART_C7816_ANACK_MASK)| \
/* ..... */ CLR(UART_C7816_INIT_MASK)|CLR(UART_C7816_TTYPE_MASK)| \
/* ..... */ CLR(UART_C7816_ISO_7816E_MASK), \
/* IE7816 */ CLR(UART_IE7816_WTE_MASK)|CLR(UART_IE7816_CWTE_MASK)| \
/* ...... */ CLR(UART_IE7816_BWTE_MASK)|CLR(UART_IE7816_INITDE_MASK)| \
/* ...... */ CLR(UART_IE7816_GTVE_MASK)|CLR(UART_IE7816_TXTE_MASK)| \
/* ...... */ CLR(UART_IE7816_RXTE_MASK), \
/* IS7816 */ CLR(UART_IS7816_WT_MASK)|CLR(UART_IS7816_CWT_MASK)| \
/* ...... */ CLR(UART_IS7816_BWT_MASK)|CLR(UART_IS7816_INITD_MASK)| \
/* ...... */ CLR(UART_IS7816_GTV_MASK)|CLR(UART_IS7816_TXT_MASK)| \
/* ...... */ CLR(UART_IS7816_RXT_MASK), \
/* WP7816T0 */ SET(UART_WP7816_T_TYPE0_WI(0x0a)), \
/* WP7816T1 */ SET(UART_WP7816_T_TYPE1_CWI(0x00))| \
/* ........ */ SET(UART_WP7816_T_TYPE1_BWI(0x0a)), \
/* WN7816 */ SET(UART_WN7816_GTN(0x00)), \
/* WF7816 */ SET(UART_WF7816_GTFD(0x00)), \
/* ET7816 */ SET(UART_ET7816_TXTHRESHOLD(0x00))| \
/* ...... */ SET(UART_ET7816_RXTHRESHOLD(0x00)), \
/* TL7816 */ SET(UART_TL7816_TLEN(0x00)) \
}

Outcomes