Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Interrupt not firing

Netduino Plus 2 NRF24L01

Best Answer DerekGn , 30 January 2014 - 09:28 PM

HI Chris,

 

Solved the problem. I forgot to enable a pwr_up flag in the radio module registry which ment it would not attempt to transmit the data. Hence the interrupt would not fire. The triggering by probing is probibly due to the weak pullup on the line.

 

Thanks for the help

 

Regards

 

Derek

Go to the full post


  • Please log in to reply
3 replies to this topic

#1 DerekGn

DerekGn

    Member

  • Members
  • PipPip
  • 11 posts

Posted 30 January 2014 - 01:51 PM

Hi,

 

I have recently purchased a Netduino plus 2 to use as a hub for a set of wireless humidity and temperature sensors that communicate using an NRF24L01P radio module.

 

I am in the middle of developing a class lib for the radio module. The issue that I have is that the interrrupt is not firing at all. I did some digging on the forum but I have yet to find any thing that could indicate an issue.

_radio = new Nrf24L01P(SPI_Devices.SPI1, Pins.GPIO_PIN_D0, Pins.GPIO_PIN_D1, Pins.GPIO_PIN_D2)                         {                             TransmitAddress = AppConfiguration.Instance.RadioAddress,                             Channel = AppConfiguration.Instance.RadioChannel,                             Mode = Mode.Transmitter                         };

The interrupt line from the device is connected to Pins.GPIO_PIN_D2.

 

The Nrf24L01P initalises the interrupt pin in the following way, only relevent code shown:

public Nrf24L01P(SPI.SPI_module spi, Cpu.Pin chipSelectPin, Cpu.Pin chipEnablePin, Cpu.Pin interruptPin)        {            _interruptPin = new InterruptPort(interruptPin, false, Port.ResistorMode.PullUp,                                              Port.InterruptMode.InterruptEdgeLow);            _interruptPin.OnInterrupt += HandleInterrupt;            .....        }

To trigger an interrupt I perform the following:

while (true)            {                _radio.Transmit(new byte[] {0,1,2,3,4},true);                Thread.Sleep(1000);            }

This should cause an interrrupt when the packet send retry is exhausted, there is no receive radio to ack the sent data.

 

The hardware wiring is pretty straight forward so I do not believe that this is an issue. I have verified the signal levels/connectivity as much as I can with a multimeter. I dont have a scope that I can use. I am pretty familiar with the characteristics of the radio module as I have built a sensor node with an AVR and it is functioning correctly.

 

I would like to know is there something I am overlooking wrt how the netduino/MCLR handles and raises interrupts that could cause this behaviour.

 

Thanks in advance



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 January 2014 - 06:02 PM

Hi DerekGn, What happens if you change Port.InterruptMode.InterruptEdgeLow in your interrupt constructor to Port.InterruptMode.InterruptEdgeBoth (and then just ignore the high events)? Chris

#3 DerekGn

DerekGn

    Member

  • Members
  • PipPip
  • 11 posts

Posted 30 January 2014 - 09:08 PM

Hi Chris,

 

I have tried a number of combinations

_interruptPin = new InterruptPort(interruptPin, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeLow); // No interrupt fired_interruptPin = new InterruptPort(interruptPin, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow); // No interrupt fired_interruptPin = new InterruptPort(interruptPin, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth); // No Interrupt fired

One thing I did notice is when I check the voltage on the IRQ line it will trigger the interrupt. This kind of looks like a floating line issue, I know on the AVR board I did not enable the pullup. Which leads me to the idea that the IRQ pin on the NRF24L01 is push pull, but i cant find this documented anywhere so I could be wrong.

 

I have metered the resistance from the module to the ND2 plus and its 0.2 ohms. From the radio chip to the module pin is 0.4 ohms so it looks ok for connectivity.

 

I have also tried a second radio modele just to be sure its not a module issue. I will have a look at the code again and double check that I am not masking the interrupts due to a bug. Reading and writing to the module over SPI is working correctly.



#4 DerekGn

DerekGn

    Member

  • Members
  • PipPip
  • 11 posts

Posted 30 January 2014 - 09:28 PM   Best Answer

HI Chris,

 

Solved the problem. I forgot to enable a pwr_up flag in the radio module registry which ment it would not attempt to transmit the data. Hence the interrupt would not fire. The triggering by probing is probibly due to the weak pullup on the line.

 

Thanks for the help

 

Regards

 

Derek







Also tagged with one or more of these keywords: Netduino Plus 2, NRF24L01

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.