Jump to content

Search the Community

Showing results for tags 'embedded c'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 3 results

  1. Hello guys,i have a question for my project im using the msp430g2231 microcontroller and i want to measure frequencies up to 10Mhz.Im new to microcontrollers(not programming),and im not sure how to make the overflow work void main(void) { WDTCTL = WDTPW + WDTHOLD; // stop watchdog timer BCSCTL1 = CALBC1_1MHZ; // Set range DCOCTL = CALDCO_1MHZ; // Set DCO step + modulation delay(100); // delay 100mS until next screen refresh /*** Timer_A Set-Up ***/ TA0CCR0 = SampleTuneTime; TA0CCTL0 |= CCIE; // Interrupt enable TA0CTL |= TASSEL_1 + ID_3; // SMCLK TA0CCTL1 |= CCIE + CCIS_0 + CM_1 + CAP; // Interrupt enable, capture select CCIxA, Positive edge, capture mode TA0CTL |= TASSEL_1; //SMCLK _BIS_SR(GIE); // Enter LPM0 with interrupts enabled while(1) { TA0CTL |= MC0; // Start timer up mode.Timer counts up to TACCR0 TA0CTL |= MC1; // Start timer //while(CounterValue != 400); // Wait while CounterValue is not equal to 400 TA0CTL &= ~MC0; // Stop timer mode TA0CTL &= ~MC1; // Stop timer Result >>= 2; // Divide Result by 4 calc_freq(); //convert long into frequency char buffer[8]= { 0, }; unsigned long toLCD = Frequency; // int Base = 10; itoa(toLCD,buffer); //convert decimal lcd_init(); send_string("FREQUENCY IS"); send_command(0xC0); send_string(buffer); send_command(0xC8); send_string("HZ"); Result = 0; // Zero Result CounterValue = 0; // Zero CounterValue StoredCount = 0; // Zero StoredCount TA0R = 0; // Zero Timer_A0 register } } #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer0_A0(void) { TA0CTL &= ~MC0; // Stop timer TA0CTL &= ~MC1; // Stop timer CounterValue++; // Increment CounterValue if (CounterValue >= (NumberSamples +1)) // Reset values if NumberSamples +1 is reached { CounterValue = 0; // Zero CountValue StoredCount = 0; // Zero StoredCount } Result += StoredCount; // Store accumulated count in Result StoredCount = 0; // Zero StoredCount TA0CTL |= MC1; // Start timer TA0CTL |= MC0; // Start timer StoredCount++; // Increment StoredCount } this is the main code of the program im using custom made function for the itoa and the communication with the LCD.I have two questions 1.) Can i make the frequency meter up to 10Mhz cuz the g2231 has one timer and 1Mhz calibration available. 2.)Can i somehow check if the code is working cuz i dont have any way to send frequency right now,like counting the internal frequency or something like that. Thank you for your time.
  2. Hey All, I tired to write a code, just check it out and tell me whether it gives out a LED glowing MSP430 or no. I know i am bad coder but i am learning it. Code is attached below. Tell me what all i should add in it. Thanks And Regards Msp.txt
  3. Hey All, Hieeeee When i am debugging my code, it is giving a error called Multiple markers at this line - <a href="file:/D:/code%20composer%20studiov5/ccsv5/tools/compiler/dmed/HTML/MSP430/1527.html">#1527-D</a> (ULP 2.1) Detected SW delay loop using empty loop. Recommend using a timer module instead - #20 identifier "ADC10TL1" is undefined ON THIS LINE while(ADC10CTL1 & ADC10BUSY); Thanks in anticipation Nikki
×
×
  • Create New...