XAIO 1.28" Display RTC Wakeup xaio nrf52x sense

Hi all,

I’ve been working with the XAIO 1.28" touch display with a nrf52840 sense (although this should be for all XAIO MCU’s). It’s pretty cool.

I’m currently looking to see if anyone has, or has suggestions, on how to use the onboard RTC to set an alarm to wake up the MCU from deep sleep. Keeping in mind all pins are used and I don’t see a way to direct a specific pin to wake upon even if I was able to set an alarm. I’m also looking to put the display to sleep/power off.

As a side note I’'m using the mbed variant as I need some features only available on mbed. For those that are using SquareLine Studio, if you want to use mbed you need to use the GFX library. It took a bit to make it work but it works well now that I have it working. For reference check out the hardware_test example from Seeed for the touch display - it shows how to use the TFT or GFX for the display. I had to build my own board library for SquareLine Studio for the Arduino IDE.

Hi there,
Check out this Link it also compiles with Embed 2.9.2 and runs very well on the Xiao Nrf52840 Sense. I don’t see any code or pictures, You have any ?

HTH
GL :slight_smile: PJ :v:

Cool thanks. I didn’t include code as it’s part of the XAIO display example. I’m working with small displays including ePaper for various requirements. The square line studio leverages the LVGL libraries which is a generic display/touch infrastructure. It took a bit to figure it all out but it’s working (mostly).

I have some waveshare displays as well. I have them up and running.

The core question I presented is with the XAIO round 1.28” touch display. It has an onboard SD and a RTC that has a separate battery (watch kind)I’m looking to see if anyone has been able to figure a way to sure the RTC to wake up the NRF52840 sense.from deep sleep

Hi there,
Ah’ I see, it is the Seeed Studio Round one? not like this one?

That RTC is only for reading the Time & Date, however you can set a timer and poll it for the TF flag, same as what Fires the INT pin. not any kind of solution. Even with the embed the power during sleep is no where near the non embed 5uA (see msfujino’s thread )

What about adding the Expansion board without the camera, There’s extra IO on that?
or more directly why not use the ULP_RTC on the Xiao ? 55uA power draw. asleep and RTC as Wake_up source.
GL :slight_smile: PJ :v:

The specific display is this one Getting Started with Seeed Studio Round Display for XIAO | Seeed Studio Wiki

And yes unfortunately it appears I can’t get close to the 5uA on the mbed variant :frowning:

I’m using the nrf52480 Sense.

My requirements (for this project) include;

  • PDM/Microphone
  • SD card
  • BLE
  • low power/sleep (prefer < 10uA)
  • touch display (small/round)
  • RTC (I can use motion instead but would like a timer event as well)
  • external tilt switch (not using Accelerometer due to power usage)

The nfr52x support for the onboard PDM is mbed only (unless someone can point me elsewhere)
The BLE library for mbed uses the ArduinoBLE library which works well/easier to use than others and works under mbed (and not non-mbed)

The touch display has the SD card and onboard RTC (although it might be limited use).

There are 2 GPIO pins I can use if I turn off the backlight and no use the battery level read.

Theoretically I might be able to jumper/solder the RTC interrupt (out) pin to one of the GPIO pins - assuming there is no other way to for an interrupt from the display RTC as its currently wired.

I will connect one of the 2 available GPIO pins for the external switch. I would like to use the other available pin for a PIR/ motion sensor.

And then I need (help with/guidance) on how I can effectively turn off the display. I imagine there may be a register I can set to have it go into some level of sleep. After that I will shut down all GPIO pins except the ones set for interrupt. Once awake I’ll reactivate the I2C and SPI pins. At least that’s my plan.

As a side note: I did do the journey of trying to get external PDM’s to work which produced low fidelity. The onboard mic on the Sense is spectacular. I also did the journey to turn off external hardware widgets like displays using transistors.

For this particular project I will likely only make 3 or so units which won’t need the touch screen.

Hi there,
Lots to break down here,
The PDM can be used with other LIB’s (non-embed)
The BLE stuff can ALL be done with non-Embed…Bluefruit.
SD and RTC onboard (answered) only for time.
2 GPIO pins (use expansion board)
No_soldering, USE the right Library instead. (internal RTC and ULP_RTC)
Pretty sure you can END the display b4 low power or Sleep.(command syntax and ?)
The PIR with correct IO to Wake… No -Issue’s (there’s another post doing similar, go search)
My .02 :v:
HTH
GL :slight_smile: PJ

Thanks and yes to all.

I have done all of the other components so the only outstanding, is if I could use the onboard RTC on the display. Other displays I’ve used I have been able to turn off from the MCU, just haven’t played with this one - reading the tech stuff now. I’ve used the other BLE libraries as well and they work fine, just not as easy to use (for me).

I have NOT been able to find libs for the onboard PDM on the sense. Everything I’ve seen out there is mbed only. I think the support folks confirmed that with me as well. IF you happen, or someone else, comes across it/some that would be spectacular. Also the xnrf52840 does not have an internal RTC.

My preference would be to not use mbed!!

