Jump to content


  • Content Count

  • Joined

  • Last visited

About ilotek

  • Rank
    Noob Class

Recent Profile Visitors

234 profile views
  1. I ran a multimeter across P1_5 and GND and found that even when it is set to LOW it is still getting 2v of power, enough to turn the LED on (but dimly). any reason why P1_5 would be getting a +2V when in the LOW state?
  2. So I ran into a few problems hooking the whole thing up. For external LED's, do I need to connect the LED to VCC (Pin 1) and some other pin (like P1_5) instead of P1_5&Gnd? If I connect the LED between VCC Pin1 and P1_5, do I need to register P1_5 as output in pinMode(P1_5, OUTPUT); If the LED is connected between VCC Pin1 and P1_5, is the LED in the off state when P1_5 output is HIGH, digitalWrite(P1_5, HIGH); Thanks!
  3. This gives a pretty clear explanation. http://www.learningaboutelectronics.com/Articles/How-to-connect-a-voltage-regulator-in-a-circuit
  4. @@Fmilburn A question about the voltage regulator. The plan is to incorporate a power switch along the positive line from the 9v. So the 9V's positive line will be interrupted by a power switch and then continue on to the voltage regulator's input leg. the voltage regulator also has a ground leg and an output leg, but i will also have the negative line from the 9v. Do I connect the ground leg of the voltage regulator to one of the ground pins on J6 (on the msp) and then the negative line from the 9v on the other ground pin? I was curious why there are two ground pins on J6 (along with the VCC), is this to allow the grounding of a voltage regulator as well as the overall grounding for the power? Thanks!
  5. I've been prototyping by just plugging into my laptop's usb. I'm assuming that the launchpad handles the 5v from the usb cable pretty effectively. I just don't want to burn it out with a 9v, so I picked up some COM-00526 3.3V voltage regulators.
  6. @@Fmilburn thank you for your help with this! i think i've set it all up now. i tested the code with an external switch, push button and LED to make sure that everything was working and we are good to go. here is the final (lol, last time i coded was in highschool, but i should know better than to never call a version final) code: transmitter module (rather than wait for a button push, i just set this thing up to always broadcast if it's turned on, so it has a power switch and the code runs automatically): #include <SPI.h> #include <AIR430BoostFCC.h> #define CMD_OFF 0 #define CMD_ON 1 struct sControl { unsigned char cmd; }; struct sControl txControl = { CMD_ON }; // TX control packet struct sControl rxControl = { CMD_OFF }; // RX control packet void setup() { Radio.begin(0x01, CHANNEL_1, POWER_MAX); } void loop() { Radio.transmit(ADDRESS_BROADCAST, (unsigned char*)&txControl, sizeof(txControl)); while (Radio.busy()); } and here is the receiving code: #include <SPI.h> #include <AIR430BoostFCC.h> #define CMD_OFF 0 #define CMD_ON 1 struct sControl { unsigned char cmd; }; unsigned char x = 0; struct sControl txControl = { CMD_OFF }; // TX control packet struct sControl rxControl = { CMD_OFF }; // RX control packet void setup() { Radio.begin(0x01, CHANNEL_1, POWER_MAX); pinMode(RED_LED, OUTPUT); digitalWrite(RED_LED, LOW); pinMode(P1_4, INPUT_PULLUP); } void repetition() { int x = 0; while (x < 100) { digitalWrite(RED_LED, HIGH); delay(100); digitalWrite(RED_LED, LOW); delay(100); x = x + 1; } } void loop() { if (Radio.receiverOn((unsigned char*)&rxControl, sizeof(rxControl), 1000) > 0) { if (rxControl.cmd == CMD_ON) { repetition(); digitalWrite(RED_LED, HIGH); } } if (digitalRead(P1_4) == LOW) { digitalWrite(RED_LED, LOW); } } the existence of P1_4 is just to detect a button press and turn the LED off. because when repetition() is called the LED blinks for 20 seconds then stays on. the only thing i have left for this project is to hook it up to battery power. i'm thinking of using a 9V and then a voltage regulator to downstep it to 3.3V. i have a couple questions about wiring up LED's but i'll search around here for an answer before posting it here. Thanks!
  7. I am using Energia. The transmitting unit will be on constantly but will only be transmitting when the switch is flipped (unless I am misunderstanding the role of the transmitting module). Here is the code I will be attempting to modify: /** This example demonstrates usage of the AIR430BoostFCC 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 * =========== * * On each loop cycle, a message is transmitted and a message is received from * a remote node or a timeout occurs. The message contains a control command. * The control command turns the red LED on or off. Both nodes can control * each others red LED through a button press. When the button on one node is * pressed or held down, the red LED should light up on the remote node, and * vice versa. * * ---------------------------------------------------------------------------- * * 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 * // 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> // ----------------------------------------------------------------------------- /** * Defines, enumerations, and structure definitions */ #define CMD_OFF 0 #define CMD_ON 1 /** * sControl - control packet. */ struct sControl { unsigned char cmd; }; // ----------------------------------------------------------------------------- /** * Global data */ struct sControl txControl = { CMD_OFF }; // TX control packet struct sControl rxControl = { CMD_OFF }; // RX control packet // ----------------------------------------------------------------------------- // Debug print functions void printRxData() { // Print the last received command to the serial port. Serial.print("RX Command: "); Serial.println(rxControl.cmd); } // ----------------------------------------------------------------------------- // 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); // Setup push button. pinMode(PUSH2, INPUT_PULLUP); } void loop() { // Check for a button press. If the button is being pressed, load the txControl // into the radio TX FIFO and transmit it to the broadcast address. if (digitalRead(PUSH2) == LOW) { txControl.cmd = CMD_ON; } else { txControl.cmd = CMD_OFF; } Radio.transmit(ADDRESS_BROADCAST, (unsigned char*)&txControl, sizeof(txControl)); /** * The radio transmitter and receiver cannot be operated at the same time. * Wait until transmit completes before turning on the receiver. Please note * that the radio is considered busy when it is transmitting. * * WARNING: If busy is not checked between two successive radio operations * receiverOn/transmit, the radio may not perform the specified task. The * radio must be complete with the transmission before it can begin the next */ while (Radio.busy()); // 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((unsigned char*)&rxControl, sizeof(rxControl), 1000) > 0) { // Perform action based on incoming command: turn on/off red LED. if (rxControl.cmd == CMD_ON) { digitalWrite(RED_LED, HIGH); } else { digitalWrite(RED_LED, LOW); } printRxData(); // RX debug information } }
  8. Thank Fmilburn! That does seem very simple. The more I experiment with this the more I realize that modifications might need to be made to accomodate my intentions. Does the CC110L module pair with another module during the bootup process? So that the two devices will only receive TX from the other? Is there a way to modify the code to just let the RX module (in my setup, one will only ever TX and the other will only ever RX) receive a signal from any TX? To give a little context in what I'm trying to accomplish I will describe the application. I intend to put the transmitting module on an endurance racebike. When the rider is ready to come back in for a pitstop, he can just flip the switch which will put the module in constant TX mode. The receiving module, which is located with the rest of the team in the pits, listens for any TX and when it receives a ping it just turns on (and keeps on, regardless of whether it continues to RX) an LED letting the pit crew know that the rider is ready to come in. The issues I can see with this are that the TX module and the RX module are only close to each other for a brief period of time as the motorcycle goes around the track. Therefore, the receiving module needs to be able to receive any TX signal, regardless of source, and trigger the LED. If pairing needs to occur between the two CC110L's, this becomes more difficult.
  9. Hello! This is my first post, I'm a new board member. I have searched the forum for examples relating to my question and haven't found anything that's quite like what I'm looking for, so here goes. I am trying to build a system where a switch can be flipped on one board and it lights up an LED on another board. I have used the WirelessControl example program to verify that my boards are working and they do. I would like to just modify WirelessControl because it's a relatively simple program and it's already doing what I need the boards to do. The WirelessControl example program requires the pushing of P1.3 in order to light up the red led on the opposite board. What I would like to do is instead of a button needing to be pushed, I'd like to wire up a switch that can just be flipped on. Once the switch is flipped it sends a constant TX signal and lights up the LED on the opposite board. Once the switch is flipped back to off, the corresponding red led should turn off. My question is which pins can I connect a switch to in order to accomplish this. And I would like to wire up a different LED on the other board so that the LED can be installed in a location away from the actual board. Programming questions: how to change the code in WirelessControl to accept a different input as the TX signal and how to configure the program on the other board to light up a different LED in response to RX. Thanks for all your help with this! Current hardware: MSP430 Launchpad with MSP430G2553 Anaren 430Boost-CC110L AIR module BoosterPack
  • Create New...