This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
這是我的程式碼
#include "msp430x54x.h"
#include "lcd.h"
int a ;
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
P5SEL = BIT6+BIT7;
UCA1CTL1 |= UCSWRST;
UCA1CTL1 |= UCSSEL_1;
UCA1BR0 = 3;
UCA1BR1 = 0;
UCA1MCTL |= UCBRS_3 + UCBRF_0;
UCA1CTL1 &= ~UCSWRST;
UCA1IE |= UCRXIE;
__bis_SR_register(LPM3_bits + GIE);
__no_operation(); }
#pragma vector=USCI_A1_VECTOR
__interrupt void USCI_A1_ISR(void)
{
switch(__even_in_range(UCA1IV,4))
{
case 0:break;
case 2:
while (!(UCA1IFG&UCTXIFG));
LCD_main();
if(a%2==0)
{
lcdlongint(3,0,UCA1RXBUF);
a++;
}
else
{
lcdlongint(3,1,UCA1RXBUF);
a++;
}
case 4:break;
default: break;
}
}
因為我是利用RS-232連接讀卡機,因為讀卡機刷卡讀取卡號為40BIT(RS-232測試軟體讀到為191 191 191 191 223 )
但MSP430無法讀取從讀卡機傳來的卡號,但如果在8BIT以下的都讀取的到(RS-232測試軟體傳送8個BIT以下的MSP430 LCD都收的到)
請問有甚麼方式可以讓MSP430接收到40個BIT
我使用的軟體為CCS