Jump to content

Search the Community

Showing results for tags 'ms430'.



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 1 result

  1. Hi everyone, I wanted to connect a MSP430 to an Android device. In fact, my idea was to use the MSP430 launchpad as a low-cost GPIO board for an Android tablet. I did a little research, and first thought on the audio port for the communication ( http://robots-everywhere.com/re_wiki/index.php?title=Serial_on_Android_using_the_audio_port ) but then I remembered that the tablet supported USB OTG. So, I compiled the CDC_ACM module for the (Allwinner A10 based) tablet in order to emulate serial port over USB. Then, in the MSP430 Launchpad side, I needed a lib for using the serial port. I found MSP430-softuart by Stefan Wendler (https://github.com/wendlers/msp430-softuart) and used it for the bidirectional communication Android-Tablet<->MSP430-Launchpad. In order to make a demo, I modified the code of Open Source Vector Pinball (http://dozingcatsoftware.com/VectorPinball/index.html ), adding support for serial port access (using http://code.google.com/p/android-serialport-api/). This modified Vector Pinball has the flippers linked to MSP430 Launchpad buttons. When the buttons on P2.5 and P2.3 are pressed they flippers are activated. A LED is also connected on P1.6 in order to toggle it when receiving "toggle" command from the Android app. You can find the video demo here: This is the source code for the MSP430 (find it also attached to this post) #include <msp430.h> #include <stdint.h> #include "uart.h" #define LED1 BIT0 #define LED2 BIT6 #define BUTTON1 BIT5 #define BUTTON2 BIT3 static volatile bool r = false; static volatile bool l = false; int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer BCSCTL1 = CALBC1_1MHZ; // Initialize clock DCOCTL = CALDCO_1MHZ; P1DIR |= (LED1 + LED2); // Set BIT0 and BIT6 as output P1OUT &= ~(LED1 + LED2); // LEDs off P2REN |= (BUTTON1 + BUTTON2); // Select pull-up resitors por P2.3 and P2.5 P2IE |= (BUTTON1 + BUTTON2); // Enabling Button interrupts P2IFG &= ~(BUTTON1 + BUTTON2); // Clear interrupt flags for the buttons uart_init(); __enable_interrupt(); uint8_t c; while(1) { if(uart_getc(&c)) { if (c == 't') { P1OUT ^= (LED2); // Toggle LED2 } } if (l) { uart_putc('l'); // Send "left" command via UART l = false; } if (r) { uart_putc('r'); // Send "right" command via UART r = false; } } } // Port 2 interrupt service #pragma vector=PORT2_VECTOR __interrupt void Port_2(void) { if ((P2IFG & BUTTON2)) { P1OUT ^= LED1; // Toggle LED1 P2IFG &= ~BUTTON2; // Clear BUTTON2 interrupt flag P2IES ^= BUTTON2; // Interrupt called on High-to-Low and Low-to-High l = true; } if ((P2IFG & BUTTON1)) { P1OUT ^= LED1; // Toggle LED1 P2IFG &= ~BUTTON1; // Clear BUTTON1 Interrupt flag P2IES ^= BUTTON1; // Interupt called on High-to-Low and Low-to-High r = true; } } Later today, I will include the schematic and a guide with the steps for replicating the setup in case you want to build it. Do you find the project interesting? msp430-pinball.tar.gz
×