Author Topic: Help with prototype mouse - reward  (Read 3587 times)

0 Members and 1 Guest are viewing this topic.

Offline lucid-nonsense

  • Thread Starter
  • Posts: 4
Help with prototype mouse - reward
« on: Tue, 23 November 2021, 08:37:10 »
Hello Overclockers,
I'm trying to design a custom mouse. I had an electronics engineer design the PCB and had them printed by PCBWAY. It uses the PixArt PMW3360 sensor and a NXP lpc11u3x MCU.

The printed board​

However, when I plug it in, I get an error message saying the device was not recognized. No LED light up.


The engineer had me jumper contact JP1, no change.



He had me check some voltages: 1. With the (-) lead at the black circle and the (+) lead at top red box(T3V3), the value was 3.29
2. With the (-) lead at the black circle and the (+) lead at bottom red box (T1V9) the value was 1.92


and:


3. With the (-) lead at black circle (TAG1), and positive lead at red circle(TU5V1), the value was 5.06.
The engineer says: "What you don't have is software for the NXP Microcontroller. The microcontroller has a usb block that should be communicating to windows via a driver.
It should inherently do this.
Once communication is achieved the microcontroller will need to be programmed to talk to the PixArt sensor.


You can see here, these are the two data lines that go from your computer to the MU
We checked TU5V1 against TAG1, and that looked good


This is where they connect at the MCU
What I am looking for are ambiguities. The hardware looks good, but there may need to be something we do in software to either get the driver to talk to the MCU or get the MCU to talk to the driver. "

I wrote to pixart, who replied: "From our understanding, the situation you are facing seems to have nothing to do with PixArt's sensor itself. Note that PMW3360 is purely a sensor that reports on delta X and delta Y values, with no USB driver inside. So for your Windows to recognize the 3360+PCB as a mouse device, you will need to have the relevant HID driver installed first."Is it that simple? I looked for some HID drivers but I'm not too sure what to look for?
Any help would be appreciated, and thank you for your time.

Since I'm doing this for money and not as a hobby, there will be a reward for anyone who can help diagnose and/or fix the problem.

Thanks!
« Last Edit: Tue, 23 November 2021, 10:10:19 by lucid-nonsense »

Offline vvp

  • Posts: 887
Re: Help with prototype mouse - reward
« Reply #1 on: Tue, 23 November 2021, 09:04:10 »
The image sensor engineer is right. Your problem is in the MCU or the firmware you loaded on the MCU.

The best way to check that the MCU physically works is connect a debugger to it. It MCU can announce itself (and its type) to the debugger then it is likely the MCU is correctly running. This is likely the case since your HW engineer told you to verify voltages and you did it and hey were right. But a better way to test this is with debugger.

That leaves the MCU firmware as the reason for the problem.

Yeah, and if you schematic is the same as the same as your hardware then you have a bug in hardware design. The pull up resistor R2 should be 1.5 kOhm and not only 33 Ohm. That resistor is used together with USB_CON pin to announce to the host that an USB device is present and that it is full speed (in your case since connected to D+). If the device does not indicate its presence correctly then the host (PC) will not detect it even if the device firmware is otherwise good.

EDIT: Sometimes R2 does not need to be external and is built-in in the MCU. I did not check what is the situation with your particular MCU type.
« Last Edit: Tue, 23 November 2021, 09:05:51 by vvp »

Offline lucid-nonsense

  • Thread Starter
  • Posts: 4
Re: Help with prototype mouse - reward
« Reply #2 on: Tue, 23 November 2021, 09:14:47 »
Thanks a lot for your reply.

Sorry, I really don't know much about electronics. So I need custom firmware for the MCU? I also have no idea how to load it. I tried reading the MCU datasheet but I was just completely baffled.

What kind of debugger do I need.

Could you write the firmware and show me how to load it? I would pay you.

Thanks again!

Offline Applet

  • Posts: 492
  • Location: Sweden
Re: Help with prototype mouse - reward
« Reply #3 on: Tue, 23 November 2021, 09:28:28 »
Unfortunately, the MCU is not compatible with QMK (the most popular keyboard firmware that's also used in some computer mice), otherwise you could have used that. If you only have a hardware design, you'll need to write and flash the software for it to be able to act as a mouse. If there is no software flashed to the microcontroller, it won't do anything. (tho if using open source stuff, you NEED to check the licence)

I'm a bit curious about the shape, is it to be circular with no buttons? Or is this some kind of dev-board?

I'd recommend to not post name of the person who designed this publicly like this (and yours I assume), the internet can be a weird place.
« Last Edit: Tue, 23 November 2021, 09:57:25 by Applet »

Offline vvp

  • Posts: 887
Re: Help with prototype mouse - reward
« Reply #4 on: Tue, 23 November 2021, 09:42:05 »
By debugger I mean JTAG or SWD hardware debugger which is used to program and debug NXP Cortex M0 MCUs (the one you have used). For example I use ST-Link for STM MCUs. It would likely work with NXP too, but a better idea is to use some recommended by NXP.

Somebody should have loaded firmware on the MCU. It is very unlikely that you would have bought some special MCU preloaded with the firmware which is just right for your HW application (i.e. some kind of mouse). But if that is the case then maybe just fixing that R2 resistor may make it work. It definitely cannot work if D+ line is pulled up to 3.3V through only 33 Ohm resistor. Though it might work if your MCU has this pull-up functionality internally and the external R2 is not used. Who did your HW again when he put a wrong resistor in the schematic? Just to know who to avoid? Don't worry, just kidding. Mistakes happen.

If you do not have any idea about the firmware needed then you just forgot to budget for one of the major (and possibly the biggest) parts in your project. It may be anywhere from about 2 man-weeks up to many man-months depending on what you want and what libraries are already available and what licenses are acceptable for the final (possibly commercial) use.

I could write the firmware but it would be too expensive. Try to find somebody cheaper.

Offline lucid-nonsense

  • Thread Starter
  • Posts: 4
Re: Help with prototype mouse - reward
« Reply #5 on: Tue, 23 November 2021, 10:43:16 »
Unfortunately, the MCU is not compatible with QMK (the most popular keyboard firmware that's also used in some computer mice), otherwise you could have used that. If you only have a hardware design, you'll need to write and flash the software for it to be able to act as a mouse. If there is no software flashed to the microcontroller, it won't do anything. (tho if using open source stuff, you NEED to check the licence)

Okay, thanks a lot, I really don't know much about electronics.

Quote
I'm a bit curious about the shape, is it to be circular with no buttons? Or is this some kind of dev-board?
The buttons will be on the end of wires, on a handle.

Quote
I'd recommend to not post name of the person who designed this publicly like this (and yours I assume), the internet can be a weird place.
Thanks, you're right, I removed it.

Quote
It definitely cannot work if D+ line is pulled up to 3.3V through only 33 Ohm resistor. Though it might work if your MCU has this pull-up functionality internally and the external R2 is not used. Who did your HW again when he put a wrong resistor in the schematic? Just to know who to avoid? Don't worry, just kidding. Mistakes happen.

Yeah, this is the guy I hired to check the work of the first person I hired... Oh well, at least that shouldn't be too hard to fix. Thanks a lot.

Quote
If you do not have any idea about the firmware needed then you just forgot to budget for one of the major (and possibly the biggest) parts in your project. It may be anywhere from about 2 man-weeks up to many man-months depending on what you want and what libraries are already available and what licenses are acceptable for the final (possibly commercial) use.

Thanks, I thought that since it was plug ang play, I didn't need any special software. The electronics engineer should've told me that though!

I found another mouse that uses the same MCU, if I got the firmware for that, would it make writing the code faster?


Offline vvp

  • Posts: 887
Re: Help with prototype mouse - reward
« Reply #6 on: Tue, 23 November 2021, 16:14:45 »
Thanks, I thought that since it was plug ang play, I didn't need any special software. The electronics engineer should've told me that though!
I found another mouse that uses the same MCU, if I got the firmware for that, would it make writing the code faster?
Yes, the electronics engineer should have tell you that you need also firmware on the MCU. Well, maybe he was under impression that you know that and have a different person to take care of it. EDIT: Meybe the electronics engineer thought that the MCUs you ordered have firmware preloaded for just the HW he designed. It is very unlikely but may happen.

If you have a mouse firmware which works on the MCU and the license of the firmware is acceptable and you have the source code of the firmware then that would help a lot. But it may not be such a problem even if you want to use a firmware originally intended for a diffrenet MCU. E.g. a friend of my ported ATmega firmware to ATxmega firmware in about a day. Other hardware design details than only the MCU selection may have even bigger impact (e.g. what sensors are used and what communication protocols the sensors require). On the other side, if your HW design is almost the same as the design used by the firmware you have than it could be loaded without modification. In such an unlikely case it can be only a day or few days of work. The work would be mostly only to verify that the HW design is the same to a sufficient degree.

Plug and play in this case means that you do not need a PC driver for your mouse (if the mouse firmware only implements USB mouse specification without extensions). But the device (i.e. your mouse) still needs a firmware inside. Firmware is a name for a software which runs inside a device (e.g. a mouse).
« Last Edit: Tue, 23 November 2021, 16:19:48 by vvp »

Offline lucid-nonsense

  • Thread Starter
  • Posts: 4
Re: Help with prototype mouse - reward
« Reply #7 on: Tue, 23 November 2021, 16:32:38 »
Thanks a lot, that was very clear. I knew electronics needed firmware, I just didn't realize the firmware had to be custom to the board! Embarrassing! Oh well, it's not skydiving, I don't have to get it right the first time.
« Last Edit: Tue, 23 November 2021, 16:38:23 by lucid-nonsense »