Part Number:AM5708
Hi,
I am trying to use the PRU - UART0, I refer to the pru-software-support-package/examples/am335x/PRU_Hardware_UART project, also carried out in accordance with the manual AM5708 datasheet (Section 30.7.3.7) to initialize the UART , But pr1_uart0_rxd and pr1_uart0_txd have no output ,both pins are 3.3v . And I've closed the loopback register. So I don't know what went wrong. Does the IO port need any special PinMux configuration? What should I do now?
The relevant code:
/*init*/ CT_UART.DIVISOR_REGISTER_LSB_ = 104; CT_UART.DIVISOR_REGISTER_MSB_ = 0; CT_UART.MODE_DEFINITION_REGISTER = 0x0; CT_UART.INTERRUPT_ENABLE_REGISTER = 0x7; CT_UART.INTERRUPT_IDENTIFICATION_REGISTER_FIFO_CONTROL_REGISTER = (0x8) | (0x4) | (0x2) | (0x1); CT_UART.LINE_CONTROL_REGISTER = 3; CT_UART.MODEM_CONTROL_REGISTER = 0; //disable loopback CT_UART.POWERMANAGEMENT_AND_EMULATION_REGISTER = 0x6001; /*send*/ /* Priming the 'hostbuffer' with a message */ hostBuffer.data[0] = 'H'; hostBuffer.data[1] = 'e'; hostBuffer.data[2] = 'l'; hostBuffer.data[3] = 'l'; hostBuffer.data[4] = 'o'; hostBuffer.data[5] = '!'; hostBuffer.data[6] = '\0'; /* Let's send/receive some dummy data */ for (cnt = 0; cnt < MAX_CHARS; cnt++) { /* Load character, ensure it is not string termination */ if ((tx = hostBuffer.data[cnt]) == '\0') break; CT_UART.RBR_THR_REGISTERS = tx; /* Wait for TX FIFO to be empty */ while (!((CT_UART.INTERRUPT_IDENTIFICATION_REGISTER_FIFO_CONTROL_REGISTER & 0x2) == 0x2)) ; } /*Read Data*/ for (cnt = 0; cnt < MAX_CHARS; MAX_CHARS) { if ((CT_UART.LINE_STATUS_REGISTER & 0x1) != 0) { buffer[cnt] = CT_UART.RBR_THR_REGISTERS; } } /*Uart end*/
Best Regards
Echo