This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Hercules launchpad and xbee

Hello,

I am trying to use xbees with the Hercules rm42 launchpad. I have one connected to the launchpad (Dout -> SCI1_Rx and Din -> SCI1_Tx) and the other connected to my laptop using teraterm. I can't seem to get the transmission from the laptop to the launchpad working. I followed the tutorial but I am still a bit lost. For simplicity, I wrote it so that if I get a char 'w', then it will pwm the nhet08, but that isn't working. If anyone got any ideas, I will appreciate it.

6253.xbee.rar


Thank you

  • Robert,

    In your code, the input "command" is only read once. The "while(1)" loop is not reading the input command again. In fact, the sciSend and sciReceive both need to be in the while loop. That way, you can stay in the loop until you receive the "w" that you are looking for.

    Regards,
    Sunil
  • Hello Sunil,

    I thought the sciNotification took care of it since it is an interrupt handler, so every time I pressed a key, it will interrupt the program and turn on the LEDs (NHET8).

    Thank you,
    Robert Lee
  • Robert,

    You need to write to the data field of the N2HET instruction to start the PWM. The default setup is for a 0% duty cycle (off). The SCI interrupt handler does not update this data field. It is only done via the pwmSetSignal() function called in the while(1) loop.

    For this example, you can just put the sciSend and sciReceive in a separate while loop, so you can keep asking the user to "press a key" until you receive the "w" that you are looking for. Then you can make this example work without the RX interrupt.

    Regards,
    Sunil
  • Hello,

    Another question I would like to ask is if there is a specific way to specify I want to transmit and receive values over the SCI1_TX and SCI1_RX pins. I ran into a problem where if I had the hercules launchpad connected to laptop through USB and connected a xbee to these pins, then they wouldn't receive any values. It would transmit, but not receive from neither the USB or the SCI1_RX. If there isn't, I would have to power the Hercules through the 5V pin on the J3 row (pin above ADIN8 and SCI1_RX pin)

    Thank you,
    Robert Lee
  • hello,

    I am still having trouble with the hercules and xbee. When I connect the hercules and usb without the xbee, it works perfectly fine. I press 'w' and nhet8 led blinks and when I press 's', it turns off. However if I connect the xbee to the scirx and tx explained above to the hercules and the hercules connected to the computer for power, it doesn't work. The launchpad transmit values to the computer but I can't send any values from the xbee connected to my computer to the xbee connected to the launchpad. Can anyone help me with this problem?

    When I ran the code without the loop and only over the USB, it worked perfectly fine. I was able to continuously turn the led on and off.

    Thank you,
    Robert Lee

    Code:
    3463.xbee.rar

  • Robert,

    The RM42 MCU has a single SCI port. This is the one port connected to the FTDI interface as well as to the boosterpack connectors. If you plan to only use the SCI data connection from the boosterpack connector (via the xbee) you need to remove the 0-ohm resistor R8. Note that you will no longer be able to use the data connection via the FTDI USB interface once you remove this resistor.

    Regards,

    Sunil

  • Hello,

    Thank you for your response. Is there any other way to connect an xbee to the hercules launchpad without doing this? Also a minor question is how to get the launchpad to automatically start the code when you power the launchpad up. Whenever I power the launchpad down, I have to reconnect to the pc and reload the code. Is there a way so that it will boot up the last loaded code on the launchpad when you power it up. If you could answer these two question, I would appreciate it.

    Thank you,
    Robert Lee
  • Robert,

    I do not have the datasheet for the xbee part that you are using (xbee WiFi?). However, the product documentation page shows that it also supports an SPI interface. You could wire the SPI1 port from the boosterpack connector to the xbee.

    As for the loading of the program, the internal flash memory does retain the contents even after powering off. You can try this out by loading a program that blinks an LED and then make sure that it executes correctly without having to download the program again.

    Regards,
    Sunil