Tool/software: Code Composer Studio
Hello,
In my project I need to use the I2C mode to transmit the data, which is a variable in decimal. Do I have to convert it to hex before transmitting?
Thank you.
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.
Tool/software: Code Composer Studio
Hello,
In my project I need to use the I2C mode to transmit the data, which is a variable in decimal. Do I have to convert it to hex before transmitting?
Thank you.
Hello Clemens,
Thank you for the reply. I have one more question.
I want to develop only one short pulse once a push button is pressed and do not want the pulse to continue like PWM.
Using MSP430F5529, I need to turn on P1.2 for 250 microseconds and then turn it off.
Please see my code:
#include <msp430F5529.h>
int main() {
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= BIT2; //set P1.2 as output
P1SEL |= BIT2; //select timer function
P1REN |= BIT1; //enable P1.1 internal resistance
P1OUT |= BIT1; //pull-up resistance
P1IE |= BIT1; //enable P1.1 interrupt
P1IFG &= ~BIT1;
__bis_SR_register(LPM0_bits + GIE);
for(;;)
{}
}
#pragma vector = PORT1_VECTOR
__interrupt void PORT1_ISR(void)
{
/*Here I want a pulse with duty-cycle of 250us at the frequency of 150 Hz. So I found the period to be 660 us.
To develop only one pulse and stop pwm, do I need to use OUTMOD_5 to reset it? How can I do that?
*/
TA0CCR0 = 660;
TA0CCTL1 = OUTMOD_7;
TA0CCR1 = 2;
TA0CTL = TASSEL_1 + MC_1 + TACLR;
P1IFG &= ~BIT1;
}
Thank you so much for the help.
**Attention** This is a public forum