reverse engineering 3366 - Page 35 - Overclock.net - An Overclocking Community
Forum Jump: 

reverse engineering 3366

Reply
 
Thread Tools
post #341 of 438 (permalink) Old 07-04-2017, 05:03 PM - Thread Starter
lololol
 
qsxcv's Avatar
 
Join Date: Feb 2014
Posts: 4,289
Rep: 371 (Unique: 153)
Quote:
Originally Posted by neoN- View Post

Hey boys,

I'm sorry but I dont wanna read the whole thread frown.gif

Sooo, you can actually edit the surface calibration manually? Is there anyway to higher the LOD with that?
My tracking stops so often cuz I lift my mouse too early (I'm used to higher LOD)

Thanks in advance! smile.gif

iirc the surface calibration registers can only lower lod

but there's another one which raises the lod from 2mm (default) to 3mm

too busy to check forums as regularly
pm me if i forget to respond
qsxcv is offline  
Sponsored Links
Advertisement
 
post #342 of 438 (permalink) Old 07-09-2017, 05:05 PM
New to Overclock.net
 
gipetto's Avatar
 
Join Date: Jun 2017
Posts: 550
Rep: 12 (Unique: 9)
https://yadi.sk/d/fAuWBnWP3KtmV6

I modified the example sketch that is on the pmw3360 website to add 3 pin hardware debounced buttons and mechanical scroll and mouse code. It compiles ok for pro micro but I have no hardware to test on, give it a few weeks and I may order one. I guess some of you not fond of avrdude may be waiting to try this out. this is not an easy install as it needs voltage level converters.

https://www.tindie.com/products/jkicklighter/pmw3360dm-t2qu-motion-sensor/
gipetto is offline  
post #343 of 438 (permalink) Old 08-23-2017, 06:14 PM
New to Overclock.net
 
thebeephaha's Avatar
 
Join Date: Jun 2013
Posts: 20
Rep: 0
Quote:
Originally Posted by bst View Post

Little update to my project ;D
I managed to connect all buttons + scroll wheel, and solder in the USB plug to the mouse cable. So that part is all done, now just got to figure out how to make the buttons actually do things biggrin.gif

How are you getting on @thebeephaha?

Been busy with some other projects - how'd this work out for you?
thebeephaha is offline  
Sponsored Links
Advertisement
 
post #344 of 438 (permalink) Old 08-30-2017, 07:31 PM
bst
Hardware Rep
 
bst's Avatar
 
Join Date: Sep 2011
Posts: 906
Rep: 92 (Unique: 50)
Quote:
Originally Posted by thebeephaha View Post

Been busy with some other projects - how'd this work out for you?

Pretty well, had some help from qsxcv for the buttons, all working now. I added some features like a menu when you hold down the DPI button, so you can choose DPI / LOD / Angle snapping. I've attached it so you can take a look.

You could upgrade almost any mouse with this, but its better if the mouse has a 9800 sensor (same lens size) and a mechanical encoder.

bst3360_public.zip 196k .zip file
Attached Files
File Type: zip bst3360_public.zip (195.9 KB, 137 views)
bst is offline  
post #345 of 438 (permalink) Old 08-31-2017, 01:10 AM
New to Overclock.net
 
gipetto's Avatar
 
Join Date: Jun 2017
Posts: 550
Rep: 12 (Unique: 9)
Could that be slightly modified to a firmware upgrade so the mcu wouldn't need to be replaced? I assume the pinouts would be different on a commercial 3360 mouse. Good work nonetheless
Quote:
Originally Posted by bst View Post

Pretty well, had some help from qsxcv for the buttons, all working now. I added some features like a menu when you hold down the DPI button, so you can choose DPI / LOD / Angle snapping. I've attached it so you can take a look.

You could upgrade almost any mouse with this, but its better if the mouse has a 9800 sensor (same lens size) and a mechanical encoder.

bst3360_public.zip 196k .zip file
gipetto is offline  
post #346 of 438 (permalink) Old 08-31-2017, 01:55 AM
bst
Hardware Rep
 
bst's Avatar
 
Join Date: Sep 2011
Posts: 906
Rep: 92 (Unique: 50)
Quote:
Originally Posted by gipetto View Post

Could that be slightly modified to a firmware upgrade so the mcu wouldn't need to be replaced? I assume the pinouts would be different on a commercial 3360 mouse. Good work nonetheless

Not that I know of.

For most mice, the idea would be to cut away the old sensor, and leave the buttons/scroll wheel part of the mouse. Then you can connect them up to the teensy, and put the 3360 board in the gap cut out of the PCB. I would keep the ports the same btw, it works well the way it is.

You only need to connect the ground to one of the ground pins on a switch, just make sure the ground plane can reach all the other switches ground pins and it'll be fine.

Its a pretty easy mod really, as long as you have the tools, which is basically soldering stuff, wires, and a dremel.
bst is offline  
post #347 of 438 (permalink) Old 08-31-2017, 02:03 AM
New to Overclock.net
 
gipetto's Avatar
 
Join Date: Jun 2017
Posts: 550
Rep: 12 (Unique: 9)
I understand. I had read this link and while I didn't understand it I assumed since the firmware was modified there were no restrictions on what to upload. If you like you could take a look. https://hackaday.com/2017/07/29/injecting-code-into-mouse-firmware-should-be-your-next-hack/
gipetto is offline  
post #348 of 438 (permalink) Old 08-31-2017, 02:27 AM
bst
Hardware Rep
 
bst's Avatar
 
Join Date: Sep 2011
Posts: 906
Rep: 92 (Unique: 50)
Well, ofc its possible to rewrite an unlocked MCU, but if its not an Atmega MCU, then there will be more differences than just the pinouts. So you have to look at how to program the specific MCU (recreate the same thing for a different MCU). Also if it doesn't use the 3360 (or variant of it), you also have to change things for the specific sensor as well.

But TBH I'm no expert, I'm new to this, so I doubt I could be much help biggrin.gif
bst is offline  
post #349 of 438 (permalink) Old 08-31-2017, 10:28 AM
New to Overclock.net
 
gipetto's Avatar
 
Join Date: Jun 2017
Posts: 550
Rep: 12 (Unique: 9)
I wouldn't think anyone who can handle assembly language is new to mouse modding. the stm32 seems to be common among hackers and in mouses themselves.
gipetto is offline  
post #350 of 438 (permalink) Old 09-05-2017, 03:31 AM
bst
Hardware Rep
 
bst's Avatar
 
Join Date: Sep 2011
Posts: 906
Rep: 92 (Unique: 50)
Thought I'd write a guide:
(it will only work with this FW: https://www.overclock.net/t/1561041/reverse-engineering-3366/300_100#post_26314321)

If you just want to use the FW as is, you just need to connect the pins as so:



3360 NCS (SS): PB0
3360 SCLK (SC): PB1
3360 MOSI (MO): PB2
3360 MISO (MI): PB3
3360 NRESET (RS): No need to connect
Wheel B: PC6 (wheel up)
Wheel A: PC7 (wheel down)
Left button: PD0
Right button: PD1
Wheel button: PD2
Back side button: PD3
Forwards side button: PD4
DPI button: PD5
Don't forget the ground and power connections. There are 2 VCC and 2 GND on the teensy, doesn't matter which ones you use. You will need VCC and GND to go to the 3360, and GND to go to the ground plane for the switches (ie. connect GND to a ground pin on one of the switches, and that pin will be connected to the ground plane). Just be sure the ground plane goes to all the switches and there isn't a gap somewhere, if there is a gap, then you need to use a wire to bridge that gap (which will be a wire going from either GND on the teensy or a switch GND pin that has a GND connection, to the GND pin on the switch that isn't connected to GND).

Connecting the USB plug:
This is the most fiddly part of the whole thing. This is the connector I use: http://www.ebay.co.uk/itm/262814319020
Take a cable from another mouse, or get a paracord.
Heres how I connected it, looking at the back of the connector, from left to right, top to bottom:
Top 1: No connection
Top 2: White, (D-)
Bottom 1: Black shiny (GND) (Don't connect SHIELD to this! Usually it has a matte black cable sleeve, just snip it off as it won't be needed)
Bottom 2: Green (D+)
Bottom 3: Red (5V)


Be very careful and make sure there are no short circuits, I'm pretty sure short circuiting 5V and GND would cause irreparable damage to your mobo.

Then:
1) Download the Teensy Loader from here: https://www.pjrc.com/teensy/loader.html
2) Now follow the instructions: https://www.pjrc.com/teensy/loader_win10.html

If you want to edit the FW, then you can just use something like notepad++ to edit the main.c file. To compile it, you should use the AVR GCC toolchain. For this you will have to use Linux because the windows version is too old. Its not really a big deal though.

1) Download Oracle VM Virtualbox from here: https://www.virtualbox.org/
2) Follow instructions here to install Ubuntu: https://askubuntu.com/questions/142549/how-to-install-ubuntu-on-virtualbox
3) Once thats all done, load up Ubuntu and follow these instructions to install the AVR GCC Toolchain: http://maxembedded.com/2015/06/setting-up-avr-gcc-toolchain-on-linux-and-mac-os-x/
4) Now, all you have to do is transfer your code into the shared folder, then, in ubuntu, go to the shared folder (the one that has your main.c etc inside), right click and then click on open terminal in this folder. Once the terminal comes up, just type "make" without the quotes, and it'll compile your code. Then you'll have a hex file which you can use with the teensy loader.

The FW is coded to allow you enable bootloader mode by holding down the DPI button when plugging in the mouse, so you don't have to keep opening the mouse up and pressing the button on the teensy.
Its this bit, so don't remove it if you want to keep that functionality:
Code:
// if dpi button is pressed when plugging in, jump to bootloader
        // see https://www.pjrc.com/teensy/jump_to_bootloader.html
        delay_ms(50);
        if (!(PIND & (1<<5)))
                __asm__ volatile ("jmp 0x7e00");


Hope that helps!
bst is offline  
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the Overclock.net - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off