Overclock.net - An Overclocking Community - Reply to Topic
Thread: Progress on a fully custom mouse. Reply to Thread
Title:
Message:

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


  Additional Options
Miscellaneous Options

  Topic Review (Newest First)
05-25-2020 05:39 AM
gipetto I didn't make any calculations, I dropped out of school early so don't have a great grasp of circuit design. 22pf seems to be the more common value, perhaps the crystal package on the teensy changes the required load capacitance. some vusb keyboards use a 12mhz crystal so he may have used a different cap size for compatibility with the parts he had on hand.

>those 4.7k resistors
more or less yes. they're actually to increase wetting current to within the specs of the omron switch datasheet. it was an experiment to see if switch life could be extended. there's a conspiracy theory around that says the reason modern mice doubleclick so often is because they use lower switching voltage and less current to blow through the oxide on the switch contacts.
05-24-2020 08:25 PM
TranquilTempest
Quote: Originally Posted by dahomosapien View Post
Thanks for the replies

Regarding the crystal load capacitors - the 2 load capacitors values are 10pf on the Teensy; 20pf on the HSGW Plaid; & 22pf on your mouse. Did you have to make calculations to figure out the correct load capacitance (or am I overthinking)?

Also, what's happening on the left side of the atmega on your schematic, with all of those 4.7k resistors that are also connected to VCC then to the switches? Is that hardware switch debouncing?

Thank you!!
The microcontroller should have a reference implementation in the datasheet or application notes, with the crystal and capacitor values specified.
05-24-2020 06:21 PM
dahomosapien Thanks for the replies

Regarding the crystal load capacitors - the 2 load capacitors values are 10pf on the Teensy; 20pf on the HSGW Plaid; & 22pf on your mouse. Did you have to make calculations to figure out the correct load capacitance (or am I overthinking)?

Also, what's happening on the left side of the atmega on your schematic, with all of those 4.7k resistors that are also connected to VCC then to the switches? Is that hardware switch debouncing?

Thank you!!
05-24-2020 04:08 PM
gipetto If you must know i did it because jlcpcb assembly had a reel change charge for extended components. i forget the exact cost but it was around 3 euro extra. the chinese voltage regulator was also an extended component last time i checked, which was after the plague.
05-24-2020 02:41 PM
qsxcv
Quote: Originally Posted by gipetto View Post
the 49.9Ω & 180Ω resistors added together in parallel give 39.08 ohms, close to the 39ohms of the datasheet. it's often necessary to use multiple components to replace a rare or expensive part.
a 39ohm resistor is neither rare or expensive
but yea if you don't have it on hand, it's indeed annoying to order small quantities from digikey or wherever.


when i replaced 3360 with 3389 in my prototype m1k, i soldered in parallel 2 additional 39ohm resistors to make a 13ohm resistor
05-24-2020 02:35 PM
gipetto the 22pf caps are load capacitors present on every microcontroller crystal. they're rf black magic that i don't understand. if you want to see a simple usb microcontroller device schematic there are lots of keyboards you can examine, such as the voyager series by ai03, plaid by hsgw etc.

the 49.9Ω & 180Ω resistors added together in parallel give 39.08 ohms, close to the 39ohms of the datasheet. it's often necessary to use multiple components to replace a rare or expensive part.

>If I were to make a mouse PCB based off of the Teensy 2.0 & Tindie pwm3360 schematics, would that work?
yes it would. my schematic is based off them, though the voltage regulator was switched out for a chinese domestic part. it's old now and might need to be updated to newer parts in stock.
I modded the code to support the atmel bootloader. I wouldn't advise you to make a mouse pcb if you merely want to do a mod, but you could make your own version of the tindie board with integrated mcu and jst plug. this would reduce weight, size and making wiring simpler while maintaining a good cost:return ratio.
05-24-2020 07:29 AM
dahomosapien Thanks so much for sharing this

I just looked at your schematic, and I am trying to understand it. But I am completely new to this, so my questions are incredibly amateur.

I've been trying to make a custom mouse too, based off the Teensy 2.0 + Tindie pmw3360 mod (just like BTS'). And when I look at the Teensy 2.0 + Tindie pmw3360 schematics vs yours, I don't understand why somethings are different.

For instance - why do you have x2 22pf capacitors connected to the 16mhz crystal? And why do you have 49.9Ω & 180Ω resistors attached to the 3360?

If I were to make a mouse PCB based off of the Teensy 2.0 & Tindie pwm3360 schematics, would that work? I understand that Teensy uses halfkay, but I assume I could use the atmel bootloader.

Thank you
01-05-2020 07:36 AM
gipetto I got a few requests for build instructions from reddit so here goes
This project was built in kicad nightly development edition on linux and files will not open on earlier versions. It's not necessary to install kicad to reproduce the project though, merely to modify it.

Grab the pcb files from here:
https://github.com/itsnoteasy/misc/b...ter/mouse8.zip

grab the firmware here:
https://github.com/itsnoteasy/forgot.../bst_gplv3.zip

If you want to modify the files then you will need to use this python script which generates assembly files compatible with jlcpcb.

https://dubiouscreations.com/2019/10...embly-service/

