IRremote and nRF52

Hi,

Has anyone managed to use the IRremote library with an nRF52 chip (e.g. Arduino Nano)? I’m a beginner, and I’m not sure it’s possible. I have created a very simple sketch

#include <IRremote.h>
void setup() {
  IrSender.begin(IR_SEND_PIN);//, ENABLE_LED_FEEDBACK);
}

void loop() {
  if (Serial.available() > 0) {
    Serial.read(); // Clear the buffer
    Serial.println("Sending IR signal...");
    IrSender.sendNEC(0x1234, 0x56, 1); // Address, Command, Repeats
  }
}

But when I send the pulse and I check with the oscilloscope, instead of seeing the expected pulse, I see just two 9us pulses, 900us apart. Any thoughts?

Thanks!

I don't know, but what is your send_pin?

Sorry I didn't copy all the code and I forgot to copy that. It's a GPIO pin, can't remember which one as I don't have the code in front of me atm.

Many of those devices are power sensitive. Post an annotated schematic showing exactly how you have wired it.

I currently have a red LED instead of the IR to see it blink. The pulses I described above where measured connecting the oscilloscope probe to the orange jumper.

What core, what board selected, what pin configured?

platformio.ini

[env:nicenano]
platform = nordicnrf52
board = nicenano
framework = arduino
upload_port = /dev/ttyACM0
monitor_port = /dev/ttyACM0
build_flags = -D USE_TINYUSB
monitor_speed = 115200
lib_archive = no
lib_deps =
    IRremote

main.ini

#include <Arduino.h>
#include <IRremote.h> 

const int IR_SEND_PIN = PIN_022;

void setup() {
  IrSender.begin(IR_SEND_PIN);

void loop() {
  if (Serial.available() > 0) {
    Serial.read(); // Clear the buffer
    Serial.println("Sending IR signal...");
    IrSender.sendNEC(0x1234, 0x56, 1); // 
  }
}

And using this:

And this bootloader (in case it matters):

https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/download/0.9.2/update-nice_nano_bootloader-0.9.2_nosd.uf2

Let me know if there’s more info missing. Thanks!

Since you are trying with IRremote, I expect that you successfully run Blink on that LED..

Not sure what you mean sorry. But in the IRremote example SimpleSender/PinDefinitionsAndMore.h they do define stuff for the NRF51 but can’t see anything for NRF52, so it might not be supported.

I mean that can you operate that LED with blink sketch?

The LED blinks without any issues with the sketch shown above. However it blinks just twice instead of blinking with the correct IR pulse.

That's not what I asked.
Also, what's the Serial stuff doing on your code while you don't have Serial.begin ...

Sorry I don't think all this is relevant. I have managed to send IR commands using pulses generated manually with the setup described above. I believe the issue is an incompatibility between IRremote and the nrf52.