做了个读卡器,MSP430F4152+CH340,
但是出现过MSP430串口损坏的问题。
CH340 使用3V供电, 出现过 CH340 坏过,或者连不上,搁置一会有OK了,坏的,换了CH340就好了。
不过发送数据乱码的事情,却遇到过几次了,更换MSP430就好了
FD 00 FF 06 03 05 47 07 1B A8 F0
FD 01 FF 10 86 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 B2 EE
FD 00 FF 02 CD FF EF
FD 00 FF 06 03 05 47 07 1B AC F0
FD 01 FF 10 A3 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 59 EE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B 24 F0
FD 01 FF 10 C3 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 59 CE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B A4 F0
FD 01 FF 10 A3 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 59 EE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B 4C C1
FD 01 FF 10 A3 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 59 EE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B 64 C1
FD 01 FF 10 23 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 B3 EE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B 48 C1
FD 01 FF 10 A3 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 59 CE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B A8 F0
FD 01 FF 10 46 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 59 EE
FD 00 FF 02 CD FF EF
FD 00 FF 06 03 05 47 07 1B 54 F0
FD 01 FF 10 A3 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 B2 EE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B CC C1
FD 01 FF 10 23 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 59 CE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B 48 C1
FD 01 FF 10 83 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 19 EE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B 58 C1
FD 01 FF 10 A3 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 79 EE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B 24 F0
FD 01 FF 10 43 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 59 EE
FD 00 FF 02 ED FF EF
FD 00 FF 06 03 05 47 07 1B AC F0
FD 01 FF 10 43 FF 04 03 02 01 FE FE FE FE 01 00 00 00 00 B2 EE
FD 00 FF 02 ED FF EF
确定不是程序的问题,因为仿真过,确定BUF里的数据发送时是正确的,更换mcu就好了, 还有就是,上面显示的数据,确实是MCU发送出来的,也排除了CH340坏的问题。
这个问题,焊接了10个样板,出现过2~3次板子,
也就是说MSP430 的串口容易损坏?
端口配置
//Port P6 // P6.7 P6.6 P6.5 P6.4 P6.3 P6.2 P6.1 P6.0
//接线 // GREEN TXD RXD SCK NSS MOSI MISO RC522_RES
P6DIR = 0xfD; // 1 1 0 1 1 1 0 1
P6OUT = 0xfE; // 1 1 1 1 1 1 1 0
P6SEL = 0x60; // 0 1 1 0 0 0 0 0
这个配置,也多种试过,同样没解决
串口配置 ,
P6SEL |= BIT5+BIT6; // P6.5,6 = USCI_A0 RXD/TXD
UCA0CTL0 = 0x00;
UCA0CTL1 |= UCSSEL_1; // CLK = ACLK
UCA0BR0 = 0x03; // 32k/9600 - 3.41
UCA0BR1 = 0x00;
UCA0MCTL = 0x06; // Modulation
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
//IE2 |= UCA0TXIE|UCA0RXIE; // Enable USCI_A0 RX interrupt
|