Jump to content

Search the Community

Showing results for tags 'usi'.



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 2 results

  1. I've written a tiny library that implements I2C master functionality on MSP430 devices that only have the USI module (for example, MSP430G2412 or MSP430G2452). It's small, simple, works well for me, and might help others in their projects. Blog post at http://jan.rychter.com/enblog/msp430-i2c-usi-library-released Github repo at https://github.com/jwr/msp430_usi_i2c Have fun!
  2. So finally coded up my lm4970 project. And using a interrupt on switch p1.3, and tried to get LPM. Well, it didn't work. If I remove LPM, it works, but with a huge issue where it keeps looping, but still works. So the only problem is my main code, not the usi/i2c/lm4970 code. What I expect it to do: Initialize everything (Works)Go Into While LoopSwitch on State Variable Run given Case, Break out of Switch Enable Interrupts and Go to Sleep ( LPM4 + GIE )Sleep until Interrupt Interrupt Disables GIE and LPM4, Increases State Variable Exit Interrupt, reach end of While Loop, back to Switch Switch on State Variable, repeat Doesn't do that. If I remove the LPM4_Bits, so only GIE is set and disabled, the code works (I need to debounce in the interrupt, planning on using watchdog or simple delay). But since it never goes to sleep, the while loop keeps running, causing other issues. How can I fix this. In this given case, I could just have the switch/case in the interrupt, but I plan on doing some manual control that would not work well in it. Code below: #include "common.h" #include "i2c.h" #include "lm4970.h" // PB is P1.3 Pushbutton on Launchpad int lm4970_state = 0; // lm4970 State void cpu_init(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WatchDog Timer BCSCTL1 = CALBC1_1MHZ; // Set range to 1mhz Calibrated Range DCOCTL = CALDCO_1MHZ; // Set DCO to 1mhz Calibrated DCO // SMCLK = DCO = 1MHz } void pushbutton_init(void) { P1SEL &= ~PB; // Set PB as GPIO (Part 1) P1SEL2 &= ~PB; // Set PB as GPIO (Part 2) P1DIR &= ~PB; // Set PB as Input P1REN |= PB; // Set PB Pull-Up/Pull-Down Mode P1OUT |= PB; // Set PB Pull-Up P1IES |= PB; // P1.3 Interrupt set for High to Low P1IFG &= ~PB; // P1.3 Interrupt Flag Cleared P1IE |= PB; // P1.3 Interrupt Enabled } // Port 1 interrupt service routine #pragma vector = PORT1_VECTOR __interrupt void Port_1_ISR (void) { // Clear Low Power Mode and Disable Interrupts to Allow MSP to handle commands before returning to sleep _BIC_SR(LPM4_bits + GIE); // _BIC_SR(GIE); lm4970_state++; // Increase LM4970 state by 1 if (lm4970_state > 9) lm4970_state = 0; P1IFG &= ~PB; // P1.3 IFG cleared } int main(void) { cpu_init(); i2c_init(); pushbutton_init(); lm4970_init(); // Setup Complete, now check state, run function, then go to sleep with interrupts while(1) { switch ( lm4970_state ) { case 0: // Off lm4970_shutdown(); break; case 1: // Regular Audio Sync lm4970_audio_sync(); break; case 2: // Randomized Audio Sync lm4970_random(); break; case 3: // Blue *snipped* case 9: // White lm4970_led_color(lm4970_state - 2); break; case 10: // Future Options, Like Color Fade Mode default: // Reset State, Turn Off lm4970_state = 0; lm4970_shutdown(); break; } _BIS_SR(LPM4_bits + GIE); // Low Power Mode x, Enable Interrupts // _BIS_SR(GIE); // Enable Interrupts } }
×
×
  • Create New...