So, go to this page https://jlcpcb.com/quote#/ and unzip your github file to a folder. then upload the nested gerbers.zip. I suggest using a lead free process and 1.0 mm pcb to reduce weight. Then click on smt assembly and set the quantity to 2, and click on assemble top side, then confirm.

next page upload the mouse8_bom_jlc.csv file and mouse8_cpl_jlc.csv file when asked to, then click next.
if it says confirmed on every component, then click next again, if not you'll have to follow the instructions in the dubiouscreations link and change out the missing part for an alternative.

now check the part rotations on the next page. I lined up the red dot on each symmetrical part with the left of the silkscreen part label. if the red dot is on the other side, you'll need to edit mouse8_cpl_jlc.csv in a text editor and subtract usually -90 from the problem part in a column on far right, then see what it looks like.
so if all is good, then save to cart to avail of any discounts, then order, choose the cheapest shipping too if you're not ridiculously wealthy. even on the cheapest postage packages arrive in 3 weeks to ireland. they're posted from germany which avoids customs charges.

parts you'll need
a hc-49U vertical 16.000mhz crystal or similar. you could save some money here by using an smt part but not a lot.
a jst ph 2.0 header. I bought a box of assorted types from aliexpress which was the cheapest for me. you can solder a cable directly if you want.
a g203/g102 replacement usb cable. this is pin compatible with the pcb.
3mm dim led, red colour ideally. using an ultrabright will exceed the pin current causing damage.
Button_Switch_SMD:SW_SPST_TL3342 you only need to use this once, so you can skip this and short the pads out with wire.
pmw3360 ic with lens(aliexpress). if you're handy you could pull one from another mouse, pmw3366 isn't compatible without rewriting the source code.
I like to use a selection of d2f-01f and d2fc-f7n for switches because they differ in height which can be useful when you need to adjust button actuation. sometimes i'll use shims underneath the switches or file down their bases.
a 7mm ec10 encoder of your choice. I have used cut down 11mm alps(abc legs folded over) but they don't match well to allen keys. I've had better results with ttc.
a shell and scroll wheel, also screws and mouse feet. avoid the wheels that are used in the hongsund io1.1, they lack the hole up the center and break the hex spline easily anyway. the shell is excellent though, durable, if heavier than the original.
1/16(ttc) or 5/64(alps) allen keys.
electric hand drill.
hacksaw.
sidecutters, metal files.

the crystal doesn't have a polarity, just solder it in. the silkscreen will prevent it from shorting out.
for the led, the negative, or cathode is the short leg. r7 is on the cathode leg. then solder it in.
jst pinout from right click button to left click button direction is shield(not connected), GND, VCC, D-, D+

I like to check the mcu is working before i solder in the 3360. so, to start with solder in the left and right click switches. then plug in the jst cable, assuming the jst socket is soldered in the correct orientation. then using a wire short the contact of the bootloader button twice to be sure with two seconds in between. Be sure to check the pmw3360 datasheet to discover the correct orientation. 3360 ic pin1 is on the right click button side of the pcb.

type in
dfu-programmer atmega32u4 erase --force [enter]

or if that doesn't work type in:
dfu-programmer atmega32u4 erase [enter]
dfu-programmer atmega32u4 flash bst3360.hex [enter]

then unplug and replug and you should have sensor response. Next use a metal file to mill out the base of the bottom cover to accept the lens. if you get fed up, at least get it level. then file the extrusion off the lens perimeter without damaging the lens. then drill a hole in the shell base so the lens can look through it. This allows the lift off distance to be reduced. ideal distance is 2.4mm to surface.

Disassembly of an io1.1 shell tends to break the side button hinges. to prevent this us a side cutters to cut a right angle from the forward vertical strut in the base immediately in front of where the hinge sits. cut in horizontally and cut down vertically on both sides to protect both buttons. this is the strut that breaks the hinges.

When drilling the mouse wheel for an allen key, mount the wheel in the drill chuck, and hold a drill bit in a hand pliers. in this way the drill bit self centers and will be in line. It's also helpful to hacksaw the allen key and wheel while it is rotating to ensure a square cut.

to enter bootloader mode, hold right click while plugging in the usb cable. there is a #define in main.c which changes the bootloader jump address, it is currently set for atmel-dfu.

If the primary switches bottom out you can remove any obstructing plastic with a sidecutters, and prop up the pcb to your liking by putting a ball of solder on the outer front switch pins.
01-04-2020 04:00 AM
gipetto I flashed an arduino sketch to test each button pin by flashing an led. it turns out all the f port pins on both pcbs are non functional, so that's why hardware debouncing is inoperative. I'm wondering if jlcpcb screwed up or edited the design without my knowledge, because the schematic looks perfect. I took my multimeter and there's continuity between all the f port pins, when they should be isolated from each other.

the schematic says portF is used for jtag. maybe the bootloader has activated it somehow.

edit: disabled jtag and all's good now. strange i've never seen the fix in the code before. I'll put it on the github in case anyone has the same problem.
01-02-2020 01:05 PM
gipetto just got it running after hammering an allen key through the alps encoder. my firmware doesn't run for some reason but i made it backward compatible with bst_public. job for another day. it's lighter than my fk1+ now.
This thread has more than 10 replies. Click here to review the whole thread.

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