Giter Club home page Giter Club logo

msprf24's People

Contributors

ivankravets avatar spirilis avatar tophathacker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msprf24's Issues

Can't get Ike's example to transmit or receive

I'm trying to get Ike's example transmitting and receiving yet I'm having no luck. It compiles successfully with:

gcc version 4.6.3 20120301

And i've wired the nRF24L01+ up correctly(triple checked the pinout of my nRF24L01+s and the wiring to the boards) but I just can't seem to get it to transmit or receive. I know the nordic chips work because I am able to use a bus pirate to communicate and check that they are working.

Any ideas on what I can do so that I can debug further?

Mask typo

I know it's really minor, but I think in msprf24.c, in function msprf24_set_speed_power(), line 550, rf_speed_power should be masked with 0x1F instead of 0x2F.

Thank you for all your effort in putting this code together!

RX mode issues

Hi,

I',m having problem with RX mode. I am using a little modified example of receiver:

...

msprf24_activate_rx();
LPM4;

while (1) {
    if (rf_irq & RF24_IRQ_FLAGGED) {
        msprf24_get_irq_reason();
    }
    if (rf_irq & RF24_IRQ_RX || msprf24_rx_pending()) {
        r_rx_payload(32, buf);
        msprf24_irq_clear(RF24_IRQ_RX);
        P1OUT ^= BIT0; // toggle red LED
    }
    msprf24_activate_rx(); // works once without it
    LPM4;
}

But it stops receiving after first packet received (red LED stays lit forever after receiving), so after a while I've added msprf24_activate_rx() on end of loop, right before LPM4 call. Now it works but for random amount of time, ie: 1 to 20 of times, then hangs again. Transmitter sends the same date every 2 seconds.

Received data corresponds to what was send

I'm running on 8MHz with 8MHz SMCLK,
dynamic payload,
rf_addr_width(3),
msprf24_set_retransmit_delay(1000) - in traansmitter code
msprf24_set_retransmit_count(3) - in traansmitter code

Wires length (Launchpad <-> nrf24l01+) about 20cm.

What might be wrong? Why adding msprf24_activate_rx() is necessary on every wake up but not present in your examples?
Your example of receiver also stops after first packet.

msprf24_irq_clear: fifo_stat and rf_status assignments swapped?

Are the fifo_stat and rf_status assignments swapped?

msprf24/msprf24.c

Lines 758 to 765 in 8ebe45c

if (irqflag & RF24_IRQ_RX) {
CSN_EN;
rf_status = spi_transfer(RF24_FIFO_STATUS | RF24_R_REGISTER);
fifostat = spi_transfer(RF24_NOP);
CSN_DIS;
if ( !(fifostat & RF24_RX_EMPTY) )
rf_irq |= RF24_IRQ_RX | RF24_IRQ_FLAGGED; // Signal to user that there is remaining data, even if it's not "new"
}

add Makefile

Hello,

First of all, thanks for your brilliant library!
My question is:
Is it possible to add a Makefile example to your project to compile the TESTPROGS?
You are probably using one!
Thank you.
Anthony

Infinite loops in w_tx_addr and w_rx_addr

I'm porting your driver to mspgcc and notice these two bugs, currently in lines 83 and 100 of msprf24.c:

