-
• #2
Wow, that's awesome! I love the two displays.
I'm not sure how the scanning is done, but there's a hack in the KeyPad module which (IMO) is quite nice: https://www.espruino.com/modules/KeyPad.js
You basically just pull down and watch all rows, then set all columns high (or vice-versa). Then when a key is pressed down you see that a pin has changed state and at that point you scan to see what changed (and I guess maybe keep scanning until the key is released). That way you don't have to waste a bunch of power scanning - you know as soon as any key is pressed.
-
• #3
Oh, missed this post completely. This is very nice. Love the dual display idea too :-)
nice!nano clones are quite cheap on aliexpress so good source of small 52840 boards with usb and lipo charging chip.Few links
https://zmk.dev/ ZMK firmware - keyboard firmware for these boards, based on ZephyrOS so most likely not using SoftDevice for BLE.
https://github.com/joric/nrfmicro/wiki/Alternatives - the SuperMini NRF52840 / Pro Micro is quite cheap on aliexpress -
• #4
Those clones look crazy cheap, for example https://www.aliexpress.us/item/1005006035267231.html
£4.90 - I can't even buy a nRF52840 chip for that from mouser/farnell/etc, let alone the whole board with charging circuit!
I wish I knew who makes them and I could order a bunch and resell them
-
• #5
@Gordon Thanks, I missed the keypad module but that is exactly how my scanner works. To make sure nothing is missed, I keep the scanner active for 5 seconds from the last key event after the first keypress wakes it up then it goes back to waiting for a key interrupt as you describe.
@fanoush In fact, I started with some of the Aliexpress modules and in some ways, you get what you pay for. The quiescent current of the nice!nano is around 10 microamps while the Aliexpress module is more than 140 microamps.
I now have a basic editor working and I can now hack all its software on the device itself. Hope to post a video of it soon.
-
• #6
yes, it is documented that scratching off some specific resistor near usb connector helps, it is 5K pull up to vcc by mistake but cpu can drive that pin too after the resistor is removed, have that cheap board too but did not test this yet. and the leak is when driving that pin low which turns off power to external stuff so if not used for anything it may be pulled high to prevent the leak(?)
-
• #7
I saw that too but I think it’s related to switching off the 3.3V supply pin so I do not think it helps if you do not switch off the 3.3V. That is, it’s a pullup on the pin which controls the 3.3V
-
• #8
OK, so I had to scratch it off. When it was there and D13 was pulled down it draw like 500uA, when pulled up it was still about 145uA (from 4.2V battery). When I scratched it off it still draw about 145uA when pulled up as before however when pulled down it turned off power to VCC pin and went down to normal 5uA idle when radio is not used. So the 140uA is the 3.3V voltage regulator when it is turned on. Which is not that great if you need to power something from 3.3V like the display. Does nice!nano have more efficient 3.3V regulator going to EXT_VCC pin? Anyway, nrf52840 can produce 3.3V (or 1.8V) by itself too when powered from VDDH (5v from usb or 4.2 from battery). And indeed the VDD pad near SWD gives 3.2V even if the regulator is turned off so maybe it could handle that low power display more efficiently.
So overall it is good board with that resistor scratched off. Also the antenna is as good as my other boards, better than watches like Magic3. It can find xiaomi thermometer advertising over coded phy behind several walls which Magic can't. And rssi for that thermometer is about the same as on my phone or 52840 dongle from same location.
-
• #9
Thanks, that is interesting, I will try it on the boards I have. Yes, I think the main difference is the 3.3V regulator. The full schematic for the nice!nano can be found here https://nicekeyboards.com/docs/nice-nano/pinout-schematic. There are two versions. I think the AliExpress board is like V1 except that the resistor should be 2M not 5K. I have the V2 board which has a different circuit for the external 3.3V.
Can you post a photo of the location of the 5K resistor.
-
• #10
It is marked in red on that wiki page https://github.com/joric/nrfmicro/wiki/Alternatives
search for "Workarounds". I just crush it in the middle with small flat screwdriver but could be desoldered too.Also down on that page for nice!nano v1 "Regulator: AP2112K (code G3P, up to 600 mA, leaks 55uA), you can replace it with XC6220 (up to 1A, leaks 8uA)" so the voltage regulator leaks less than half of this cheap board. however if you power LED from it it draws much more anyway and if you need much less then the VDD pad could work (or GPIO pins).
-
• #11
I have posted a more comprehensive description of this on Hackaday https://hackaday.io/project/195010-pocket-pad/ . It has also been picked up by a Hackster writer here.
-
• #12
That's excellent! Really glad hackster picked it up too!
-
• #13
Here is the video of the editor in action writing the traditional hello world program. The typing is a little painful as I am used to using this keyboard with my thumbs.
https://youtu.be/eWG1iZ8Woz0?si=R9hkCvVP_7za8025
There is an example of cut and paste at the end of the video.
-
• #14
That's really cool! I like the "split screen" layout, sort of a physical IDE.
Something I've been dreaming of for a while is a mobile LoRa texting device with a low-power display and a Blackberry keyboard. It could be a Pixl.js + BB Q20 keyboard + LoRa + antenna + battery in a handheld format. A bit like the old Cybiko, which had two-way text messaging over radio as early as 24 years ago. Or like an early Blackberry, only with LoRa.
A related idea is to build a rudimentary social mesh network on top of this.
-
• #15
Do you have a PROMICRO/SUPERMINI.py board version for this board?
-
• #16
Promicro is a clone of the Nice!Nano so its the same board description.
-
• #17
I have built the promicro. Hex-file according:
make clean && BOARD=PROMICRO RELEASE=1 make
Then build the promicro.uf2 file:
uf2conv.py espruino_2v25.13_promicro.hex -b 0x26000 --family 0xADA52840 --convert --output espruino_2v25.13_promicro.uf2Checking the file with uf2conv.py -i espruino_2v25.13_promicro.uf2 results in error:
Traceback (most recent call last):
File "C:\Users\louis\projecten\espruino\Espruino\bin\uf2conv.py", line 361, inmain()
File "C:\Users\louis\projecten\espruino\Espruino\bin\uf2conv.py", line 329, in main
convert_from_uf2(inpbuf)
File "C:\Users\louis\projecten\espruino\Espruino\bin\uf2conv.py", line 71, in convert_from_uf2
assert False, "More than 10M of padding needed at " + ptr ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
TypeError: can only concatenate str (not "int") to str
When I do the same procedure for the NRF52840DK.py, then everything goes well
-
• #18
it is probably because the hex file you start with contain also bootloader (and softdevice). easiest is probably to copy paste final mergehex line and omit everything except first two inputs (=softdevice hex and the espruino app_hex) and then uf2conv such merged hex file without the -b address. or if you know you already have correct softdevice s140 6.0.0-6.1.1 flashed you can uf2conv just the app_hex file
EDIT: attached is my current board file, building bootloader is disabled so converting may be easier with this one
1 Attachment
-
• #19
And BTW this board is pretty good overall, one cheap source is the twin pack here https://www.aliexpress.com/item/1005008144734921.html , the resistor is fixed on this one so power consumption in idle is about 5uA
I like how this board is powered from battery, it uses internal nrf52840 VDDH regulator and battery is directly connected to it so there is little loss, one can measure battery voltage via internal VDDH reference and the gpio voltage can be set between 1.8 - 3.3V via UICR REGOUT0 setting.
Apart from Espruino I also have DAPLink ported to this board and use it as SWD/JTAG probe. DAPLink can optionally have hardcoded target board and then it provides USB storage for easy flashing of hex files to the target, I have a build for nrf52832 and 52840 targets and it is kind of nice to just drop hex file to flash e.g. Bangle 2. It also works with newly merged SWDCON https://github.com/espruino/Espruino/tree/master/libs/swdcon console over the charging cable with Bangle 2 so devices with broken bluetooth can be somehow used as ordinary watch.
-
• #20
I have bought already a couple of these devices: https://www.aliexpress.com/item/1005008144734921.html
and am using for temperature/humidity measurement. Works fine.This INFO_UF2.txt of Nicenao-disk:
UF2 Bootloader 0.6.0 lib/nrfx (v2.0.0) lib/tinyusb (0.10.1-41-gdf0cda2d) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: nice!nano
Board-ID: nRF52840-nicenano
SoftDevice: S140 version 6.1.1
Date: Jun 19 2021I assume, that I can do the following:
python uf2conv.py espruino_2v25.13_nano.app_hex --family 0xADA52840 --convert --output espruino_2v25.13_nano.app_hex.uf2 -
• #21
yes, unless it gets confused by the app_hex file not having .hex suffix and taking it as a binary, then rename it to app.hex first
-
• #22
I believe it went well and hope I can still use the UF2-disk:
uf2conv.py -i espruino_2v25.13_nano.app_hex.uf2
--- UF2 File Header Info ---
Family ID is NRF52840, hex value is 0xada52840
Target Address is 0x00026000
All block flag values consistent, 0x2000 -
• #23
Anyone having an issue with the Nice!Nano bootloader after updating app to Espruino(app only)? I short RST to GND 2x and it displayed a drive, copied the espruino.uf2 to it, works great! When I try to short the pins again, I see the device reboot, but it doesn't enter bootloader.
?? -
• #24
the double reset is a bit tricky, too slow or too fast and it boots into espruino. you can also poke this magic value https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/main.c#L112 to GPREGRET
and BTW I started to get those two red boards in the 3 item bundle offer for $4.49, this is pretty insane
I could not resist this PocketType keyboard kit from Mechboards when I saw it advertised at a very reduced price. I wanted to see if I could program it in Espruino as the sockets on the keyboard for a Pro Micro ATmega32U4 board are also compatible with a nice!nano board based on an NRF52840 processor.
When I got the kit, I realised that there were enough spare pins to drive a display - in fact two low power ST7302 based displays as can be seen in the photo below.
The top display in the picture is running a Bangle style launcher and the bottom display is a Terminal console. The bottom right key can be used to direct the keyboard output to an app running in the top display or to the console in the bottom display. In addition, the device can be made to appear as a bluetooth keyboard to another computer by running the keyble app.
The keyboard is powered by a rechargeable LIPO battery. The keyboard matrix scanner is activated by pressing any key and I was pleased that it starts fast enough to capture the first key press. The end result is that the overall standby current consumption is less than 100 microamps. The spare lipo battery I used is 1200mah, so with light use, I will next have to charge it again some time in 2025.
PocketType is a 40% keyboard with numbers and symbols accessed by using layer keys. The kit comes with blank keycaps which I have labelled with transfers and then sealed with clear nail varnish. The transfer set was for a standard set of characters - thus the creative use of orientation to label arrow keys etc.
With the addition of a simple text editor, the device is definitely a candidate for a deckchair/sun lounger programming tool - although it has to be said that typing on the microswitch based PocketType keyboard is thumb based and fairly slow.