Nano Sense 33 BLE attachInterrupt pulls pin high

I'm still seeing this bug https://github.com/arduino/ArduinoCore-nRF528x-mbedos/issues/77

Reading through the details it looks like it was fixed and the patch made it into the main branch months ago so I don't understand why I still get the problem.

I notice in the "boards manager" window there is a deprecated entry that mentions the Nano 33 BLE and says to use Arduino MBED OS. Well I have an entry for MBED OS as well - how do I make the IDE use that and remove or ignore the deprecated one?

I'm on a new Mac and the IDE was installed from scratch only 2 weeks ago - so as well as wondering why deprecated packages are being installed in the first place, presumably the tried and tested technique of deleting everything and starting over won't work?

The Arduino core for this board is held in a file called Arduino15 and for the macOS it should be at Users/{username}/Library/Arduino15

Inside this file there is a folder "packages" which holds the different "cores" for the boards. The latest version for the nano33 BLE is

Arduino15\packages\arduino\hardware\mbed_nano\2.1.0

If you see the older mbed os in the packages file you can delete it.

Thank-you for the suggestion. I had different versions to you in that folder so I just deleted everything and re-compiled my code in the IDE. The IDE complained about missing stuff and offered to download it. I said yes to everything and now I have "mbed_nano\2.1.0" at the path you gave.

Unfortunately it doesn't work still. Re-compiling and uploading goes fine but as soon as the code runs and I attach an interrupt to a pin, that pin is pulled high and stays high.

Can you please provide a minimal example that I can test. I can see the attachInterrupt() is pulling a pin HIGH that has been set to INPUT_PULLDOWN, but the interrupts appear to act normally. The pin does not "stay high" but I may not be understanding you correctly.

What is providing the interrupt?

What I'm ultimately trying to achieve is to read the signals put out by a Hewlett-Packard HP49G calculator. These came with a port on the top that could be connected to a transparent glass LCD screen that was placed flat on an overhead projector so that a teacher could project the calculator's display to the whole class. I thought it would be fun to use an Arduino to read these signals and send the screen image back to a PC via the USB.

There are 4 data lines plus ground and 5V to power the LCD plate on the OHP. The sample code below simply counts the "line pulse" signal (which goes high once at the start of each pixel row on the LCD) by making it an interrupt. This works perfectly on an Arduino Micro and it counts a consistent 8192 every 2 secs. Unfortunately the Micro is too slow to read the next signal which is the pulse to indicate that a pixel value is available to be read i.e it's effectively the column pulse.

In theory the Micro might just be fast enough if I resorted to the tightest of tight hand-coded and optimised assembler, so I decided to invest in a Nano 33 BLE instead, which should be more than quick enough.

The catch with the Nano is that it is a 3.3V device and the calc is 5V. So I've added a Texas Instruments TXB0108 bi-directional level shifter and I feed the input signal through that. This is where things are going wrong: the code now just outputs a zero count.

Looking on the oscilloscope, the input 5V signal to the TXB0108 is as expected. The output goes high immediately and stays high with a very high frequency oscillation between 1.3 and 2.8V. While this is happening the calc's LCD screen throws a fit.

So I think (but it's a guess really) that the Arduino is keeping the interrupt pin high and when the calc wants to go low it is being prevented from doing so. I'd like to be able to have the Nano's interrupt pin float the way it does on the Micro so I could know for sure.

Code is below and I've attached an oscilloscope picture so you can see what the original from the calc looks like.

/*
  HP49G test 1:
  Feed the LP signal into an interrupt and count them.
*/

#define PIN_LP 2    // Connect LP to pin 2

volatile uint32_t lp_count = 0;

void setup() {
  Serial.begin(115200);
  pinMode(PIN_LP, INPUT);
  attachInterrupt(digitalPinToInterrupt(PIN_LP), lp_handler, RISING);
}

void loop() {
  uint32_t x = lp_count;

  Serial.print("Count = ");
  Serial.println(x);
  lp_count = 0;
  delay(2000);
}

void lp_handler()
{
  lp_count++;
}

LP wrt VCO

Note that the burst of low-voltage noise that you can see is cross-talk from the per-pixel data signals. This is mostly because I hacked up a bit of Ethernet cable to patch into the calc's data port rather than anything inherently bad with the calc. Once I have something working I'll create a better quality more permanent lead.

Why did you choose a Nano 33 BLE? With the mbed os there are some tricky aspects, and in my experience there are still some issues to be worked out.

There are plenty of faster boards, in the arduino, adafruit and teensy flavors which don't use the mbed os. You might want to consider a board change.

I even see some teensy boards which are 5v tolerant.

Given your signal source its not clear what others can do to test out your situation.

I estimate I need a processor maybe twice as fast as the Arduino Micro. Searching through the arduino.cc site the only ones with a high enough clock speed meant changing to 3.3V. I picked the Nano 33 BLE because it was cheap-ish and has useful sensors that I could use on other projects if it didn't work out. I didn't realise that mbed os was still so new.

I'm not really aware of what there is available in the clone market. I did find the Teensy but it wasn't clear just how easy adding it into the Arduino UI was going to be - the web site claims it is simple but they all say that and I didn't want to be side-tracked by another set of issues.

If you can recommend a 5V board compatible board that has enough oomph then I'm certainly happy to give that a try? I want to keep my solution as simple as possible so that other calc enthusiasts can give it a go. One chip or board available to buy with headers in place would be ideal.

I've spent some time researching around the internet, and my recommendation would be a Teensy 3.2. It is available for order with soldered headers (Teensy 3.2 Pins).

The board is about the same price as the Nano 33 BLE.
The PJRC website is very extensive, the Teensyduino add on for the Arduino IDE appears well documented and there appears to be a good library selection bundled. There is also an active forum for support.

Thank-you that's very helpful, I'll give it a go.

Let us know how it turns out.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.