for (i=rf_addr_width-1; i>=0; i--) {

The condition will always be true, since i is uint16_t.

Push-Button example

Hi.

First thank you very much for the library. It looks great but I have an issue when I try to use the pushbutton-example:

image

I found that it works, when I change:

image

to

image

in msprf24.c.

Am I doing something wrong?

I am using Code Composer Studio 6.1.2.00015,
my folder looks like this:
image

Thanks again.
Kind Regards,
Sleepingshorty

Trying to get echo to work

I have successfully gotten Ike's RX/TX code to work. I'm trying to make it work so that the receiver transmits the received message back to the transmitter (an echo). I'm basing this off of the Ike's code. I'm having a hard time getting this to work though. Do I need two different pipes for this? Or can I still just use one pipe?

msp430f2452 examples not run

Good day,
A few years ago I used the first version of the nrf24l01 + library in msp430G2452 without problems, but now with the new one it does not work, I have tried it with the G2231 and with the G2553 and it works very well, my IDE is the IAR. You could tell me if you tried it. Thank you.

ANDRÉS FELIPE RODRÍGUEZ

Problem running the example on two launchpads with g2553s

Hi, I've loaded the examples into two launchpads with g2553s Rx and Tx, and can't seem to run them properly. The first byte makes through OK, turning the green LED ON on the Rx LP, but the transmitter hangs in INVALID mode and does not recover. I have tried both USCI_A and USCI_B - same result. With USCI_B I actually transmitted one byte captured by the Tx LP from UART (putty) and displayed on putty connected to UART on the Rx LP. But still the same isue, first byte goes through, then Tx hangs...
Is there a chance you could help?
Arsen Norman

link errors CCS5.3 + MSP430G2231

Tried to compile your demo programs but keep getting link errors.
The problem seems to be that all the spi_ functions are not compiled due being wrapped in

ifdef MSP430_HAS_USI

endif

which is not defined in my environment.

Am wondering if the missing MSP430_HAS_USI is because my board doesnt support it or if I need an extra library from somewhere?

LPM3 sleep

Hi,

i'm trying to get the example "ping-remote-led-every500ms-using-vlo.c" running on a g2452 and i need some help please.

i've managed to get a pair of g2553's running the "ike-uscia-rx.c" and "ike-uscia-tx.c" examples. i thought a good test would be to run "ping-remote-led-every500ms-using-vlo.c" on a g2452 alongside "ike-uscia-rx.c" on a g2553. the LEDs would give me some visual feedback as to what is and isn't going on. below is the adapted "ping-remote-led-every500ms-using-vlo.c" example that i expected would work. i thought the problem could also be that my "nrf_userconfig.h" or "msprf24.c" file may need adjustments but i've not been able to establish this. any help would be greatly appreciated!

#include <msp430.h>
#include <string.h>
#include "msprf24.h"
#include "nrf_userconfig.h"

volatile unsigned int user;
volatile int wdtsleep;

/* Sleep for <cycles> * 47ms */
void wdt_sleep(unsigned int cycles)
{
        wdtsleep = cycles;
        WDTCTL = WDTPW | WDTTMSEL | WDTCNTCL | WDTSSEL | WDTIS1;  // WDT interval = 512 VLOCLK cycles, about 47ms
        IFG1 &= ~WDTIFG;
        IE1 |= WDTIE;
        LPM3;
        WDTCTL = WDTPW | WDTHOLD;
}

// WDT overflow/STOP
#pragma vector=WDT_VECTOR
__interrupt void WDT_ISR(void)
{
        if (wdtsleep) {
                wdtsleep--;
        } else {
                IFG1 &= ~WDTIFG;
                IE1 &= ~WDTIE;
                __bic_SR_register_on_exit(LPM3_bits);
        }
}


void main()
{
    P1DIR |= BIT0;
    P1OUT |= BIT0;
    char addr[5];
    char buf[32];

    WDTCTL = WDTHOLD | WDTPW;
    DCOCTL = CALDCO_16MHZ;
    BCSCTL1 = CALBC1_16MHZ;
    BCSCTL2 = DIVS_2;  // SMCLK = DCOCLK/4
        BCSCTL3 = LFXT1S_2;  // ACLK = VLOCLK/1
        BCSCTL3 &= ~(XT2OF|LFXT1OF);

    wdtsleep = 0;

    // SPI (USI) uses SMCLK, prefer SMCLK=DCO (no clock division)
    user = 0xFE;

    /* Initial values for nRF24L01+ library config variables */
    rf_crc = RF24_EN_CRC | RF24_CRCO; // CRC enabled, 16-bit
    rf_addr_width      = 5;
    rf_speed_power     = RF24_SPEED_1MBPS | RF24_POWER_0DBM;
    rf_channel         = 120;

    msprf24_init();  // All RX pipes closed by default
    msprf24_set_pipe_packetsize(0, 32);
    msprf24_open_pipe(0, 1);  // Open pipe#0 with Enhanced ShockBurst enabled for receiving Auto-ACKs

    // Transmit to 0xDEADBEEF01
    msprf24_standby();
    user = msprf24_current_state();
    addr[0] = 'r'; addr[1] = 'a'; addr[2] = 'd'; addr[3] = '0'; addr[4] = '1';
    memcpy(addr, "\xDE\xAD\xBE\xEF\x01", 5);
    w_tx_addr(addr);
    w_rx_addr(0, addr);  // Pipe 0 receives auto-ack's, autoacks are sent back to the TX addr so the PTX node
                 // needs to listen to the TX addr on pipe#0 to receive them.
    buf[0] = '0';
    buf[1] = '0';

    P1OUT &= ~BIT0;

    while(1) {
        P1OUT |= BIT0;
        if (rf_irq & RF24_IRQ_FLAGGED) {  // Just acknowledging previous packet here
            msprf24_get_irq_reason();
            msprf24_irq_clear(RF24_IRQ_MASK);
            user = msprf24_get_last_retransmits();
        } else {  // WDT sleep completed, send a new packet
            if (buf[0] == '1') {
                buf[0] = '0';
                buf[1] = '1';
            }
            else {
                buf[0] = '1';
                buf[1] = '0';
            }
            w_tx_payload(32, buf);
            msprf24_activate_tx();
        }
        P1OUT &= ~BIT0;
        wdt_sleep(10);  // ~500ms LPM3 sleep
    }
}

Bidirectional serial over nRF24's

Hello,
Thanks a lot for your library, I use it and learned how the nRF's work from it. Because of your experience with these radios, I thought you might be able to help me understand something about the operation of the Enhanced Shockburst functionality. I am trying to implement the 'UART' serial connection you mention as an example use for these radios. I know how to program them to listen for a packet from the other radio, but I am trying to figure out the best way to resolve deadlock, where both are trying to transmit a packet at the same time.
I could wait a random period of time after a failed send before trying again, but I thought the Enhanced Shockburst might make it easier. The documentation says that after each TX attempt, it switches to RX mode for the ACK packet. Do you know if it will ignore all other packets (other than the ACK)? If it is able to receive other packets during this time, when would it send the new ACK packet back? I cannot find an answer in the documentation, and if this does work, simply using your function set_retransmit_delay() to set the ARD to a random value would fix deadlock.
If you know the answer or someone better to ask, thanks. If this is not the best place to ask you because it is not really an issue with your library, I understand.
Thanks!

MSP-EXP430FR4133 Launchpad not working

MSP430FR4133 use SPI on eUSCI_A0 (pins 1.0 to 1.3 ) or eUSCI_B0 (pins 5.0 to 5.3)
MSP-EXP430FR4133 Launchpad doesn't have easily exposed P1.0 (LED) and P1.2 (SW1) - thus eUSCI_A0 is actually unusable here.

msprf24 lib needs change to setup for this device eUSCI_B0 with P5 ports (described on Launchpad as SPI pins)

This init function works OK for me. However I'm not sure how would you like to choose proper "#ifdef"
for this device/MCU , since for 'raw' 4133 eUSCI_A0 is normally available, and it should up to user which eUSCI will be using.
I don't know if there is a good way to detect Launchpad device itself ? Maybe best to use variable in nrf_userconfig.h ?

void spi_init()
{
/* Configure ports on MSP430 device for USCI_B0 /
P5SEL0 |= (BIT1 | BIT2 | BIT3);
/
USCI_B specific SPI setup */
UCB0CTLW0 |= UCSWRST;
UCB0CTLW0 = UCCKPH | UCMST | UCMSB | UCSYNC | UCSSEL_2 | UCSWRST;
UCB0BRW = 0x01;
UCB0CTLW0 &= ~UCSWRST;
}

Problem with msprf24_scan() function

Good day,

I'm trying to implement the msprf24_scan() without any result, always shows zero, in the Ike's program in the main while, in the Rx part the only function that appears is this scan function, this is my test program.

When I debbug the function by step seems to work.

Any advice will be very helpfull.

Thanks

Can't find Interrupt Vector USCI_A0_VECTOR with MSP430-GCC

I'm trying to compile this code with MSP430-GCC, although it can't find the interrupt vector USCI_A0_VECTOR. I also can't get code to compile with interrupt vectors like you've supplied I have to use this syntax:

void USCI_RX(void) __attribute__((interrupt(USCIAB0RX_VECTOR)));

If that makes a difference at all. What suggestions do you have to work around this? I am trying to compile the transmit and receive examples for the MSP430G2553.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.