bettyxyz1028
Newbie level 6
Re: Help! Heart rate board (MSP430fg439) can not be powered
Im trying to preset a value(int) in the program. Then later i can replace the value by heart rate reading. I chose P2.4 to be the output pin.
The board is workable and it is fine with original programming. After modifying the progrmming, I compiled and maked the files. It was successful. No error and no warning.
Then i connected the board to the power supply (3 volts). But It was not powered on.
Here is how i modified (I only show the added parts):
void main(void)
{
IE1 |= UTXIE0; // Enable USART0 TX interrupt
P2DIR |= 0x10; // P2.4 output direction
}
void Init(void)
{
// Initialize and enable UART (I dont touch this part)
P2SEL|=BIT4; // P2.4 = TXD
UCTL0 |= SWRST; // UART SWRST = 1
ME1 |= UTXE0; // Enable UART0 TXD
UCTL0 |= CHAR; // 8-bit char, SWRST=1
UTCTL0 |= SSEL1; // UCLK = SMCLK
UBR00 = 18; // 115200 from 2.097152MHz
UBR10 = 0;
UMCTL0 = 0x2c; // Modulation = 0.2044
UCTL0 &= ~SWRST; // UART SWRST = 0, enable UART
}
#pragma vector=usart0rx_vector
_interrupt void usart0_tx(void)
{
while (!(IFG1 & UTXIFG0)); // USART0 TX buffer ready?
TXBUF0 = 15;
}
Added after 1 minutes:
Anyone can help??? TKs a lot!!!!
Im trying to preset a value(int) in the program. Then later i can replace the value by heart rate reading. I chose P2.4 to be the output pin.
The board is workable and it is fine with original programming. After modifying the progrmming, I compiled and maked the files. It was successful. No error and no warning.
Then i connected the board to the power supply (3 volts). But It was not powered on.
Here is how i modified (I only show the added parts):
void main(void)
{
IE1 |= UTXIE0; // Enable USART0 TX interrupt
P2DIR |= 0x10; // P2.4 output direction
}
void Init(void)
{
// Initialize and enable UART (I dont touch this part)
P2SEL|=BIT4; // P2.4 = TXD
UCTL0 |= SWRST; // UART SWRST = 1
ME1 |= UTXE0; // Enable UART0 TXD
UCTL0 |= CHAR; // 8-bit char, SWRST=1
UTCTL0 |= SSEL1; // UCLK = SMCLK
UBR00 = 18; // 115200 from 2.097152MHz
UBR10 = 0;
UMCTL0 = 0x2c; // Modulation = 0.2044
UCTL0 &= ~SWRST; // UART SWRST = 0, enable UART
}
#pragma vector=usart0rx_vector
_interrupt void usart0_tx(void)
{
while (!(IFG1 & UTXIFG0)); // USART0 TX buffer ready?
TXBUF0 = 15;
}
Added after 1 minutes:
Anyone can help??? TKs a lot!!!!