Part Number:MSP430F2618
Hello!
I am using YF‑S201 water flow sensor to measure the flow of water and read the data into msp430f2618 board. I referred to a code written for the same sensor for the msp430g2553 code and I am attaching that code here. Can anyone suggest the changes that are to be made to make it work with msp430f2618.
#include <msp430g2553.h>
void main(void) {
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
TA0CCR0 = 0xFFFF; // Count limit (16 bit)
P1SEL |= BIT0; // Use P1.0 as TimerA input
P1SEL2 &= ~BIT0; //
P1DIR &= ~BIT0; //
P1OUT &= ~BIT0; // Enable pull down resistor to reduce stray counts
P1REN |= BIT0;
TA0CCTL0 = 0x10; // Enable counter interrupts, bit 4=1
TA0CTL |= TACLR;
TA0CTL |= TASSEL_0 + MC_1;
_BIS_SR(LPM0_bits + GIE); // LPM0 (low power mode) with interrupts enabled
}
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer0_A0 (void) { // Timer0 A0 interrupt service routine
//P1OUT ^= BIT0; // Toggle red LED
}
Also where will the data from the sensor be stored?