Quantcast
Channel: MSP Microcontroller Projects
Viewing all 81 articles
Browse latest View live

WS2811/5050RGB LED 4x4 Matrix Booster Pack

$
0
0

PROJECT DESCRIPTION

WS2811/5050RGB LED 4x4 Matrix Booster Pack

Available on Tindie

[View:http://www.youtube.com/watch?v=5MoRYnNlmB8]


IV-18 VFD Clock BoosterPack

$
0
0

PROJECT DESCRIPTION

IV-18 VFD Clock Boosterpack

Click here for documentation and project thread

PROJECT FEATURES:

  • Retro look
  • Compatible with the MSP430 Launchpad
  • Time configurable via Serial
  • PCB Design and code open-source
**I can't seem to post the youtube videos - so they're available here:


Pictures:

USER'S GUIDE:

Forum Thread

43oh.com Wiki Entry

Buy PCBs @ the 43oh store or Buy on Tindie

RTC using DS1394, launchpad and display driver on tm1638

$
0
0

PROJECT DESCRIPTION

This is my project Real Time Clock. The project used RTC module ds1394, temperature sensor ds18b20 and driver 7-segment display tm1638. msp430g2553 MCU integrates devices with two hardware ports SPI (USART1, USART2).

Clock Functions:

- Showing the time, date, day of the week;
- Set the alarm;
- Shows the temperature of the sensor ds18b20;
- Control the brightness of the indicator.


[View:http://youtu.be/-lOz5-EMays]

RESOURCES:

[View:http://e2e.ti.com/cfs-file.ashx/__key/communityserver-components-userfiles/00-00-10-45-30-Attached+Files/4722.watches.rar]

USER'S GUIDE:

my blog (Russian)

EZ430-RF2500 Wireless Data Logger

$
0
0

PROJECT DESCRIPTION

A Simple easy to use Wireless Data Logger using TI EZ430-RF2500 RF Module. The data obtained via ADC pins on the EZ430 RF2500 Target Module is available to the user via a Windows based Graphic User Interface (GUI) developed using Visual C#. I was getting emails from way too many people regarding how to work with the EZ430-RF2500 Module. So, i finally decided do one small project.


                                           Fig: Graphic User Interface (GUI) of the Project

GUI FEATURES:

  • Obtain and display data coming from the EZ430-RF2500 Target Module easily.
  • Data can also be plotted realtime.
  • Data can be logged into excel sheet and saved for further use.
  • Real time graphs can be saved as image file.

[View:http://www.youtube.com/watch?v=znqs6nZHLhM]

USER'S GUIDE:

You need to upload the codes to both the EZ430-RF2500 Target Modules for working with the GUI. The code and the application GUI can be downloaded from the link below: [View:http://e2e.ti.com/cfs-file.ashx/__key/communityserver-components-userfiles/00-00-09-14-89-Attached+Files/2727.ez430_2D00_rf2500-wireless-data-logger.rar]

I have tried my best to comment the code properly for those who are new to the MSP430 development environment. You can also view the video for the demonstration of the GUI. The link is embedded in this post.

To upload the code to EZ430 Module, you can either use CCS (Code Composer Studio) or IAR Workbench. I personally prefer IAR Workbench just for this particular module since it's easier to work with the header files in IAR Workbench. You will need to use SimpliciTI Library files for working with the code that i have used. You can download it from here: http://www.ti.com/tool/simpliciti (Download the version for MSP430)

For any queries and suggestions, feel free to drop me a mail.

EZ430-RF2500 Wireless Mouse Project

$
0
0

PROJECT DESCRIPTION

A simple easy to use wireless mouse developed using TI EZ430-RF2500 RF Module. The project is rather simple. All you need is a resistive/capacitive touch screen (I got mine from a mobile repair shop) and the EZ430-RF2500 kit and you are ready to go. I use a coin cell battery (3V) to power the touch screen and EZ430 Target module. The X axis and Y axis data is obtained from the touch screen via A/D conversion using the EZ430-RF2500 module. The data is then transferred to the other target board connected to the Laptop/PC (via a Serial UART interface). The data obtained is then processed via a application GUI which i developed in Visual C# programming language using Visual Studio 2010. The GUI interacts with the windows and generates mouse actions accordingly. The application simulates all mouse actions including the mouse scroll. 

I have attached the source code for the Application GUI along with the other download files since you will need to edit certain conditions in the mouse logic code in case you want to make one by yourself. Use Visual Studio 2010 or higher to edit the code.
















                                       Fig: Application GUI for the Project

















Fig: Wireless Mouse (Just a Resistive Touch Screen, a EZ430-RF2500 Target module, some LEDs and a coin cell battery to power the unit)

[View:http://www.youtube.com/watch?v=L04wjp8Pzxg]

USER'S GUIDE:

You will need to upload the codes to both the EZ430-RF2500 Target Modules for working with the GUI. The code for the target modules and the GUI Source Code can be downloaded from the link below: [View:http://e2e.ti.com/cfs-file.ashx/__key/communityserver-components-userfiles/00-00-09-14-89-Attached+Files/5008.ez430_2D00_rf2500-wireless-mouse-project.rar]

I have tried my best to comment the code properly for those who are new to the MSP430 development environment. You can also view the video for the demonstration of the GUI. The link is embedded in this post.

To upload the code to EZ430 Module, you can either use CCS (Code Composer Studio) or IAR Workbench. I personally prefer IAR Workbench just for this particular module since it's easier to work with the header files in IAR Workbench. You will need to use SimpliciTI Library files for working with the code that i have used. You can download it from here: http://www.ti.com/tool/simpliciti (Download the version for MSP430).

Note: The X-axis and Y-axis data are read via the P3 and P5 pins on the Target module respectively.

For any queries and suggestions, feel free to drop me a mail.

MSP430 Launchpad Handler Jam Communication

$
0
0

PROJECT DESCRIPTION

We are developing a direct email notification system to Product/Test engineers within TI for when there is a problem with their Castle Handler on the test floor.

Our MSP430 Launchpad "listens" to the communication between the Tester and Handler and continuously checks for jam codes that can occur during testing. When one of these jam codes come up, our MSP430 writes a file to a laptop and sends an email to the engineer that there has been a problem on the test floor.

This project solves the wasted time that a Product/Test engineer might believe their tests are running but when, in reality, the Handler is stuck waiting for someone to clear the jam code.

We hope that with more time and testing on our design, we could possibly create an attachment that could clear the most common error codes that occur during testing and also notify the engineer without a laptop connected. In the end, this will benefit both the engineers and the company as it decreases wasted time and therefore increases savings for the company.

TEAM MEMBERS:

  • Shelby Turner
  • Joey Yuen
  • Samuel Chabot

PROJECT FEATURES:

  • Communication between handler to MSP430 Launchpad
  • Benefits Product/Test engineers in real-world situations
  • Uses RS-232 Serial Communication

                                                                                                                                                                                                                                                                                                                                                                                               Youtube Video: To be added

RESOURCES:

To be added

USER'S GUIDE:

To be added

EP-Light Visible Light Communication BoosterPack

$
0
0

PROJECT DESCRIPTION

Do you have the experience that you cannot connect to a wireless AP in a crowded place? Since the number of wireless devices keep increasing each year, the wireless congestion problem has become significant. In order to mitigate wireless traffic, visible light communication (VLC) is a promising RF-alternative. VLC transmit information using light, which is safe, efficient and secured. VLC also has advantages on the places where RF is not available, for example, hospital or aircraft.

We design EP-Light BoosterPad- a simple visible light communication (VLC) transceiver working on MSP430 Launchpad. We demonstrate that we can achieve 32 Kbps using EP-Light. EP-Light shows the concept of future indoor lighting infrastructure, which not only lights up the room but also transmits information. 

EP-Light System Architecture:

EP-Light composed of two major subsystems - transmitter and receiver. In the transmitter subsystem, MSP430 controls LED driver which provides high current and toggles the LED to transmit information. As for receiver subsystem, receiver contains a photodiode (PD) which converts light into current and a transimpedance amplifier (TIA) converts current into voltage. Additional analog signal conditioning circuit and digital interface are necessary for MSP430 to decode signal.

EP-Light BoosterPack Gallery:

Demo:

In the demo setup, two computers are separated. Each computer connects to a MSP430 Launchpad with an EP-Light. One for transmitter and the other is receiver. Both computers listen to UART of MSP430. Keyboard input on transmitter will show up in the receiver's computer.

[View:http://www.youtube.com/watch?feature=player_embedded&v=efpZW0v3jrU]

TEAM MEMBERS:

  • Ye-Sheng Kuo
  • Zhenhua Yu

PROJECT FEATURES:

  • Transmit information using light.
  • New wireless communication device.
  • Can replace indoor light bulb.
  • Supports 32 Kbps on MSP430 Launchpad. BoosterPack itself support more than 100 Kbps.
  • Support dimming

RESOURCES:

Using the "Insert File" button above, upload all of your code, design files, schematics, documentation, bill of materials (BOM), etc. I suggest you zip your content together and upload it as one large file.

USER'S GUIDE:

Use this section to explain how someone can use your project. Feel free to include your "how-to-guide" directly on this webpage, or include it as an embedded file (word document, PDF, etc) using the "Insert File" button above.

FlashBot

$
0
0

PROJECT DESCRIPTION

There are times when GPS is not enough or available, such as when inside building where GPS signal is blocked. The aim of our project is to get direction using an alternative source: Light. It could be sunlight, flash light and etc. To achieve this, we arm two sides of our vehicle (wheelchair) with two photo resistors (inside homemade coffee cups). The sensed signal tells the direction of light. Then the vehicle driven from MSP430 with PWM control make turns accordingly based on the sensed signal comparison. One cool part of the project is that our code runs real time on Android devices runnning basic, communicating with MSP430 through bluetooth. 

TEAM MEMBERS:

  • Yingzhe Hu
  • Minjie Chen
  • Jalal Uddin
  • Special thanks: Leonardo Estevez

PROJECT FEATURES:

  • The EYE: Two photo resistors serve as the eye of the wheelchair. To better collect light, we arm the photo resistors with homemade coffee cups (see image below). The photo resistors are biased with fixed resistors for voltage readout. For better SNR, the fixed resistor value is selected roughly the same as photo resistor value under ambient light condition. The sensed voltage signal is feed to pin 6 and 7 of MSP430 for A/D conversion.

 

 

  • The  BRAIN: The brain is the Android device that runs code in real time. Every 100ms, the digitized sensor signals from pin 6 and 7 are first sent to Android device through Bluetooth radio on PCB. Then the Android device make comparison of the signals with certain threshold. Finally, based on the comparison results, the decision of turning left/right or stay still is sent back to MSP430 through Bluetooth.

 

  • .

 

  • The ENGINE: We equipped the wheelchair with two differential motor as the engine. The power of the motors are drawn from two power FETs on the PCB. These power FETs are driven from two PWM output of MSP430, pin 2 and 14. The level of the PWM output, which determins the speed and direction of the wheelchair, is sent from Android device as described in the BRAIN part.   

 

Demo Video:

[View:http://www.youtube.com/watch?v=5-tPJojaGgI&feature=youtu.be]

 

RESOURCES:

[View:http://e2e.ti.com/cfs-file.ashx/__key/communityserver-components-userfiles/00-00-15-36-44-Attached+Files/6403.code-and-schematic.zip]

 

 


MSP430 oscilloscope

Radio FM controlled by android over bluetooth.

$
0
0

PROJECT DESCRIPTION

The ideabehindtheprojectwas bornfrom thefollowingproblemconcerning the useof anandroid tabletascarputer.One of the limitationsof using atablet ascarputeris the absenceofFM radioin almostall tabletsout there.

The launchpad, in this caseis used to controlvia theI2C protocol,thevery cheapPhilipsTEA5767radio module (1.9$ on ebay).The communication between theandroid appandthe launchpadis througha cheapbluetooth module(HC-5)using the UART protocolof the MSP430G25.


TEAM MEMBERS:

  • Salvatore Ventura

PROJECT FEATURES:

  • Wireless bluetooth comunication with android app.
  • Exploring I2c and UART protocols
  • Starting point forthe construction ofremote control (robot, home automation, ecc

[View:http://www.youtube.com/watch?v=v1GQ98AB56E&feature=player_embedded]

RESOURCES:

http://www.salvatoreventura.altervista.org/blog

USER'S GUIDE:

MSP430 Launchpad ControlWare v1.0

$
0
0

PROJECT DESCRIPTION

The main aim of the project was to create a Simple, Easy to control Graphic User Interface (GUI) to control various pins on MSP430 Launchpad (MSP430g2553 uC). The GUI for this purpose was created using Visual C# and can be used on any Windows based PC/Laptop.

                                        Fig: Graphic User Interface (GUI) of the Project

FEATURES

  • The GUI allows the user to test and develop hardware without having to write any code for the device.
  • Pins configured GPIO can be turned "LOW" or "HIGH".
  • The present version of the GUI enables real time data acquisition and plotting. The data obtained from the pins configured as "ADC" can also be stored in an Excel Sheet. Data from Internal Temperature Sensor of the uC can be obtained and plotted as well.
  • The GUI enables the user to Generate three independent PWM Signals and vary the Duty Cycle.
[View:http://www.youtube.com/watch?v=KnO5nSR6CU4] 

USER'S GUIDE

You need to upload a code to the MSP430g2553 microcontroller for working with the GUI. The code and the application GUI can be downloaded from the link below: [View:http://e2e.ti.com/cfs-file.ashx/__key/communityserver-components-userfiles/00-00-09-14-89-Attached+Files/6761.msp430-controlware.rar]

Extract the contents of the download file and load the MSP430_ControlWare project in Code Composer Studio and upload the code to the MSP430 Launchpad (MSP430g2553 uC). You can also view the video for the demonstration of the GUI. The link is embedded in this post.

How to Upload Code to the MSP430 Launchpad?

Open CCS and Click on the Projects Option at the Top and Select the Import Existing CCS Eclipse Project option. Enter the directory location where you have extracted the download files and Click Finish. Select the Project in the Project Explorer and Click on the Debug Option.

Note: Incase you find that the GUI is not working, please install .NET Framework 4.0 from here: LINK

For any queries and suggestions, feel free to drop me a mail.

Simple rear bike light on MSP430

$
0
0

Simple rear bike light on MSP430

The device increases safety of trips to a night-time, based on MSP430F2011. Contains a minimum of details.

As a radiator of light three red light-emitting diodes (LED) with a diameter of 10 mm are used.  Current of a LED doesn't exceed 7 мА at completely charged batteries.

As the power supply are used 4хААА by NiMH of 2100 mah.

The device has three operating modes:
  - waiting mode (stand by)
  - mode 1/3 (cyclic blinking of one LED)
  - mode 3/3 (cyclic blinking of three LEDs)

Frequency of a blinking of LEDs of 1 Hz. 700 ms off, 300 ms on.
In a waiting mode the microcontroller is in the LP4 mode. In a mode 3/3 in LP3. Power switch not exist.

RESOURCES:

Experiment board for MSP430 & TIVA launchpads

$
0
0
Expermnetal Board for MSP430 and TIVA Launchpads

PROJECT FEATURES:

Strictly speaking this is not a project but I thought this will help you to build great projects based on MSP430, TIVA and other launch pads.

This is basically an experiment board designed to fit on various Launchpads from TI. Have a look at the following pics for your information.

As you can see, these boards are Double sided PTH boards with matching Red solder masking color.

These boards are from Iknowvations. You can buy these boards from Iknowvations Shoppee.

The board cost only 4.95 US $

[View:http://www.youtube.com/watch?v=4p_vHeHqvQo]

RESOURCES:

USER'S GUIDE:

Use these boards as per your project needs.

Control of the buck converter for battery charging with MSP430

$
0
0

PROJECT DESCRIPTION

This project presents a programming of MSP430G2553 to control buck converter for charging a battery 12V9Ahr. In this work the design of the buck converter is not performed.

TEAM MEMBERS:

  • Waner

PROJECT FEATURES:

  • Control of converter buck
  • Use of compensator PI in MSP430G2553
  • Charging battery by algorithm four step

The figure 1 shows the structure of the buck converter. The transistor SW is controlled by the PWM signal pin P1.2. For controlling the battery charging, the current iL and voltage Vb are read by ADC. The figure 2 shows the waveform of current iL. To read the current iB, which is average value of iL, the ADC is triggered in middle time which the transistor is off. To do this, the ADC is triggered by TACCR2, TACCR1 is signal of PWM to transistor SW. Figure 3 shows the signal PWM and trigger ADC.

Figure 1

Figure 2

Figure 3

Figure 4 shows the flowchart of the algorithm four steps, the step slow charging is not performed in the project.  Compensator gains are not adjusted, because it must be taken into account the values ​​of L and C. In this moment, the converter wasn't builded.

Figure 4

Simple MPPT with MSP430

$
0
0

PROJECT DESCRIPTION

This project presents a simple implementation of algorithm P&O  to tracker the maximum power point (MPPT) of a solar panel. For the power circuit, was used the buck converter.

TEAM MEMBERS:

  • Waner

PROJECT FEATURES:

  • Algorithm P&O in MSP430
  • Renewable energy

The algorithm P&O, is show in Figure 1 and the circuit in Figure 2. I suggest using a rail-to-rail amplifier with 3.3V supply for best result and protection of the ADC. The OPA2350 of TI is a good choice. The tracking of the maximum power point is done every 0.5 seconds.


Adding NFC to your LaunchPad projects!

$
0
0

PROJECT DESCRIPTION

To help you add NFC to your LaunchPad projects quickly! The following instruction sets were developed to provide users with a detailed set of instructions to get NFC running on their LaunchPad and to show them the available features using the new TRF7970ABP designed by DLP Design.

Two instruction sets were created: one for the G2553 LaunchPad and one for the 5529 LaunchPad.

For the G2553 LaunchPad we will show you how to visually (by LED) see what type of tag is being presented to the LaunchPad and via a serial monitor program such as PuTTY or HyperTerminal you can read out tag types, UID, RSSI and the # of tags.

For the 5529 LaunchPad we will show you how to use our NFCLink software and a GUI provided by Stollman to read tags, write tags, run the NFC transceiver in Peer-to-Peer mode using two BoosterPacks or an NFC device and place the transceiver in card emulation mode.

 

PROJECT FEATURES:

For 2553 (link to instructions under image):

  • Read tag type, UID, RSSI and # of tags present

For 5529 (link to instructions under image):

  • Read/Write Tags with URL, VCard,  Text, Smart Poster or MIME
  • Peer-to-Peer mode
  • Host-based card emulation

For the G2553 LaunchPad: http://www.ti.com/lit/pdf/slab068

For the 5529 LaunchPad: http://www.ti.com/lit/pdf/slab069

Adding WiFi to your G2553 LaunchPad!

$
0
0

PROJECT DESCRIPTION

The scope of this project is to provide users with a set of instructions to get WiFi running on the G2553 LaunchPad using the new CC3000 BoosterPack. The instructions will walk the user through flashing the MSP430 and how to send UDP packets from the LaunchPad.

PROJECT FEATURES:

  • Enabling your G2553 LaunchPad with WiFi
  • Send UDP Packets

Instruction Set: http://www.ti.com/lit/pdf/slab067

Interfacing ePaper BoosterPack with MSP-EXP430G2 LaunchPad

$
0
0

PROJECT DESCRIPTION

This tutorial shows how to interface the ePaper BoosterPack from Pervasive Displays with the MSP-EXP430G2 LaunchPad.

This BoosterPack is bundled with either a 1.44", 2" and 2.7" ePaper display and is available @ http://www.pervasivedisplays.com/kits/ext_kit

This example uses Code Composer Studio to program the MSP-EXP430G2 LaunchPad. Once programmed, we can communicate and control the LaunchPad to display various images, shapes, text, etc on the ePaper display through serial UART commands with the help of a Graphical User Interface (GUI).

PROJECT FEATURES:

  • Easy and low-cost way to demonstrate eInk applications
  • Ultra-Low Power. e-Ink only needs power during state/content display of the screen. Once screen is loaded with the appropriate content, power can be removed and the screen contents remain!
  • This is ideal for electronic shelf labelling & other applications where screen content does not have to change frequently.

[View:http://www.youtube.com/watch?v=d2Kj2NwmzB0]

RESOURCES:

Here is a zip file that includes the CCS project example, installer for the EPD GUI tool as well as some sample images. A power point is also packaged with some instructions.

[View:http://e2e.ti.com/cfs-file.ashx/__key/communityserver-components-userfiles/00-00-01-39-39-Attached+Files/7522.epaper_5F00_boosterpack.zip]

 

Monitor accelerometer movements wirelessly using LaunchPad & CC110L SubGHz RF BoosterPack

$
0
0

PROJECT DESCRIPTION

This tutorial shows how to monitor a 3-axis analog accelerometer wirelessly using the MSP-EXP430F55209LP LaunchPad & CC110L SubGHz RF BoosterPack. This example uses Energia to program this complete solution.

One LaunchPad will continuously read accelerometer data and will send out a wireless transmission whenever the total acceleration exerted on the accelerometer is greater than a pre-defined threshold. Once threshold is exceeded "ALARM!" is sent wirelessly to another LaunchPad, which will toggle an LED on and off when the "ALARM" packet is received.

PROJECT FEATURES:

  • Using MSP-EXP430F5529LP LaunchPad, however the MSP430G2553 and Tiva C LaunchPad can also be used
  • Using the Educational BoosterPack MKII for the 3-axis analog accelerometer (ADXL335)
  • Using the 430BOOST-CC110L SubGHz RF BoosterPack

[View:http://www.youtube.com/watch?v=pQ0IbEemEJY]

RESOURCES:

This uses a code example that comes pre-loaded in Energia v10 and later, but is slightly modified.

Accelerometer + Transmitter code:

/**
* WirelessTest - test transceiver sketch using AIR430Boost FCC driver.
* Copyright (C) 2012-2013 Anaren Microwave, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* This example demonstrates usage of the AIR430BoostETSI library which uses
* the 430Boost-CC110L AIR Module BoosterPack created by Anaren Microwave, Inc.
* and available through the TI eStore, for the European Union.
*
* ----------------------------------------------------------------------------
*
* Note: This file is part of AIR430Boost.
*
* ----------------------------------------------------------------------------
*
* Description
* ===========
*
* Each radio will send a message consisting of: 1 byte counter, 5 byte static
* text. The counter will count from 0 to 9 and will rollover. Each radio will
* wait in receive mode for approximately one second. Upon receiving data, or
* timeout of one second, the radio receive function will return. If valid data
* was received, the radio's receiverOn() method will return the number of bytes
* that were received. In this example, the data can be monitored on the serial
* port (please refer to printTxData() and printRxData() functions).
*
* ----------------------------------------------------------------------------
*
* This example assumes that two BoosterPacks will be used to showcase the
* wireless radio communication functionality. This same code should be
* programmed to both LaunchPad development kits.
*
* This BoosterPack relies on the SPI hardware peripheral and two additional
* GPIO lines for SPI chip-select and GDO0 for packet handling. They use pins 18
* and 19 respectively.
*
* In the default configuration, this BoosterPack is not compatible with an
* external crystal oscillator. This can be changed, if necessary, and would
* require reconfiguration of the BoosterPack hardware and changes to the
* AIR430BoostFCC library. Refer to the BoosterPack User's Manual if necessary.
*
* For complete information, please refer to the BoosterPack User's Manual available at:
* https://www.anaren.com/air/cc110l-air-module-boosterpack-embedded-antenna-module-anaren
*
* To purchase the 430Boost-CC110L AIR module BoosterPack kit, please visit the TI eStore at:
* https://estore.ti.com/430BOOST-CC110L-CC110L-RF-Module-BoosterPack-P2734.aspx
*/

// The AIR430BoostFCC library uses the SPI library internally. Energia does not
// copy the library to the output folder unless it is referenced here.
// The order of includes is also important due to this fact.
#include <SPI.h>
#include <AIR430BoostFCC.h>

// -----------------------------------------------------------------------------
/**
* Global data
*/

// Data to write to radio TX FIFO (60 bytes MAX.)
unsigned char txData[6] = { 0x30, 'A', 'i', 'r', '!', '\0' };

// Data to read from radio RX FIFO (60 bytes MAX.)
unsigned char rxData[6] = { '\0', '\0', '\0', '\0', '\0', '\0' };

// -----------------------------------------------------------------------------
// Debug print functions

void printTxData()
{
Serial.print("TX (DATA): ");
Serial.println((char*)txData);
}

void printRxData()
{
/**
* The following illustrates various information that can be obtained when
* receiving a message. This includes: the received data and associated
* status information (RSSI, LQI, and CRC_OK bit).
*/
Serial.print("RX (DATA, RSSI, LQI, CRCBIT): ");
Serial.print("(");
Serial.print((char*)rxData);
Serial.print(", ");
Serial.print(Radio.getRssi());
Serial.print(", ");
Serial.print(Radio.getLqi());
Serial.print(", ");
Serial.print(Radio.getCrcBit());
Serial.println(")");
}

// -----------------------------------------------------------------------------
// Main example

void setup()
{
// The radio library uses the SPI library internally, this call initializes
// SPI/CSn and GDO0 lines. Also setup initial address, channel, and TX power.
Radio.begin(0x01, CHANNEL_1, POWER_MAX);

// Setup serial for debug printing.
Serial.begin(9600);

/**
* Setup LED for example demonstration purposes.
*
* Note: Set radio first to ensure that GDO2 line isn't being driven by the
* MCU as it is an output from the radio.
*/
pinMode(RED_LED, OUTPUT);
digitalWrite(RED_LED, LOW); // set the LED on
}

void loop()
{
// Load the txData into the radio TX FIFO and transmit it to the broadcast
// address.

int x_axis = analogRead(A0)/10 - 205;
int y_axis = analogRead(A1)/10 - 205;
int z_axis = analogRead(A2)/10 - 205;

int result = sqrt(x_axis*x_axis + y_axis*y_axis + z_axis*z_axis)*100/82;

Serial.print(x_axis);
Serial.print(" - ");
Serial.print(y_axis);
Serial.print(" - ");
Serial.print(z_axis);
Serial.print(" - ");
Serial.println(result);

if(result > 135){
txData[0] = 'A';
txData[1] = 'L';
txData[2] = 'A';
txData[3] = 'R';
txData[4] = 'M';
txData[5] = '!';
Radio.transmit(ADDRESS_BROADCAST, txData, 6);
printTxData(); // TX debug information
}
else{
txData[0] = '0';
txData[1] = '0';
txData[2] = '0';
txData[3] = '0';
txData[4] = '0';
txData[5] = '0';
}

}

Monitor code

/**
* WirelessTest - test transceiver sketch using AIR430Boost FCC driver.
* Copyright (C) 2012-2013 Anaren Microwave, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* This example demonstrates usage of the AIR430BoostETSI library which uses
* the 430Boost-CC110L AIR Module BoosterPack created by Anaren Microwave, Inc.
* and available through the TI eStore, for the European Union.
*
* ----------------------------------------------------------------------------
*
* Note: This file is part of AIR430Boost.
*
* ----------------------------------------------------------------------------
*
* Description
* ===========
*
* Each radio will send a message consisting of: 1 byte counter, 5 byte static
* text. The counter will count from 0 to 9 and will rollover. Each radio will
* wait in receive mode for approximately one second. Upon receiving data, or
* timeout of one second, the radio receive function will return. If valid data
* was received, the radio's receiverOn() method will return the number of bytes
* that were received. In this example, the data can be monitored on the serial
* port (please refer to printTxData() and printRxData() functions).
*
* ----------------------------------------------------------------------------
*
* This example assumes that two BoosterPacks will be used to showcase the
* wireless radio communication functionality. This same code should be
* programmed to both LaunchPad development kits.
*
* This BoosterPack relies on the SPI hardware peripheral and two additional
* GPIO lines for SPI chip-select and GDO0 for packet handling. They use pins 18
* and 19 respectively.
*
* In the default configuration, this BoosterPack is not compatible with an
* external crystal oscillator. This can be changed, if necessary, and would
* require reconfiguration of the BoosterPack hardware and changes to the
* AIR430BoostFCC library. Refer to the BoosterPack User's Manual if necessary.
*
* For complete information, please refer to the BoosterPack User's Manual available at:
* https://www.anaren.com/air/cc110l-air-module-boosterpack-embedded-antenna-module-anaren
*
* To purchase the 430Boost-CC110L AIR module BoosterPack kit, please visit the TI eStore at:
* https://estore.ti.com/430BOOST-CC110L-CC110L-RF-Module-BoosterPack-P2734.aspx
*/

// The AIR430BoostFCC library uses the SPI library internally. Energia does not
// copy the library to the output folder unless it is referenced here.
// The order of includes is also important due to this fact.
#include <SPI.h>
#include <AIR430BoostFCC.h>

// -----------------------------------------------------------------------------
/**
* Global data
*/

// Data to write to radio TX FIFO (60 bytes MAX.)
unsigned char txData[6] = { 0x30, 'A', 'i', 'r', '!', '\0' };

// Data to read from radio RX FIFO (60 bytes MAX.)
unsigned char rxData[6] = { '\0', '\0', '\0', '\0', '\0', '\0' };

// -----------------------------------------------------------------------------
// Debug print functions

void printTxData()
{
Serial.print("TX (DATA): ");
Serial.println((char*)txData);
}

void printRxData()
{
/**
* The following illustrates various information that can be obtained when
* receiving a message. This includes: the received data and associated
* status information (RSSI, LQI, and CRC_OK bit).
*/
Serial.print("RX (DATA, RSSI, LQI, CRCBIT): ");
Serial.print("(");
Serial.print((char*)rxData);
Serial.print(", ");
Serial.print(Radio.getRssi());
Serial.print(", ");
Serial.print(Radio.getLqi());
Serial.print(", ");
Serial.print(Radio.getCrcBit());
Serial.println(")");
}

// -----------------------------------------------------------------------------
// Main example

void setup()
{
// The radio library uses the SPI library internally, this call initializes
// SPI/CSn and GDO0 lines. Also setup initial address, channel, and TX power.
Radio.begin(0x01, CHANNEL_1, POWER_MAX);

// Setup serial for debug printing.
Serial.begin(9600);

/**
* Setup LED for example demonstration purposes.
*
* Note: Set radio first to ensure that GDO2 line isn't being driven by the
* MCU as it is an output from the radio.
*/
pinMode(RED_LED, OUTPUT);
digitalWrite(RED_LED, LOW); // set the LED on
}

void loop()
{

// // Turn on the receiver and listen for incoming data. Timeout after 1 seconds.
// // The receiverOn() method returns the number of bytes copied to rxData.
if (Radio.receiverOn(rxData, sizeof(rxData), 1000) > 0)
{
//// /**
//// * Data has been received and has been copied to the rxData buffer provided
//// * to the receiverOn() method. At this point, rxData is available. See
//// * printRxData() for more information.
//// */
digitalWrite(RED_LED, HIGH);
printRxData(); // RX debug information

if(rxData[0] == 'A' && rxData[1] == 'L' && rxData[2] == 'A' && rxData[3] == 'R' && rxData[4] == 'M' && rxData[5] == '!' ){
pinMode(GREEN_LED, OUTPUT);
digitalWrite(GREEN_LED, HIGH);
delay(1500);
digitalWrite(GREEN_LED,LOW);
}
}
digitalWrite(RED_LED, LOW);
}

Helpful Links:

www.ti.com/launchpad

www.ti.com/tool/430boost-cc110l

www.ti.com/tool/msp-exp430f5529lp

www.energia.nu

Control of stepper motor with MSP430

$
0
0

PROJECT DESCRIPTION

This project presents the control of a stepper motor with msp430 launch pad. The timer is used to control the speed of  step , this way , microcontroller is free to do other activities, the program allows you to control speed, type of stepper, direction of rotation and on/off the motor.

TEAM MEMBERS:

  • Waner

PROJECT FEATURES:

  • Control of stepper motor with direction, type stepper and speed
  • Timer interruption for change the stepper

[View:http://www.youtube.com/watch?v=qH18N7DufbQ]

The pin P2.0 to coil A, P2.1 to coil B, P2.2 to coil A' and P2.3 to coil B' . In the source code, 'ligar' is to turn on (0x0F) or off  (0x00) the motor, 'tipo_passo' select the type of stepper 0->full stepper, 1->half stepper and 2->full stepper with 2 coil, 'index_passo' control de current stepper, 'direcao' control the direction of rotation, 'tempo' control the speed and 'n_passo' is a count of stepper.  

Viewing all 81 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>