I have NOT been able to find libs for the onboard PDM on the sense. Everything I’ve seen out there is mbed only. I think the support folks confirmed that with me as well.

File>>Examples>>(Examples for Seeed XIAO nRF52840 Sense)>>nRF52840 PDM - Adafruit Fork>>PDMSerialPlotter

1 Like

Hi there,
Even this one?
https://docs.arduino.cc/learn/built-in-libraries/pdm/
Should work with 1.1.1 AFAIK?

Incorrect!
The nRF52840 has a real-time counter (RTC) peripheral, but it’s not a real-time clock. The RTC is a low-power timer that resets every time the system is reset. It’s not intended to keep time.
This is why I say the RTC on the display is for TIME of Day etc., The RTC on the Xiao is for Interrupts , timers , counters etc.
So you probably just need to know the difference and how to use it, There are some additional LIB’s for that as well.
HTH
GL :slight_smile: PJ :v:

straight outa compton, a.k.a from the Adafruti Example. Compiles 1.1.x and outputs serial data and Serial plotter as you see here with a whistle playing.

FQBN: Seeeduino:nrf52:xiaonRF52840Sense
Using board 'xiaonRF52840Sense' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5
Using core 'nRF5' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5

Detecting libraries used...
C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\9-2019q4/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -c -g -Werror=return-type -mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=64000000 -DARDUINO=10607 -DARDUINO_Seeed_XIAO_nRF52840_Sense -DARDUINO_ARCH_NRF52 -DARDUINO_BSP_VERSION="1.1.5" -DNRF52840_XXAA -DUSBCON -DUSE_TINYUSB -DUSB_VID=0x2886 -DUSB_PID=0x8045 -DUSB_MANUFACTURER="Seeed" -DUSB_PRODUCT="XIAO nRF52840 Sense" -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 -Ofast -DCFG_DEBUG=0 -DCFG_LOGGER=0 -DCFG_SYSVIEW=0 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/Core/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/DSP/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx/hal -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx/mdk -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx/soc -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx/drivers/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx/drivers/src -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/freertos/Source/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/freertos/config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/freertos/portable/GCC/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/freertos/portable/CMSIS/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/sysview/SEGGER -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/sysview/Config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5/libraries/Adafruit_TinyUSB_Arduino/src/arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\variants\Seeed_XIAO_nRF52840_Sense C:\Users\Dude\AppData\Local\Temp\arduino\sketches\6407537A4496DDAD7A9A54A577EAD392\sketch\sketch_mar28b.ino.cpp -o nul
Alternatives for PDM.h: [nRF52840 PDM - Adafruit Fork@1.0]
ResolveLibrary(PDM.h)
  -> candidates: [nRF52840 PDM - Adafruit Fork@1.0]
C:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\arm-none-eabi-gcc\9-2019q4/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -c -g -Werror=return-type -mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=64000000 -DARDUINO=10607 -DARDUINO_Seeed_XIAO_nRF52840_Sense -DARDUINO_ARCH_NRF52 -DARDUINO_BSP_VERSION="1.1.5" -DNRF52840_XXAA -DUSBCON -DUSE_TINYUSB -DUSB_VID=0x2886 -DUSB_PID=0x8045 -DUSB_MANUFACTURER="Seeed" -DUSB_PRODUCT="XIAO nRF52840 Sense" -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 -Ofast -DCFG_DEBUG=0 -DCFG_LOGGER=0 -DCFG_SYSVIEW=0 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/Core/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\tools\CMSIS\5.7.0/CMSIS/DSP/Include/ -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx/hal -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx/mdk -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx/soc -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx/drivers/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/nrfx/drivers/src -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/nordic/softdevice/s140_nrf52_7.3.0_API/include/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/freertos/Source/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/freertos/config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/freertos/portable/GCC/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/freertos/portable/CMSIS/nrf52 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/sysview/SEGGER -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5/sysview/Config -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5/libraries/Adafruit_TinyUSB_Arduino/src/arduino -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\cores\nRF5 -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\variants\Seeed_XIAO_nRF52840_Sense -IC:\Users\Dude\AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.5\libraries\PDM\src C:\Users\Dude\AppData\Local\Temp\arduino\sketches\6407537A4496DDAD7A9A54A577EAD392\sketch\sketch_mar28b.ino.cpp -o nul
Alternatives for Adafruit_TinyUSB.h: [Adafruit TinyUSB Library@1.7.0]
ResolveLibrary(Adafruit_TinyUSB.h)
  -> candidates: [Adafruit TinyUSB Library@1.7.0]

Ok - so you CLEARLY don’t monkey around lol. I’ll checkout the PDM library and see if I can make it work. I looked at the nordic docs and at least for what I’m looking for it should work. The reason I steered away from any timers was power. but the fact is the low power under mbed is pretty ugly so its entirely likely that using the RTC (of sorts) will be lower than the mbed sleep() itself.

I absolutely appreciate your input and guidance. And I can thank you enough for your responsiveness.

Now I’m off to do some bit fiddling.

1 Like

:wink: :+1:


btw, The DMA would be the best method, Takes more work but , the code once initialized doesn’t have to worry about it. :v: