14.1(h) - Serial Communication on the MSP430: The UART - Transmitting a Character to the Terminal

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 พ.ย. 2024

ความคิดเห็น • 4

  • @Xevion
    @Xevion 2 ปีที่แล้ว

    Really great tutorial for learning UART. Very helpful while getting my MSP430FR2355 working.

  • @omartusson
    @omartusson 2 ปีที่แล้ว

    Great video as usual. Thank you very much.

  • @HirilPatelhexagonal
    @HirilPatelhexagonal 2 ปีที่แล้ว

    Thank you for such detailed description. can you advice me on a question here?
    I am recieving sampled data from ADS1220 chip from 3 channel sequentially via spi in MSP430f5529 Mcu but when I try to forward that value to serial port via UART to see it in Maltab I get "ñ/ c ó Ó/ "  p/ ] ‰ -/ A ‘ ¿/ ˆ ä &/ " note that I am using "/" to seperate transactions. But my question is is there a way to send Hex value via uart?
    Thank you

  • @Project-f7b
    @Project-f7b 9 หลายเดือนก่อน

    Why does the code not work?
    #include
    //MSP430F5358
    int main(void)
    {
    WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
    P5DIR |= BIT3;//LED 4
    //--setup UART A2
    UCA2CTLW0 |= UCSWRST; // software reset UCA2CTL0 |= UCSWRST; |= set bit
    UCA2CTLW0 |= UCSSEL__SMCLK; //choose SMCLK=BRCLK (115200 baud)
    UCA2BRW = 8; // prescalar = 8
    UCA2MCTL = 0xD6; // OS16=low freq, set modulation
    P9SEL &= ~BIT3; // change P4.3 function to A1 UART Tx
    P9SEL |= BIT3;
    PM5CTL0 &= ~LOCKLPM5; // turn on io
    UCA2CTLW0 &= ~UCSWRST; // out of software reset UCA2CTL0 |= UCSWRST; &= ~ clear a bit
    int i;
    while (1)
    {
    P5OUT ^= BIT3;//LED 4 // Toggle the pin (XOR operation)
    __delay_cycles(100000);// Add a delay to observe the toggling
    UCA2TXBUF = 'A'; // transmits ASCII code for 'A' over UART
    for(i=0; i