Other Parts Discussed in Thread: MSP430FR2311, MSP430FR2433, MSP430WARE, MSP430FR2000
Ref:
Low -Power Hex Keypad Using MSP430™ MCUs
This keypad code for FR2000 works fine on FR2433. CCS: MSP430: Flash/FRAM usage is 422 bytes. RAM usage is 160 bytes.
Nice addition to the FR4133 IR TX Keypad code.
However, the serial UART for sending the number of the pressed key to the PC needs to be changed. The code uses UCA0:
static inline void UART_init() { P1SEL1 = 0x00; // Initialize for USCI_A0 UART operation P1SEL0 = (BIT6 | BIT7); // Configure UART_A0 UCA0CTLW0 = UCSWRST; // Hold UART module in reset mode UCA0BRW = 6; // 4800 baud UCA0MCTLW = 0xEE00; // 32768/4800 - INT(32768/4800) = 0.83 // UCBRSx value = 0xEE (See UG) UCA0CTLW0 = UCSSEL_1; // release from reset and set ACLK=32768 as UCBRCLK }
The only example code for the 2433 LP uses UCA1 (?) and DriverLib and RX interupt:
// Initialize EUSCI void initEusci(void) { // Configure UCA1TXD and UCA1RXD P1SEL0 |= BIT4 | BIT5; P1SEL1 &= ~(BIT4 | BIT5); // Configure UART // software-dl.ti.com/.../index.html EUSCI_A_UART_initParam param = {0}; param.selectClockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK; param.clockPrescalar = 8; param.firstModReg = 10; param.secondModReg = 247; param.parity = EUSCI_A_UART_NO_PARITY; param.msborLsbFirst = EUSCI_A_UART_LSB_FIRST; param.numberofStopBits = EUSCI_A_UART_ONE_STOP_BIT; param.uartMode = EUSCI_A_UART_MODE; param.overSampling = EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION; if(STATUS_FAIL == EUSCI_A_UART_init(EUSCI_A0_BASE, ¶m)) { return; } EUSCI_A_UART_enable(EUSCI_A0_BASE); EUSCI_A_UART_clearInterrupt(EUSCI_A0_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT); // Enable USCI_A0 RX interrupt EUSCI_A_UART_enableInterrupt(EUSCI_A0_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT); // Enable interrupt }
Changing UCA0 to UCA1 in the FR2000 code doesn't work.
So what is UCA0, UCA1? and What is the difference between USCI_A0, EUSCI_A_UART? How do I change the FR2000 code to run at the backchannel UART of FR2433? All that is needed is to send a key number 0-15 via the FR2433 backchannel UART.
Thank you in advance. Nice addition to the FR4133 IR TX Keypad code.
Roy