Nano 33 BLE I/O pin bit resolution 16?

I have created an experimental concept for a PWM fan control that requires the fan to be driven at 10Hz. Because the fan runs under 31Hz a special PWM.h library is required. As I see in my comments on the program I wrote only pins with 16 bit resolution can be used. I was testing this concept using a Yourdruino RoboRed, which allegedly has 16 bit resolution on pins 9 and 10 only. I have no idea where I found out that pins 9 and 10 had 16 bit resolution and consequently I don't know how to find out if the Nano 33 BLE has any pins with 16 bit resolution. If none of them have 16 bit resolution I will have to create my own code to run it. I have looked at the spec sheet and really don't know how to find this out or even what it is really called.

The library and my notes are presented below.

#include <PWM.h>

// Note for low frequency < 31Hz,the high resolution pwmWriteHR() must be used with 16 bit PWM Value

//For the RoboRed only pins 9 and 10 can be used with 16 bit resolution

Look at the timers connected to those PWM outputs, their bitcount and prescalers.

I have no idea how to look at timers. So far all I have is this:

To me the 12-bit 200ksps ADC implies 12 bit

The 16-bit data output implies output, I need input.

For 16 bit input or output you need 16 pins, 1 pin for 1 bit.

Your code does PWM output, which input do you mean?

Sorry you are correct. I need a 16 bit output. So does that 16 bit output for the LSM9DS1 (9 axis IMU) apply to all output pins?

The 16 bit apply to pins capable of PWM output.

Thank You so much.

I guess that means all of them.

"PWM PINS - all digital pins"

All pins can output PWM but not all at the same time.

Thanks, I only need one pin at least for the moment. Could I do two or more pins for a future project?

I believe the maximum number that can be used at one time is 4:

https://github.com/arduino/ArduinoCore-nRF528x-mbedos/pull/105#issue-711868731

after having initialized all the 4 pwm instances, the nordic_internal_pwm array will be full. At this point, when a pwm is deactivated, its entry in the array will not be cleared. This is a problem because in this way when a new pwm is initialized, here, no pwm instance will be found free and the default instance (the last one) will be returned. This means that no matter what pwm is deactivated, the new init pwm will try to use the default pwm instance even if it is not free. This results in a failure.

There is a mechanism for freeing up a channel you are no longer using by passing a negative value (e.g., analogWrite(LED_BUILTIN, -1)), so you can use analogWrite on more than 4 pins just as long as you don't ever go over 4 at one time:

Excellent info. Thank You

You're welcome. I'm glad if I was able to be of assistance.

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