spirilis / msprf24

nRF24L01+ Library for MSP430 microcontroller line
ISC License
102 stars 32 forks source link

Problem with msprf24_scan() function #12

Closed Rogil closed 4 years ago

Rogil commented 10 years ago

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

spirilis commented 10 years ago

That's a bit vague, I'm not sure what you're trying to do. Can you post the code somewhere (pastebin or gist.github.com perhaps)?

Rogil commented 10 years ago

Thanks Eric for answer, I'm just trying out the scan function, using the Ike's code, I put The function anywhere in the code: like this in the Rx part:

while (1) {
    if (rf_irq & RF24_IRQ_FLAGGED) {
        msprf24_get_irq_reason();
    }
    if (rf_irq & RF24_IRQ_RX) {
        r_rx_payload(32, buf);
        msprf24_irq_clear(RF24_IRQ_RX);
        user = buf[0];

        msprf24_irq_clear(RF24_IRQ_RX);

        RPD = msprf24_scan();   *********************************** The scan function

        if (buf[0] == '0')
            P1OUT &= ~BIT0;
        if (buf[0] == '1')
            P1OUT |= BIT0;
        if (buf[1] == '0')
            P1OUT &= ~BIT6;
        if (buf[1] == '1')
            P1OUT |= BIT6;
        flush_rx();

    } else {
        user = 0xFF;
         }
    LPM4;
} 

Thanks again Eric

Rogil commented 10 years ago

Hi Eric Can you tell me if you use the msprf24_scan() function, I guess so becouse there is an example for ENERGIA? when I asked you about the ack payload some months before you said to me that never use it, is the same with this scan function?. I want implement it to know if Tx and Rx are close enough, no need accuracy at all.

Thanks

spirilis commented 10 years ago

I don't normally use msprf24_scan much, although I did write an application that uses it and it works as expected, I wrote a different implementation for Energia and I do use that and it works.

Just to clarify, msprf24_scan() is intended to test for noise/signal strength on a particular channel, it's not intended for any sort of data I/O. I use it in my Grill Monitor Base Station code to provide a CLI command for testing nRF channel noise - so I can easily select an ideal channel for communication.