my code as follow
*pSIC_IAR1=0x34666666; *pSIC_IAR2=0x66666666; register_handler(ik_ivg10, DMA7_UART_TX_ISR); register_handler(ik_ivg11, UART_RxIsr);
*pSIC_IMASK|=0x00004000; //uart interrupts
*pSIC_IMASK|=0x00008000; //uar dma7 interrupts
*pDMA7_CONFIG=0x0080; /* ,linear block,8bit,Source */ ssync();
*pDMA7_X_COUNT = 10; ssync();
*pDMA7_X_MODIFY = 1;/*Linear*/ ssync();
*pDMA7_Y_COUNT = 0; ssync();
*pDMA7_Y_MODIFY = 0; ssync();
/* enable sport0_dma_start_hi_addr */ *pDMA7_START_ADDR = test_S; ssync();
int iDivisor = 0; *pUART_GCTL = UCEN; //enable access to UART_DL registers *pUART_LCR = DLAB;
iDivisor = SCLK/(BAUD*16); *pUART_DLL = iDivisor; *pUART_DLH = iDivisor>>8; //set UART frame to 8 bits, no parity, 1 stop bit. *pUART_LCR = WLS(8); //start the uart interrupt ssync(); *pUART_LCR &= ~DLAB;// Disable Divisor Latch Access ssync();
*pUART_IER =0x3;//Enable interrupts for receive & transmit
//*pUART_IER =0x2;//Enable interrupts for transmit
//*pUART_IER =0x1;//Enable interrupts for receive
ssync(); *pUART_GCTL = UCEN;/*UART Clock enable*/ ssync();
if enable the UART ETBEI interrupts in the UART_IER register,it will cause interrupter immediately and cann't stop .why?
Sorry for the delay in responding to your post. I've attached a sample code for UART tested across two BF533 EZ-Kits and it worked as expected. You can have a look at the register configurations.
in the first answer of this thread ( http://ez.analog.com/message/11734#11734 ) you will find an attached UART project as well.
is it possible to convert the UART program for using it with the BF592 EZ-Kit lite board?
Yes... change the following things:
- add Init_pin_mux function which will enable UART pins of BF592 processor
- change the UART Interrupt enable & mapping instrustions
- change the DMA ID to match with BF592's UART DMA ID's
- And of course, change the processor header file
I have some UART codes for BF592; but is assembly level. Attached are those, if you are interested.
EE-347 contains C-level code for all Blackfin derivatives: