Jump to content

ilpaso

Members
  • Content Count

    25
  • Joined

  • Last visited

About ilpaso

  • Rank
    Member

Recent Profile Visitors

411 profile views
  1. Gdo0 changes the logic state perfectly. I think the cpu doesn't see the edge on falling down gdo0 line. maybe could be an spi problem. I've no idea how solve the problem.
  2. I've tried the workaround but it does't work. It kicks the loop out after 50 milliseconds but returns in the loop the next attempt. Bye
  3. Hi zeke, thank you for your nice workaround and moral support. I'll try it but I think you've confused: - || and && ; - >= 10 and <=10; - the delay is (10*5)=50 milliSeconds. does not matter In the WirelessControl example for AIR430Boost ETSI library there is this note: /** * 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 */ This is the infamous routine: boolean A110x2500Radio::busy() { if (gDataTransmitting) { return true; } return false; } and this routine changes the gDataTransmitting variable void A110x2500Radio::gdo0Isr() { // Note: It is assumed that interrupts are disabled. // The GDO0 ISR will only look for the EOP edge. Therefore, if the radio // is not transmitting the EOP, it must be receiving an EOP signal. if (gDataTransmitting) { /** * Note: GDO0 is issued prior to the transmitter being completely * finished. The state machine will remain in TX_END until transmission * completes. The following waits for TX_END to correct the hardware * behavior. */ while (CC1101GetMarcState(&gPhyInfo.cc1101) == eCC1101MarcStateTx_end); gDataTransmitting = false; } else { gDataReceived = true; readDataStream(); } // Always go back to sleep. sleep(); } I do not know how the module works at a lower level. I hoped that the library would work because it was initially released by Anaren. Maybe something I'm wrong. Bye
  4. Increasing the timeout the module works better but the problem is not solved.
  5. Hi energia, thank you for your reply. Sorry but I forgot to write the Energia release: 0101E0013 with AIR430BoostEuropeETSI library downloaded from github: https://github.com/energia/Energia/commit/55cbbdb792fd092813c5b79a610690f52c12c5d1. I think this is the library release you attached in the post. I'll try this evening to increase the timeout to 1000. I've tested the code with a delay(500) (the last delay in the loop cycle) and it works a bit better. I've seen the function "boolean A110x2500Radio::busy()" in the library. It tests gDataTransmitting variable. Is this variable linked to interrupt at line GDO0? The signal raise up and falls down but interrupt doesn't see this change. Is this right? Thank you
  6. Hello everyone! I meet a problem using Air Boosterpack on launchpad MSP430F5529. I'm trying to make a small sensor network, a star network. 1 gateway and 2 sensors. The gateway sends a SYNC command to broadcast address. Each sensor listens for a random time if someone is trasmitting, if not it sends a RTS (Request To Send) command to gateway. The gateway sends back a CTS (Clear To Send). Once the sensor receives the CTS it will send back the data to the gateway. Before each Rx or Tx operation I've put a "while(Radio.busy())" as written in all examples. Very often gateway or sensor freezes after sending the packet and never exit from the "while(Radio.busy())" cycle. Can anyone help me with this issue? Thank you Attached here there are the gateway and sensor firmware. Please find the string "//IT FREEZES HERE!!!!" in order to see where the code is blocked. SENSOR: #include <SPI.h> #include <AIR430BoostETSI.h> // ----------------------------------------------------------------------------- /** * Defines, enumerations, and structure definitions */ #define ADDRESS_LOCAL 0x04 #define ADDRESS_REMOTE 0x02 // identify a set of type of data received/send (command in cordata struct) #define SYNC 1 #define CTS 2 #define RTS 3 #define SET 4 #define DATA 5 #define ACK 7 #define RLED P1_0 #define GLED P4_7 /** * sPacket - packet format. */ struct sPacket { uint8_t from; // Local node address that message originated from uint8_t message[59]; // Local node message [MAX. 59 bytes] }; // ----------------------------------------------------------------------------- /** * Global data */ struct sPacket rxPacket, txPacket; int timeout = 300; void setup() { startled(); // Setup serial for debug printing. Serial.begin(115200); Serial.print("SENSOR, address:"); Serial.println(ADDRESS_LOCAL); // 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(ADDRESS_LOCAL, CHANNEL_1, POWER_MAX); } void loop() { blinkled(GLED, 1, 50); ///WAIT SYNC rxPacket.from=0; // Local node address that message originated from memset(rxPacket.message,0,sizeof(rxPacket.message)); while(Radio.busy()){ Serial.println("BUSY RX SYNC^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); delay(5); } if(Radio.receiverOn((unsigned char*)&rxPacket, sizeof(rxPacket), timeout) > 0) { if(Radio.getCrcBit()!=1) { return; } } if (rxPacket.message[0] != SYNC) { Serial.println("NO SYNC"); return; } Serial.println("SYNC ARRIVED"); //CARRIER SENSE rxPacket.from=0; // Local node address that message originated from memset(rxPacket.message,0,sizeof(rxPacket.message)); while(Radio.busy()){ Serial.println("BUSY CARIER SENSE^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); delay(5); } if(Radio.receiverOn((unsigned char*)&rxPacket, sizeof(rxPacket), 100+random(timeout)) > 0) { Serial.println("CARRIER BUSY ********************************************"); return; } Serial.println("CARRIER FREE"); ///RTS delay(20); //attesa per dare il tempo al gateway di andare in rx txPacket.from = ADDRESS_LOCAL; memset(txPacket.message, 0, sizeof(txPacket.message)); txPacket.message [0] = 3; txPacket.message [1] = 1; txPacket.message [2] = 1; txPacket.message [3] = 1; Radio.transmit(ADDRESS_BROADCAST, (unsigned char*)&txPacket, sizeof(txPacket)); Serial.println("SENT RTS"); ///WAIT CTS rxPacket.from=0; // Local node address that message originated from memset(rxPacket.message,0,sizeof(rxPacket.message)); delay(80); while(Radio.busy()){ Serial.println("BUSY RX CTS^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); //IT FREEZES HERE!!!! delay(5); } if(Radio.receiverOn((unsigned char*)&rxPacket, sizeof(rxPacket), timeout) > 0) { if(Radio.getCrcBit()!=1) { Serial.println("NO CTS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); return; } } if (rxPacket.message[0] == CTS) { Serial.println("CTS ARRIVED"); Serial.println(""); blinkled(RLED, 1, 50); } else Serial.println("ERROR RECEIVING CTS"); delay(300); } void blinkled(uint8_t led, uint8_t time, uint8_t delayTime){ for(int i=0; i<time; i++){ digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(delayTime); digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(delayTime); } } void startled(){ pinMode(RLED, OUTPUT); pinMode(GLED, OUTPUT); } GATEWAY: #include <SPI.h> #include <AIR430BoostETSI.h> // ----------------------------------------------------------------------------- /** * Defines, enumerations, and structure definitions */ #define ADDRESS_LOCAL 0x02 // identify a set of type of data received/send (command in cordata struct) #define SYNC 1 #define CTS 2 #define RTS 3 #define SET 4 #define DATA 5 #define RLED P1_0 #define GLED P4_7 /** * sPacket - packet format. */ struct sPacket { uint8_t from; // Local node address that message originated from uint8_t message[59]; // Local node message [MAX. 59 bytes] }; // ----------------------------------------------------------------------------- /** * Global data */ struct sPacket rxPacket, txPacket; int timeout = 300; void setup() { startled(); // Setup serial for debug printing. Serial.begin(115200); Serial.print("GATEWAY, address:"); Serial.println(ADDRESS_LOCAL); // 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(ADDRESS_LOCAL, CHANNEL_1, POWER_MAX); } void loop() { blinkled(GLED, 1, 50); ///SEND SYNC txPacket.from = ADDRESS_LOCAL; memset(txPacket.message, 0, sizeof(txPacket.message)); txPacket.message [0] = SYNC; txPacket.message [1] = 1; txPacket.message [2] = 1; txPacket.message [3] = 1; while(Radio.busy()){ Serial.println("BUSY TX SYNC^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); delay(5); } Radio.transmit(ADDRESS_BROADCAST, (unsigned char*)&txPacket, sizeof(txPacket)); Serial.println("SYNC SENT"); delay(40); ///WAIT RTS rxPacket.from=0; // Local node address that message originated from memset(rxPacket.message,0,sizeof(rxPacket.message)); while(Radio.busy()){ Serial.println("BUSY RX RTS^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); //IT FREEZES HERE!!!! delay(5); } if(Radio.receiverOn((unsigned char*)&rxPacket, sizeof(rxPacket), timeout) > 0) { if(Radio.getCrcBit()!=1) { return; } } if (rxPacket.message[0] != RTS) { Serial.println("NO RTS"); return; } Serial.print("RTS ARRIVED from: "); Serial.println(rxPacket.from); ///SEND CTS delay(20); //wait txPacket.from = ADDRESS_LOCAL; memset(txPacket.message, 0, sizeof(txPacket.message)); txPacket.message [0] = CTS; txPacket.message [1] = 1; txPacket.message [2] = 1; txPacket.message [3] = 1; while(Radio.busy()){ Serial.println("BUSY TX CTS^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); delay(5); } Radio.transmit(rxPacket.from, (unsigned char*)&txPacket, sizeof(txPacket)); Serial.println("CTS SENT"); Serial.println(""); delay(100); } void blinkled(uint8_t led, uint8_t time, uint8_t delayTime){ for(int i=0; i<time; i++){ digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(delayTime); digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(delayTime); } } void startled(){ pinMode(RLED, OUTPUT); pinMode(GLED, OUTPUT); }
  7. Hi, is there a way to use this library with MSP430F5529? I know there is another library (http://forum.43oh.com/topic/5070-energia-library-etherenclib-for-enc28j60/) but I'd like to use the DHCP feature. Thank you
  8. Hi, I'd like tu use the RobG's ethernet boosterpack with this Ethernet library on MSP430F5529. Has anyone a good start point with w5500? I'm not able to install the library following the instructions here: https://github.com/javakys/Energia_Ethernet_Library_Included Thank you
  9. ilpaso

    ethernet library

    Hi, I'm looking for an Energia library to use with msp430F5529 (or MSP430G2553) and ethernet boosterpack from RobG: http://forum.43oh.com/topic/4490-ethernet-booster-pack-v3/ I've tried this one (http://forum.43oh.com/topic/4154-energia-library-ethernet-using-wiz820io/) but the compiler returns a lot of errors. I've found the code at this post (http://forum.43oh.com/topic/4490-ethernet-booster-pack-v3/?p=46637) but I'm not able to run it in Energia. Second question: why is not easy to use the Ethernet library from Arduino? Thank you
  10. Thank you for the answers. I'll re-route the the pins. The problem is understand what change in the code in order to use a different SPI port. For example: 4_0 CS 4_1 MOSI 4_2 MISO 4_3 SCK Please see the msp pinout: http://energia.nu/img/LaunchPadMSP430F5529.jpg I'll try the code discussed here: https://github.com/energia/Energia/issues/298 (thank you @nickn) Thank you.
  11. Hi, I'd like to connect the anaren AIR boosterpack to the launchpad msp430f5529 but not on the standard SPI port. what should I change in the code in order to use a different port? For example: 4_0 CS 4_1 MOSI 4_2 MISO 4_3 SCK thank you
  12. ilpaso

    low power mode first sketch

    My setup is in poor man style! I'll try to set Xin and Xout as INPUT_PULLDOWN. Thank you
  13. ilpaso

    low power mode first sketch

    Hi grahamf72 with your example and the following code for setup method the current is between 3.5uA / 4.0uA. That is fantastic! I don't understand if something is wrong or the problem is my low cost meter. My Vcc is 3.3V. What is your test Vcc value in order to read a 0.1uA in LPM4? Xout and Xin pins are floating on launchpad. Is this correct for very low power layout? void setup() { pinMode(P1_1,INPUT_PULLDOWN); pinMode(P1_2,INPUT_PULLDOWN); pinMode(P1_3,INPUT_PULLDOWN); pinMode(P1_4,INPUT_PULLDOWN); pinMode(P1_5,INPUT_PULLDOWN); pinMode(P1_6,INPUT_PULLDOWN); pinMode(P1_7,INPUT_PULLDOWN); pinMode(P2_0,INPUT_PULLDOWN); pinMode(P2_1,INPUT_PULLDOWN); pinMode(P2_2,INPUT_PULLDOWN); pinMode(P2_3,INPUT_PULLDOWN); pinMode(P2_4,INPUT_PULLDOWN); pinMode(P2_5,INPUT_PULLDOWN); pinMode(P1_0,OUTPUT); //Enable output on P1_0 (onboard red LED) attachInterrupt(P1_3,Interrupt, FALLING); //attach our interrupt routine to P1_3 }
  14. ilpaso

    low power mode first sketch

    thank you grahamf72! The code is clear! Maybe in my examples something was wrong. I'll try your code this evening and I'll reply with the result.
  15. Hi, I'm newbie in low power mode. I've seen a lot of examples but I'm not able to see a low current in LMP4 mode. The lowest current I can see is about 90uA. Is there a minimal working sketch in order to run LPM4 mode and wake up the microcontroller with an external interrupt and switch on a led? My hardware is launchpad V1.5 with Msp430G2553. Both red an green leds are off. I've removed all the jumpers (Vcc and uart, NOT rst and test) and my power supply is a battery at 3.5V. Thank you for your help and sorry for this newbie question.
×