Author Topic: ̶D̶u̶m̶p̶s̶t̶e̶r̶ ̶m̶o̶u̶s̶e̶ ̶M̶1̶5̶0̶ Free 2.4GHz devboard (nRF24LE1 and CCD)  (Read 1006 times)

0 Members and 1 Guest are viewing this topic.

Offline RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6785
  • Country: ro
Found yesterday a Logitech wireless mouse M150 (without its receiver):



There were 2xAA GP alkalines inside, one leaked.  Dismantled out of curiosity (a single Philips screw to unscrew, located under batteries).  The surprise was to find inside a programmable nRF24LE1 (8051 core with integrated 2.4GHz transceiver), and an optical sensor with available datasheet ADNS-2080 (22x22 pixels CCD).  The optical sensor datasheets even has a typical schematic for a nRF24LE1 wireless mouse, and the radio protocol of the nRF24LE1 is the same as the one used in the very cheap nRF24L01 modules for Arduino.

https://infocenter.nordicsemi.com/pdf/nRF24LE1_PS_v1.6.pdf
https://www.mouser.com/datasheet/2/678/avagotechnologies_ADNS-2080-908926.pdf

The battery leak was easy to remove with some vinegar and a toothbrush.  Then powered the PCB from a 3V lab supply to see if it works, it was taking about 15mA at first, then went down to 7mA, but the LED didn't lit.  :-\

Damaged?  Nope, the LED was IR, for a lower power consumption.  ;D
Can be seen it's working when looking through a mobile phone camera.

Since it has case/batteries/wireless/buttons and the optical sensor, could make a nice standalone data logger, or maybe a handheld scanner/small 22x22 webcam, or a very fast (~100 000 FPS) 1 pixel 7 levels digital photodiode, etc.



Found how to improvise a nRF24LE1 programmer from an Arduino https://github.com/polkabana/nRF24LE1_Programmer

Looking further for FOSS tools, to write nRF24LE1 (8051 core) code under Linux, but the Nordic's libraries seems to be for Keil only.  ???

I'm not familiar with Nordic MCUs, what's the way to start?  What IDE/compiler/libs to use?
 
The following users thanked this post: ledtester, MK14

Offline globoy

  • Regular Contributor
  • *
  • Posts: 236
  • Country: us
Years ago I did a bunch of development with the 24LE1 but was too poor for Keil at the time so I used SDCC (https://sdcc.sourceforge.net/).  It's actually a pretty good compiler for 8051 and has good documentation.  I just ported over the appropriate chip-specific header files and used Make to build.  I would occasionally look at the assembly it produced to find the best ways to optimize my C when necessary.  FWIW, here are the flags I gave the compiler for the chip.

Code: [Select]
CFLAGS = --nogcse --model-large --std-c2x --code-loc 0x0000 --code-size 0x4000 --xram-loc 0x0000 --xram-size 0x400
The nRF24LE1 was a fun chip.  Simple enough that you could easily understand it (and the accompanying radio) but capable enough to do some real things.

There's also a library that a guy named Brennen Ball wrote that might help you.  Info at http://blog.diyembedded.com/2010/06/nrf24le1-sdk-for-sdcc.html.  And I made a programmer too: https://danjuliodesigns.com/projects/nrf_prog.html and https://danjuliodesigns.com/products/nrf_prog2.html
 
The following users thanked this post: RoGeorge

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6950
  • Country: fi
    • My home page and email address
It's those optical sensors or similar that I want.  Three of them, specifically, so I could construct my own quaternion/bivector trackball using any ball of about snooker ball size, just sitting in a reader cradle; not captive.  In normal use, would be nice to use it to pan and zoom; in 3D, would be optimal for orienting the work at hand.
 

Offline RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6785
  • Country: ro
Code: [Select]
CFLAGS = --nogcse --model-large --std-c2x --code-loc 0x0000 --code-size 0x4000 --xram-loc 0x0000 --xram-size 0x400

That will come very useful, thank you for the SDCC hint.

The download links (i.e. http://www.diyembedded.com/lib/nrf24le1/lib_nrf24le1_sdk_v4.0.zip) didn't work for me, but I could find and download the most recent SDK from Nordic.

The good news is both the Keil C51 and the Nordic SDK can be used under Linux (with WineHQ).  :D
Didn't download yet anything into the nRF chip, but at least the demo projects from Nordic (for nRF24LE1) can be opened and compiled with the latest Keil C51 (which can be used free with some limitations).

Just for the docs, adding here the install notes:
Code: [Select]
0. - download:
        - Keil from [url]https://www.keil.com/demo/eval/c51.htm[/url]
        - Nordic nRFgo SDK 2.3 from [url]https://www.nordicsemi.com/Products/nRF24-series[/url]

1. - install Keil C51 (C51V961.EXE) with right click open with Wine
        - !!! change the default path to C:\Keil instead of C:\Keil_v5, because that is the path expected by the nRF Go SDK 'nrfgo_sdk_2.3.0_setup.exe'
           
2. - install in Wine the nRFgo SDK (nrfgo_sdk_2.3.0_setup.exe)
        - !!! check the last checkbox, too, to copy the headers into C:\Keil\C51\INC\Nordic, in Linux that path will be found at:
                ~/.wine/drive_c/Keil/C51/INC/Nordic
               
        - the installed Nordic SDK is in 'C:\Nordic Semiconductor', which in Linux will be at:
               ~/.wine/drive_c/Nordic Semiconductor/
        - projects examples are in 'C:\Nordic Semiconductor\nRFgo SDK 2.3.0.10040\source_code\projects\nrfgo_sdk\', so in:
               ~/.wine/drive_c/Nordic Semiconductor/nRFgo SDK 2.3.0.10040/source_code/projects/nrfgo_sdk/
               
3. - install with Wine the nRFprobe (nrfprobe_v2_0_0_7252.exe), or else dll err at debug (ignore the install message asking for Keil v4, install it in Keil v5)

Didn't try to program the chip yet.  Starting with Keil first in order to minimize the unknowns.  Once I'll have a Keil demo running on hardware, will switch to the SDCC.




It's those optical sensors or similar that I want.  Three of them, specifically, so I could construct my own quaternion/bivector trackball using any ball of about snooker ball size, just sitting in a reader cradle; not captive.  In normal use, would be nice to use it to pan and zoom; in 3D, would be optimal for orienting the work at hand.

In case you want the same optical sensors, apparently the Logitech Wireless Mouse M150 is still in production, often sold as a combo of wireless Keyboard+Mouse+2.4GHz receiver.  I don't have the receiver, but I suspect that will have inside a nRF24LU1 (which is about the same chip as the nRF24LE1, but with native USB).  Beware there is also a nRF24LE1 OTP, pin compatible but not reprogrammable.  The mouse I've found has the 2011 date written on the PCB.  More recent HW version might have different components, but it's very easy to open the mouse and check (one Philips screw under batteries, without braking any warranty seal).

I've tried to picture the trackball you describe, but couldn't.  What do you mean by trackball "sitting in a reader cradle; not captive".  If the snooker ball can move freely, where should be the optical sensors sited?

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6950
  • Country: fi
    • My home page and email address
I've tried to picture the trackball you describe, but couldn't.  What do you mean by trackball "sitting in a reader cradle; not captive".  If the snooker ball can move freely, where should be the optical sensors sited?
Consider a ball sitting on a truncated triangular pyramid (tetrahedron), as in the attached picture.
The sensors are located as near the peaks of the stand as possible.

In theory, two would suffice, but using three one can reduce angular and directional jitter.  (Or maybe it's just the symmetry that appeals to me.  I could use two and a four-sided pedestal, but the three-sided one leaves more room for my fingers to dangle.  Similarly, a larger support yields more precision, but I'd like my palm to be able to rest naturally over the sphere, without my fingers hitting the support base.)

Logitech QuickCams for Mac, early webcams in the nineties, had a spherical camera with exactly such a truncated triangular pyramid/tetrahedron support made out of rubber.

In a typical trackball, you'd just have one sensor at the bottom.  However, most optical sensors cannot detect rotation in the sensor plane, i.e. rotation of the ball around the vertical axis.  With two or more sensors, you can compute the rotation quaternion corresponding to the tangential delta vectors at each sensor.  For non-3D use, the normal trackball movement would just pan/scroll, but that rotation would zoom in/out.  Very useful in EDA on my non-dominant hand, dominant hand holding a mouse or hovering on top of a trackpad.
« Last Edit: August 15, 2023, 11:25:15 am by Nominal Animal »
 

Offline RoGeorgeTopic starter

  • Super Contributor
  • ***
  • Posts: 6785
  • Country: ro
For some reason I thought the ball has to roll free on a surface.

If the center of the ball is to sit at a fixed point, the easiest DIY would be to fix 1-2 mouse sensors near the surface of a ball from a former roll-on deodorant.

Same mechanical ensemble, but with a lever stuck in it, would make a nice optical joystick, capable to sense relative tilting, plus rotation around the lever's axis.

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6950
  • Country: fi
    • My home page and email address
For some reason I thought the ball has to roll free on a surface.
Oops.  By "non-captive", I meant that I want to be able to just lift the ball out of the cradle, without it being stuck.  Makes cleaning it much easier.

If the center of the ball is to sit at a fixed point, the easiest DIY would be to fix 1-2 mouse sensors near the surface of a ball from a former roll-on deodorant.
I prefer bigger, maybe tennis ball size.  You do need at least two sensors measuring tangential displacement in a plane, and the accuracy for the axis of rotation is the better the further the sensors are from each other.  With three, especially symmetrically positioned, you can increase the accuracy.

Same mechanical ensemble, but with a lever stuck in it, would make a nice optical joystick, capable to sense relative tilting, plus rotation around the lever's axis.

You might use 9 degrees of freedom gyroscope chips for that.  Those would also work for my trackball case, if I made it big enough to stuff a BT transceiver and an MCU, the sensor, and a battery or rechargeable LiPo cell or similar in it (maybe with inductive or capacitive charging).  With an MPU9250, one might use small magnets or a magnetized iron inner structure in the charger to create a magnetic field defining the Y axis, with horizontal plane being the pan plane, and rotation in it (around a vertical axis) being the zoom.  Acceleration against direction of gravity would change it from input device to stress ball.

The 2-3 optical sensor approach is better in that all the electronics and logic would be in the cradle, and one could use basically any smooth accurate ball of suitable size.  Making the three supports' distance adjustable, would allow adjusting for the ball size a bit.

Apologies for semi-derailing the thread with my own musings!
 

Offline globoy

  • Regular Contributor
  • *
  • Posts: 236
  • Country: us
@RoGeorge - Sorry should have checked if links had rotted as they so often do.  I have a copy of the SDK as well as Brennen's serial bootloader for the LE1 and LU1, and some demos.  But it's all too large to attach here so if you want send me your email in a PM and I'll wetransfer the files to you.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf