├── README.md ├── driver_pcb_0.1 ├── README.md ├── avr-isp-6.bak ├── avr-isp-6.dcm ├── avr-isp-6.lib ├── avr.pretty │ └── pin_array_3x2.kicad_mod ├── fp-lib-table ├── gerbrename.sh ├── lipocharge-cache.lib ├── lipocharge.bak ├── lipocharge.kicad_pcb ├── lipocharge.net ├── lipocharge.pro ├── lipocharge.sch ├── mcp73831.bak ├── mcp73831.bck ├── mcp73831.dcm ├── mcp73831.lib └── soic8.pretty │ └── SO8E.kicad_mod ├── driver_pcb_1.0 ├── README.md ├── avr-isp-6.bak ├── avr-isp-6.dcm ├── avr-isp-6.lib ├── avr.pretty │ └── pin_array_3x2.kicad_mod ├── fp-lib-table ├── gerbrename.sh ├── lipocharge-cache.lib ├── lipocharge.bak ├── lipocharge.kicad_pcb ├── lipocharge.kicad_pcb-bak ├── lipocharge.net ├── lipocharge.pro ├── lipocharge.sch ├── mcp73831.bak ├── mcp73831.bck ├── mcp73831.dcm ├── mcp73831.lib └── soic8.pretty │ └── SO8E.kicad_mod ├── driver_pcb_2.0 ├── 2x2.kicad_pcb ├── 2x2.kicad_pcb-bak ├── 2x2.pro ├── README.md ├── avr-isp-6.bak ├── avr-isp-6.dcm ├── avr-isp-6.lib ├── avr.pretty │ └── pin_array_3x2.kicad_mod ├── fiducial.pretty │ └── Fiducial_1mm_Dia_2.54mm_Outer_CopperTop.kicad_mod ├── fp-lib-table ├── gerbrename.sh ├── goodwatch │ ├── goodwatch21.bak │ ├── goodwatch21.bck │ ├── goodwatch21.dcm │ ├── goodwatch21.lib │ └── goodwatch21.pretty │ │ ├── 0433bm15a0001.kicad_mod │ │ ├── CC430F513x.kicad_mod │ │ ├── CC430F613x.kicad_mod │ │ ├── FA128.kicad_mod │ │ ├── YageoS432.kicad_mod │ │ ├── ca53board.kicad_mod │ │ ├── ca53keypad.kicad_mod │ │ ├── ca53lcd.kicad_mod │ │ └── sot-563.kicad_mod ├── lipocharge-cache.lib ├── lipocharge.bak ├── lipocharge.kicad_pcb ├── lipocharge.kicad_pcb-bak ├── lipocharge.net ├── lipocharge.pro ├── lipocharge.sch ├── mcp73831.bak ├── mcp73831.bck ├── mcp73831.dcm ├── mcp73831.lib ├── ncp170.dcm ├── ncp170.lib ├── outline.pretty │ ├── 18mm.kicad_mod │ ├── module.kicad_mod │ └── panel.kicad_mod ├── passives.pretty │ ├── C_0201_NoSilk.kicad_mod │ ├── C_0402.kicad_mod │ ├── C_0402_NoSilk.kicad_mod │ ├── Magnet_2mm.kicad_mod │ ├── R_0201_NoSilk.kicad_mod │ ├── R_0402_NoSilk.kicad_mod │ └── small_hole.kicad_mod ├── rotunda.pretty │ ├── rotunda.kicad_mod │ └── rotunda_base.kicad_mod ├── soic8.pretty │ └── SO8E.kicad_mod ├── sot.pretty │ └── sot-563.kicad_mod └── sym-lib-table ├── gen ├── pathtogcode │ ├── microball │ │ ├── cutting-.9mm.path │ │ ├── cutting-1mm.path │ │ ├── grooves-old.path │ │ └── grooves.path │ ├── microball_center_holes.ngc │ ├── microball_center_holes.py │ ├── microball_cuts.ngc │ ├── microball_cuts.py │ ├── microball_grooves.ngc │ ├── microball_grooves.py │ ├── microball_jig.ngc │ ├── microball_jig.py │ ├── microball_jig │ │ ├── circles.path │ │ ├── outline.path │ │ └── zigzag.path │ ├── microball_jig_holes.ngc │ ├── microball_jig_holes.py │ ├── pathtogcode.py │ └── svgpath.py └── pathtokicad │ ├── microball.mod │ ├── microball.py │ ├── microball │ ├── copper_bottom.path │ ├── copper_top.path │ ├── mask_bottom.path │ ├── mask_top.path │ └── paste.path │ ├── pathtokicad.py │ ├── svgpath.py │ ├── uball.py │ └── uball │ ├── copper_bottom.path │ ├── copper_top.path │ ├── mask_bottom.path │ ├── mask_top.path │ └── uball.mod ├── mini_pcb ├── footprints.pretty │ ├── 3mm_hole.kicad_mod │ └── microball.kicad_mod ├── fp-lib-table ├── gerb │ ├── miniball.GBL │ ├── miniball.GBO │ ├── miniball.GBS │ ├── miniball.GKO │ ├── miniball.GTL │ ├── miniball.GTO │ ├── miniball.GTP │ ├── miniball.GTS │ └── miniball.TXT ├── gerbrename.sh ├── microball.mod ├── miniball.kicad_pcb ├── miniball.kicad_pcb-bak ├── miniball.pro ├── miniball.sch ├── miniball.zip └── miniball │ ├── miniball.GBL │ ├── miniball.GBO │ ├── miniball.GBS │ ├── miniball.GKO │ ├── miniball.GTL │ ├── miniball.GTO │ ├── miniball.GTS │ └── miniball.TXT ├── openscad ├── ballbase.scad ├── ballbase.stl ├── ballbase20mm.scad ├── ballbase20mm.stl ├── ballbase20mm_driver2.scad ├── balldome.scad ├── balldome.stl ├── balldome2.scad ├── balldome2.stl ├── balldome3.scad ├── balldome3.stl ├── balldome_2.stl ├── balldome_msp.scad ├── balldome_new.scad ├── balldome_new.stl ├── balldome_new_base.scad ├── balldome_new_base.stl ├── balldome_new_hold.scad ├── balldome_new_hold.stl ├── driver.scad ├── egg.scad ├── eggshell.scad ├── eggshell20mm.scad ├── eggshell25.scad └── switch.scad ├── pics ├── README.md ├── ball.jpg ├── cnc.jpg ├── driver.jpg ├── eur5ct.JPG ├── folded.jpg ├── folded_big.jpg ├── leds_on.jpg ├── miniball.jpg ├── uball.jpg └── vcc_connected.jpg ├── src ├── avrrc │ ├── Makefile │ ├── avrrc.py │ ├── avrrc2812-20.S │ ├── avrrc2812-old.S │ ├── avrrc2812-v2.S │ ├── avrrc2812.S │ ├── intelhex.py │ ├── virt.py │ └── ws2812.py ├── msp2812 │ ├── Makefile │ ├── README.md │ ├── ball.c │ ├── ball.elf │ ├── ball.hex │ ├── bin │ │ └── cc430-bsl.py │ ├── config.h │ ├── configdefault.h │ ├── dmesg.c │ ├── dmesg.h │ ├── gamma_map.c │ ├── gamma_map.h │ ├── gamma_map.py │ ├── lipo.c │ ├── lipo.h │ ├── memory.x │ ├── monitor.c │ ├── monitor.h │ ├── msp2812.txt │ ├── msp430.x │ ├── packet.c │ ├── packet.h │ ├── periph.x │ ├── power.c │ ├── power.h │ ├── radio.c │ ├── radio.h │ ├── ref.c │ ├── ref.h │ ├── rgbwaves.c │ ├── rgbwaves.h │ ├── transmit.c │ ├── transmit.h │ ├── tx_tick.c │ ├── uart.c │ ├── uart.h │ ├── ucs.c │ ├── ucs.h │ ├── ws2812.c │ └── ws2812.h └── tiny2812 │ ├── Makefile │ ├── README.md │ ├── ani_test.c │ ├── example_ani.c │ ├── example_ani.elf │ ├── example_ani.hex │ ├── example_fire_miniball.c │ ├── example_fire_miniball_2.c │ ├── example_uball.c │ ├── example_uball.hex │ ├── example_vcc.c │ ├── example_vcc.hex │ ├── flashloop.sh │ ├── gamma_map.c │ ├── gamma_map.h │ ├── gamma_map.py │ ├── testfire │ ├── calcpos.py │ ├── colortab.py │ ├── fire.py │ └── sync.py │ ├── tiny2812.c │ └── tiny2812.h ├── svg ├── mini_design.svg ├── mini_reduced.svg ├── u_design.svg └── u_reduced.svg └── uball_pcb ├── footprints.pretty └── 3mm_hole.kicad_mod ├── fp-lib-table ├── gerbrename.sh ├── microball.mod ├── uball.kicad_pcb ├── uball.kicad_pcb-bak ├── uball.mod ├── uball.pro ├── uball.sch ├── uball.zip └── uball ├── uball.GBL ├── uball.GBS ├── uball.GKO ├── uball.GTL ├── uball.GTS └── uball.TXT /README.md: -------------------------------------------------------------------------------- 1 | 2 | Miniball 3 | ======== 4 | 5 | Foldable PCB LED ball 6 | 7 | ![ball](pics/ball.jpg) 8 | 9 | -------------------------------------------------------------------------------- /driver_pcb_0.1/README.md: -------------------------------------------------------------------------------- 1 | driverpcb 2 | ========= 3 | 4 | Circuit adapted from 5 | 6 | http://blog.zakkemble.co.uk/a-lithium-battery-charger-with-load-sharing/ 7 | -------------------------------------------------------------------------------- /driver_pcb_0.1/avr-isp-6.bak: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 Date: Fri 10 Apr 2015 02:00:14 PM CEST 2 | #encoding utf-8 3 | # 4 | # AVR-ISP-6 5 | # 6 | DEF AVR-ISP-6 CON 0 40 Y Y 1 F N 7 | F0 "CON" -80 240 50 H V C CNN 8 | F1 "AVR-ISP-6" -240 -230 50 H V L BNN 9 | F2 "AVR-ISP-6" -520 40 50 V I C CNN 10 | F3 "~" 0 0 60 H V C CNN 11 | DRAW 12 | T 0 -290 5 45 0 0 0 SCK Normal 1 C C 13 | T 0 300 110 45 0 0 0 VCC Normal 1 C C 14 | T 0 310 -105 45 0 1 0 GND Normal 1 C C 15 | T 0 -308 102 45 0 1 0 MISO Normal 1 C C 16 | T 0 332 -2 45 0 1 0 MOSI Normal 1 C C 17 | T 0 -290 -100 45 0 1 0 RST Normal 1 C C 18 | S -180 -140 190 -160 0 1 0 F 19 | S -180 200 180 180 0 1 0 F 20 | S -175 -160 -195 -40 0 1 0 F 21 | S -175 200 -195 40 0 1 0 F 22 | S 180 200 200 -160 0 1 0 F 23 | X ~ 1 -150 100 100 R 40 40 1 1 P 24 | X ~ 2 150 100 100 L 40 40 1 1 P 25 | X ~ 3 -150 0 100 R 40 40 1 1 P 26 | X ~ 4 150 0 100 L 40 40 1 1 P 27 | X ~ 5 -150 -100 100 R 40 40 1 1 P 28 | X ~ 6 150 -100 100 L 40 40 1 1 P 29 | ENDDRAW 30 | ENDDEF 31 | # 32 | #End Library 33 | -------------------------------------------------------------------------------- /driver_pcb_0.1/avr-isp-6.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 Date: Sun 12 Apr 2015 02:33:30 PM CEST 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_0.1/avr-isp-6.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 Date: Sun 12 Apr 2015 02:33:30 PM CEST 2 | #encoding utf-8 3 | # 4 | # AVR-ISP-6 5 | # 6 | DEF AVR-ISP-6 CON 0 40 Y Y 1 F N 7 | F0 "CON" -80 240 50 H V C CNN 8 | F1 "AVR-ISP-6" -240 -230 50 H V L BNN 9 | F2 "AVR-ISP-6" -520 40 50 V I C CNN 10 | F3 "~" 0 0 60 H V C CNN 11 | DRAW 12 | T 0 -290 5 45 0 0 0 SCK Normal 1 C C 13 | T 0 300 110 45 0 0 0 VCC Normal 1 C C 14 | T 0 310 -105 45 0 1 0 GND Normal 1 C C 15 | T 0 -308 102 45 0 1 0 MISO Normal 1 C C 16 | T 0 332 -2 45 0 1 0 MOSI Normal 1 C C 17 | T 0 -290 -100 45 0 1 0 RST Normal 1 C C 18 | S -180 -140 190 -160 0 1 0 F 19 | S -180 200 180 180 0 1 0 F 20 | S -175 -160 -195 -40 0 1 0 F 21 | S -175 200 -195 40 0 1 0 F 22 | S 180 200 200 -160 0 1 0 F 23 | X ~ 1 -150 100 100 R 40 40 1 1 P 24 | X ~ 2 150 100 100 L 40 40 1 1 P 25 | X ~ 3 -150 0 100 R 40 40 1 1 P 26 | X ~ 4 150 0 100 L 40 40 1 1 P 27 | X ~ 5 -150 -100 100 R 40 40 1 1 P 28 | X ~ 6 150 -100 100 L 40 40 1 1 P 29 | ENDDRAW 30 | ENDDEF 31 | # 32 | # AVR-ISP-6-new 33 | # 34 | DEF AVR-ISP-6-new CON 0 40 Y Y 1 F N 35 | F0 "CON" -80 240 50 H V C CNN 36 | F1 "AVR-ISP-6-new" -240 -230 50 H V L BNN 37 | F2 "AVR-ISP-6" -520 40 50 V I C CNN 38 | F3 "~" 0 0 60 H V C CNN 39 | DRAW 40 | T 0 -290 5 45 0 0 0 SCK Normal 1 C C 41 | T 0 300 110 45 0 0 0 VCC Normal 1 C C 42 | T 0 310 -105 45 0 1 0 GND Normal 1 C C 43 | T 0 -308 102 45 0 1 0 MISO Normal 1 C C 44 | T 0 332 -2 45 0 1 0 MOSI Normal 1 C C 45 | T 0 -290 -100 45 0 1 0 RST Normal 1 C C 46 | S -180 -140 190 -160 0 1 0 F 47 | S -180 200 180 180 0 1 0 F 48 | S -175 -160 -195 -40 0 1 0 F 49 | S -175 200 -195 40 0 1 0 F 50 | S 180 200 200 -160 0 1 0 F 51 | X ~ 1 -150 100 100 R 40 40 1 1 P 52 | X ~ 2 150 100 100 L 40 40 1 1 P 53 | X ~ 3 -150 0 100 R 40 40 1 1 P 54 | X ~ 4 150 0 100 L 40 40 1 1 P 55 | X ~ 5 -150 -100 100 R 40 40 1 1 P 56 | X ~ 6 150 -100 100 L 40 40 1 1 P 57 | ENDDRAW 58 | ENDDEF 59 | # 60 | #End Library 61 | -------------------------------------------------------------------------------- /driver_pcb_0.1/avr.pretty/pin_array_3x2.kicad_mod: -------------------------------------------------------------------------------- 1 | (module pin_array_3x2 (layer F.Cu) (tedit 5527C087) 2 | (descr "Double rangee de contacts 2 x 4 pins") 3 | (tags CONN) 4 | (fp_text reference CON1 (at 0 -3.81) (layer F.SilkS) hide 5 | (effects (font (size 1.016 1.016) (thickness 0.2032))) 6 | ) 7 | (fp_text value AVR-ISP-6-NEW (at 0 3.81) (layer F.SilkS) hide 8 | (effects (font (size 1.016 1.016) (thickness 0.2032))) 9 | ) 10 | (pad 1 smd rect (at -2.54 1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 11 | (pad 2 smd circle (at -2.54 -1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 12 | (pad 3 smd circle (at 0 1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 13 | (pad 4 smd circle (at 0 -1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 14 | (pad 5 smd circle (at 2.54 1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 15 | (pad 6 smd circle (at 2.54 -1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 16 | (model pin_array/pins_array_3x2.wrl 17 | (at (xyz 0 0 0)) 18 | (scale (xyz 1 1 1)) 19 | (rotate (xyz 0 0 0)) 20 | ) 21 | ) 22 | -------------------------------------------------------------------------------- /driver_pcb_0.1/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name soic8)(type KiCad)(uri "$(KIPRJMOD)/soic8.pretty")(options "")(descr "")) 3 | (lib (name avr)(type KiCad)(uri "$(KIPRJMOD)/avr.pretty")(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /driver_pcb_0.1/gerbrename.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rename s'/(.*?)-Edge.Cuts\..*$/$1.GKO/' gerb/* 4 | rename s'/(.*?)-.*?\.([^.]*)$/$1.\U$2/' gerb/* 5 | rename s'/(.*?).drl/$1.TXT/' gerb/* 6 | 7 | -------------------------------------------------------------------------------- /driver_pcb_0.1/lipocharge.pro: -------------------------------------------------------------------------------- 1 | update=Thu 13 Jul 2017 05:43:39 PM CEST 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | [eeschema/libraries] 32 | LibName1=power 33 | LibName2=device 34 | LibName3=transistors 35 | LibName4=conn 36 | LibName5=linear 37 | LibName6=regul 38 | LibName7=74xx 39 | LibName8=cmos4000 40 | LibName9=adc-dac 41 | LibName10=memory 42 | LibName11=xilinx 43 | LibName12=microcontrollers 44 | LibName13=dsp 45 | LibName14=microchip 46 | LibName15=analog_switches 47 | LibName16=motorola 48 | LibName17=texas 49 | LibName18=intel 50 | LibName19=audio 51 | LibName20=interface 52 | LibName21=digital-audio 53 | LibName22=philips 54 | LibName23=display 55 | LibName24=cypress 56 | LibName25=siliconi 57 | LibName26=opto 58 | LibName27=atmel 59 | LibName28=contrib 60 | LibName29=valves 61 | LibName30=mcp73831 62 | -------------------------------------------------------------------------------- /driver_pcb_0.1/mcp73831.bak: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # MCP73831 5 | # 6 | DEF MCP73831 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -450 60 H V C CNN 8 | F1 "MCP73831" 0 0 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | DRAW 12 | S -550 350 500 -350 0 1 0 f 13 | X stat 1 -750 250 200 R 50 50 1 1 O 14 | X vss 2 -750 100 200 R 50 50 1 1 W 15 | X vbat 3 -750 -50 200 R 50 50 1 1 w 16 | X vdd 4 700 -50 200 L 50 50 1 1 W 17 | X prog 5 700 250 200 L 50 50 1 1 I 18 | ENDDRAW 19 | ENDDEF 20 | # 21 | #End Library 22 | -------------------------------------------------------------------------------- /driver_pcb_0.1/mcp73831.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_0.1/mcp73831.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_0.1/mcp73831.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # MCP73831 5 | # 6 | DEF MCP73831 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -450 60 H V C CNN 8 | F1 "MCP73831" 0 0 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | $FPLIST 12 | SOT23-5 13 | $ENDFPLIST 14 | DRAW 15 | S -550 350 500 -350 0 1 0 f 16 | X stat 1 -750 250 200 R 50 50 1 1 O 17 | X vss 2 -750 100 200 R 50 50 1 1 W 18 | X vbat 3 -750 -50 200 R 50 50 1 1 w 19 | X vdd 4 700 -50 200 L 50 50 1 1 W 20 | X prog 5 700 250 200 L 50 50 1 1 I 21 | ENDDRAW 22 | ENDDEF 23 | # 24 | #End Library 25 | -------------------------------------------------------------------------------- /driver_pcb_0.1/soic8.pretty/SO8E.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SO8E (layer F.Cu) (tedit 5527BFF7) 2 | (descr "module CMS SOJ 8 pins etroit") 3 | (tags "CMS SOJ") 4 | (attr smd) 5 | (fp_text reference IC1 (at 0 -0.889) (layer F.SilkS) hide 6 | (effects (font (size 1.143 1.143) (thickness 0.1524))) 7 | ) 8 | (fp_text value ATTINY85-S (at 0 1.016) (layer F.SilkS) hide 9 | (effects (font (size 0.889 0.889) (thickness 0.1524))) 10 | ) 11 | (pad 8 smd rect (at -1.905 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 12 | (pad 1 smd rect (at -1.905 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 13 | (pad 7 smd rect (at -0.635 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 14 | (pad 6 smd rect (at 0.635 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 15 | (pad 5 smd rect (at 1.905 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 16 | (pad 2 smd rect (at -0.635 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 17 | (pad 3 smd rect (at 0.635 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 18 | (pad 4 smd rect (at 1.905 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 19 | (model smd/cms_so8.wrl 20 | (at (xyz 0 0 0)) 21 | (scale (xyz 0.5 0.32 0.5)) 22 | (rotate (xyz 0 0 0)) 23 | ) 24 | ) 25 | -------------------------------------------------------------------------------- /driver_pcb_1.0/README.md: -------------------------------------------------------------------------------- 1 | driverpcb 2 | ========= 3 | 4 | Single layer redesign of v0.1 5 | 6 | Circuit adapted from 7 | 8 | http://blog.zakkemble.co.uk/a-lithium-battery-charger-with-load-sharing/ 9 | -------------------------------------------------------------------------------- /driver_pcb_1.0/avr-isp-6.bak: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 Date: Fri 10 Apr 2015 02:00:14 PM CEST 2 | #encoding utf-8 3 | # 4 | # AVR-ISP-6 5 | # 6 | DEF AVR-ISP-6 CON 0 40 Y Y 1 F N 7 | F0 "CON" -80 240 50 H V C CNN 8 | F1 "AVR-ISP-6" -240 -230 50 H V L BNN 9 | F2 "AVR-ISP-6" -520 40 50 V I C CNN 10 | F3 "~" 0 0 60 H V C CNN 11 | DRAW 12 | T 0 -290 5 45 0 0 0 SCK Normal 1 C C 13 | T 0 300 110 45 0 0 0 VCC Normal 1 C C 14 | T 0 310 -105 45 0 1 0 GND Normal 1 C C 15 | T 0 -308 102 45 0 1 0 MISO Normal 1 C C 16 | T 0 332 -2 45 0 1 0 MOSI Normal 1 C C 17 | T 0 -290 -100 45 0 1 0 RST Normal 1 C C 18 | S -180 -140 190 -160 0 1 0 F 19 | S -180 200 180 180 0 1 0 F 20 | S -175 -160 -195 -40 0 1 0 F 21 | S -175 200 -195 40 0 1 0 F 22 | S 180 200 200 -160 0 1 0 F 23 | X ~ 1 -150 100 100 R 40 40 1 1 P 24 | X ~ 2 150 100 100 L 40 40 1 1 P 25 | X ~ 3 -150 0 100 R 40 40 1 1 P 26 | X ~ 4 150 0 100 L 40 40 1 1 P 27 | X ~ 5 -150 -100 100 R 40 40 1 1 P 28 | X ~ 6 150 -100 100 L 40 40 1 1 P 29 | ENDDRAW 30 | ENDDEF 31 | # 32 | #End Library 33 | -------------------------------------------------------------------------------- /driver_pcb_1.0/avr-isp-6.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 Date: Sun 12 Apr 2015 02:33:30 PM CEST 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_1.0/avr-isp-6.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 Date: Sun 12 Apr 2015 02:33:30 PM CEST 2 | #encoding utf-8 3 | # 4 | # AVR-ISP-6 5 | # 6 | DEF AVR-ISP-6 CON 0 40 Y Y 1 F N 7 | F0 "CON" -80 240 50 H V C CNN 8 | F1 "AVR-ISP-6" -240 -230 50 H V L BNN 9 | F2 "AVR-ISP-6" -520 40 50 V I C CNN 10 | F3 "~" 0 0 60 H V C CNN 11 | DRAW 12 | T 0 -290 5 45 0 0 0 SCK Normal 1 C C 13 | T 0 300 110 45 0 0 0 VCC Normal 1 C C 14 | T 0 310 -105 45 0 1 0 GND Normal 1 C C 15 | T 0 -308 102 45 0 1 0 MISO Normal 1 C C 16 | T 0 332 -2 45 0 1 0 MOSI Normal 1 C C 17 | T 0 -290 -100 45 0 1 0 RST Normal 1 C C 18 | S -180 -140 190 -160 0 1 0 F 19 | S -180 200 180 180 0 1 0 F 20 | S -175 -160 -195 -40 0 1 0 F 21 | S -175 200 -195 40 0 1 0 F 22 | S 180 200 200 -160 0 1 0 F 23 | X ~ 1 -150 100 100 R 40 40 1 1 P 24 | X ~ 2 150 100 100 L 40 40 1 1 P 25 | X ~ 3 -150 0 100 R 40 40 1 1 P 26 | X ~ 4 150 0 100 L 40 40 1 1 P 27 | X ~ 5 -150 -100 100 R 40 40 1 1 P 28 | X ~ 6 150 -100 100 L 40 40 1 1 P 29 | ENDDRAW 30 | ENDDEF 31 | # 32 | # AVR-ISP-6-new 33 | # 34 | DEF AVR-ISP-6-new CON 0 40 Y Y 1 F N 35 | F0 "CON" -80 240 50 H V C CNN 36 | F1 "AVR-ISP-6-new" -240 -230 50 H V L BNN 37 | F2 "AVR-ISP-6" -520 40 50 V I C CNN 38 | F3 "~" 0 0 60 H V C CNN 39 | DRAW 40 | T 0 -290 5 45 0 0 0 SCK Normal 1 C C 41 | T 0 300 110 45 0 0 0 VCC Normal 1 C C 42 | T 0 310 -105 45 0 1 0 GND Normal 1 C C 43 | T 0 -308 102 45 0 1 0 MISO Normal 1 C C 44 | T 0 332 -2 45 0 1 0 MOSI Normal 1 C C 45 | T 0 -290 -100 45 0 1 0 RST Normal 1 C C 46 | S -180 -140 190 -160 0 1 0 F 47 | S -180 200 180 180 0 1 0 F 48 | S -175 -160 -195 -40 0 1 0 F 49 | S -175 200 -195 40 0 1 0 F 50 | S 180 200 200 -160 0 1 0 F 51 | X ~ 1 -150 100 100 R 40 40 1 1 P 52 | X ~ 2 150 100 100 L 40 40 1 1 P 53 | X ~ 3 -150 0 100 R 40 40 1 1 P 54 | X ~ 4 150 0 100 L 40 40 1 1 P 55 | X ~ 5 -150 -100 100 R 40 40 1 1 P 56 | X ~ 6 150 -100 100 L 40 40 1 1 P 57 | ENDDRAW 58 | ENDDEF 59 | # 60 | #End Library 61 | -------------------------------------------------------------------------------- /driver_pcb_1.0/avr.pretty/pin_array_3x2.kicad_mod: -------------------------------------------------------------------------------- 1 | (module pin_array_3x2 (layer F.Cu) (tedit 5527C087) 2 | (descr "Double rangee de contacts 2 x 4 pins") 3 | (tags CONN) 4 | (fp_text reference CON1 (at 0 -3.81) (layer F.SilkS) hide 5 | (effects (font (size 1.016 1.016) (thickness 0.2032))) 6 | ) 7 | (fp_text value AVR-ISP-6-NEW (at 0 3.81) (layer F.SilkS) hide 8 | (effects (font (size 1.016 1.016) (thickness 0.2032))) 9 | ) 10 | (pad 1 smd rect (at -2.54 1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 11 | (pad 2 smd circle (at -2.54 -1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 12 | (pad 3 smd circle (at 0 1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 13 | (pad 4 smd circle (at 0 -1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 14 | (pad 5 smd circle (at 2.54 1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 15 | (pad 6 smd circle (at 2.54 -1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 16 | (model pin_array/pins_array_3x2.wrl 17 | (at (xyz 0 0 0)) 18 | (scale (xyz 1 1 1)) 19 | (rotate (xyz 0 0 0)) 20 | ) 21 | ) 22 | -------------------------------------------------------------------------------- /driver_pcb_1.0/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name soic8)(type KiCad)(uri "$(KIPRJMOD)/soic8.pretty")(options "")(descr "")) 3 | (lib (name avr)(type KiCad)(uri "$(KIPRJMOD)/avr.pretty")(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /driver_pcb_1.0/gerbrename.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rename s'/(.*?)-Edge.Cuts\..*$/$1.GKO/' gerb/* 4 | rename s'/(.*?)-.*?\.([^.]*)$/$1.\U$2/' gerb/* 5 | rename s'/(.*?).drl/$1.TXT/' gerb/* 6 | 7 | -------------------------------------------------------------------------------- /driver_pcb_1.0/lipocharge.pro: -------------------------------------------------------------------------------- 1 | update=Thu 13 Jul 2017 05:43:39 PM CEST 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | [eeschema/libraries] 32 | LibName1=power 33 | LibName2=device 34 | LibName3=transistors 35 | LibName4=conn 36 | LibName5=linear 37 | LibName6=regul 38 | LibName7=74xx 39 | LibName8=cmos4000 40 | LibName9=adc-dac 41 | LibName10=memory 42 | LibName11=xilinx 43 | LibName12=microcontrollers 44 | LibName13=dsp 45 | LibName14=microchip 46 | LibName15=analog_switches 47 | LibName16=motorola 48 | LibName17=texas 49 | LibName18=intel 50 | LibName19=audio 51 | LibName20=interface 52 | LibName21=digital-audio 53 | LibName22=philips 54 | LibName23=display 55 | LibName24=cypress 56 | LibName25=siliconi 57 | LibName26=opto 58 | LibName27=atmel 59 | LibName28=contrib 60 | LibName29=valves 61 | LibName30=mcp73831 62 | -------------------------------------------------------------------------------- /driver_pcb_1.0/mcp73831.bak: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # MCP73831 5 | # 6 | DEF MCP73831 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -450 60 H V C CNN 8 | F1 "MCP73831" 0 0 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | DRAW 12 | S -550 350 500 -350 0 1 0 f 13 | X stat 1 -750 250 200 R 50 50 1 1 O 14 | X vss 2 -750 100 200 R 50 50 1 1 W 15 | X vbat 3 -750 -50 200 R 50 50 1 1 w 16 | X vdd 4 700 -50 200 L 50 50 1 1 W 17 | X prog 5 700 250 200 L 50 50 1 1 I 18 | ENDDRAW 19 | ENDDEF 20 | # 21 | #End Library 22 | -------------------------------------------------------------------------------- /driver_pcb_1.0/mcp73831.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_1.0/mcp73831.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_1.0/mcp73831.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # MCP73831 5 | # 6 | DEF MCP73831 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -450 60 H V C CNN 8 | F1 "MCP73831" 0 0 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | $FPLIST 12 | SOT23-5 13 | $ENDFPLIST 14 | DRAW 15 | S -550 350 500 -350 0 1 0 f 16 | X stat 1 -750 250 200 R 50 50 1 1 O 17 | X vss 2 -750 100 200 R 50 50 1 1 W 18 | X vbat 3 -750 -50 200 R 50 50 1 1 w 19 | X vdd 4 700 -50 200 L 50 50 1 1 W 20 | X prog 5 700 250 200 L 50 50 1 1 I 21 | ENDDRAW 22 | ENDDEF 23 | # 24 | #End Library 25 | -------------------------------------------------------------------------------- /driver_pcb_1.0/soic8.pretty/SO8E.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SO8E (layer F.Cu) (tedit 5527BFF7) 2 | (descr "module CMS SOJ 8 pins etroit") 3 | (tags "CMS SOJ") 4 | (attr smd) 5 | (fp_text reference IC1 (at 0 -0.889) (layer F.SilkS) hide 6 | (effects (font (size 1.143 1.143) (thickness 0.1524))) 7 | ) 8 | (fp_text value ATTINY85-S (at 0 1.016) (layer F.SilkS) hide 9 | (effects (font (size 0.889 0.889) (thickness 0.1524))) 10 | ) 11 | (pad 8 smd rect (at -1.905 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 12 | (pad 1 smd rect (at -1.905 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 13 | (pad 7 smd rect (at -0.635 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 14 | (pad 6 smd rect (at 0.635 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 15 | (pad 5 smd rect (at 1.905 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 16 | (pad 2 smd rect (at -0.635 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 17 | (pad 3 smd rect (at 0.635 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 18 | (pad 4 smd rect (at 1.905 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 19 | (model smd/cms_so8.wrl 20 | (at (xyz 0 0 0)) 21 | (scale (xyz 0.5 0.32 0.5)) 22 | (rotate (xyz 0 0 0)) 23 | ) 24 | ) 25 | -------------------------------------------------------------------------------- /driver_pcb_2.0/2x2.pro: -------------------------------------------------------------------------------- 1 | update=Mon 31 Jul 2017 10:04:56 AM MDT 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [pcbnew] 9 | version=1 10 | LastNetListRead= 11 | UseCmpFile=1 12 | PadDrill=0.600000000000 13 | PadDrillOvalY=0.600000000000 14 | PadSizeH=1.500000000000 15 | PadSizeV=1.500000000000 16 | PcbTextSizeV=1.500000000000 17 | PcbTextSizeH=1.500000000000 18 | PcbTextThickness=0.300000000000 19 | ModuleTextSizeV=1.000000000000 20 | ModuleTextSizeH=1.000000000000 21 | ModuleTextSizeThickness=0.150000000000 22 | SolderMaskClearance=0.000000000000 23 | SolderMaskMinWidth=0.000000000000 24 | DrawSegmentWidth=0.200000000000 25 | BoardOutlineThickness=0.100000000000 26 | ModuleOutlineThickness=0.150000000000 27 | [cvpcb] 28 | version=1 29 | NetIExt=net 30 | [eeschema] 31 | version=1 32 | LibDir= 33 | [eeschema/libraries] 34 | LibName1=power 35 | LibName2=device 36 | LibName3=switches 37 | LibName4=relays 38 | LibName5=motors 39 | LibName6=transistors 40 | LibName7=conn 41 | LibName8=linear 42 | LibName9=regul 43 | LibName10=74xx 44 | LibName11=cmos4000 45 | LibName12=adc-dac 46 | LibName13=memory 47 | LibName14=xilinx 48 | LibName15=microcontrollers 49 | LibName16=dsp 50 | LibName17=microchip 51 | LibName18=analog_switches 52 | LibName19=motorola 53 | LibName20=texas 54 | LibName21=intel 55 | LibName22=audio 56 | LibName23=interface 57 | LibName24=digital-audio 58 | LibName25=philips 59 | LibName26=display 60 | LibName27=cypress 61 | LibName28=siliconi 62 | LibName29=opto 63 | LibName30=atmel 64 | LibName31=contrib 65 | LibName32=valves 66 | -------------------------------------------------------------------------------- /driver_pcb_2.0/README.md: -------------------------------------------------------------------------------- 1 | driverpcb 2.0 2 | ========= 3 | 4 | Circuit design derived from Travis Goodspeed's Goodwatch project, 5 | replacing the CC430F6137 with the smaller footprint CC430F5137: 6 | 7 | https://github.com/travisgoodspeed/goodwatch 8 | 9 | Lipo charging/load decoupling part of the circuit adapted from: 10 | 11 | http://blog.zakkemble.co.uk/a-lithium-battery-charger-with-load-sharing/ 12 | 13 | -------------------------------------------------------------------------------- /driver_pcb_2.0/avr-isp-6.bak: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 Date: Fri 10 Apr 2015 02:00:14 PM CEST 2 | #encoding utf-8 3 | # 4 | # AVR-ISP-6 5 | # 6 | DEF AVR-ISP-6 CON 0 40 Y Y 1 F N 7 | F0 "CON" -80 240 50 H V C CNN 8 | F1 "AVR-ISP-6" -240 -230 50 H V L BNN 9 | F2 "AVR-ISP-6" -520 40 50 V I C CNN 10 | F3 "~" 0 0 60 H V C CNN 11 | DRAW 12 | T 0 -290 5 45 0 0 0 SCK Normal 1 C C 13 | T 0 300 110 45 0 0 0 VCC Normal 1 C C 14 | T 0 310 -105 45 0 1 0 GND Normal 1 C C 15 | T 0 -308 102 45 0 1 0 MISO Normal 1 C C 16 | T 0 332 -2 45 0 1 0 MOSI Normal 1 C C 17 | T 0 -290 -100 45 0 1 0 RST Normal 1 C C 18 | S -180 -140 190 -160 0 1 0 F 19 | S -180 200 180 180 0 1 0 F 20 | S -175 -160 -195 -40 0 1 0 F 21 | S -175 200 -195 40 0 1 0 F 22 | S 180 200 200 -160 0 1 0 F 23 | X ~ 1 -150 100 100 R 40 40 1 1 P 24 | X ~ 2 150 100 100 L 40 40 1 1 P 25 | X ~ 3 -150 0 100 R 40 40 1 1 P 26 | X ~ 4 150 0 100 L 40 40 1 1 P 27 | X ~ 5 -150 -100 100 R 40 40 1 1 P 28 | X ~ 6 150 -100 100 L 40 40 1 1 P 29 | ENDDRAW 30 | ENDDEF 31 | # 32 | #End Library 33 | -------------------------------------------------------------------------------- /driver_pcb_2.0/avr-isp-6.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 Date: Sun 12 Apr 2015 02:33:30 PM CEST 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_2.0/avr-isp-6.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 Date: Sun 12 Apr 2015 02:33:30 PM CEST 2 | #encoding utf-8 3 | # 4 | # AVR-ISP-6 5 | # 6 | DEF AVR-ISP-6 CON 0 40 Y Y 1 F N 7 | F0 "CON" -80 240 50 H V C CNN 8 | F1 "AVR-ISP-6" -240 -230 50 H V L BNN 9 | F2 "AVR-ISP-6" -520 40 50 V I C CNN 10 | F3 "~" 0 0 60 H V C CNN 11 | DRAW 12 | T 0 -290 5 45 0 0 0 SCK Normal 1 C C 13 | T 0 300 110 45 0 0 0 VCC Normal 1 C C 14 | T 0 310 -105 45 0 1 0 GND Normal 1 C C 15 | T 0 -308 102 45 0 1 0 MISO Normal 1 C C 16 | T 0 332 -2 45 0 1 0 MOSI Normal 1 C C 17 | T 0 -290 -100 45 0 1 0 RST Normal 1 C C 18 | S -180 -140 190 -160 0 1 0 F 19 | S -180 200 180 180 0 1 0 F 20 | S -175 -160 -195 -40 0 1 0 F 21 | S -175 200 -195 40 0 1 0 F 22 | S 180 200 200 -160 0 1 0 F 23 | X ~ 1 -150 100 100 R 40 40 1 1 P 24 | X ~ 2 150 100 100 L 40 40 1 1 P 25 | X ~ 3 -150 0 100 R 40 40 1 1 P 26 | X ~ 4 150 0 100 L 40 40 1 1 P 27 | X ~ 5 -150 -100 100 R 40 40 1 1 P 28 | X ~ 6 150 -100 100 L 40 40 1 1 P 29 | ENDDRAW 30 | ENDDEF 31 | # 32 | # AVR-ISP-6-new 33 | # 34 | DEF AVR-ISP-6-new CON 0 40 Y Y 1 F N 35 | F0 "CON" -80 240 50 H V C CNN 36 | F1 "AVR-ISP-6-new" -240 -230 50 H V L BNN 37 | F2 "AVR-ISP-6" -520 40 50 V I C CNN 38 | F3 "~" 0 0 60 H V C CNN 39 | DRAW 40 | T 0 -290 5 45 0 0 0 SCK Normal 1 C C 41 | T 0 300 110 45 0 0 0 VCC Normal 1 C C 42 | T 0 310 -105 45 0 1 0 GND Normal 1 C C 43 | T 0 -308 102 45 0 1 0 MISO Normal 1 C C 44 | T 0 332 -2 45 0 1 0 MOSI Normal 1 C C 45 | T 0 -290 -100 45 0 1 0 RST Normal 1 C C 46 | S -180 -140 190 -160 0 1 0 F 47 | S -180 200 180 180 0 1 0 F 48 | S -175 -160 -195 -40 0 1 0 F 49 | S -175 200 -195 40 0 1 0 F 50 | S 180 200 200 -160 0 1 0 F 51 | X ~ 1 -150 100 100 R 40 40 1 1 P 52 | X ~ 2 150 100 100 L 40 40 1 1 P 53 | X ~ 3 -150 0 100 R 40 40 1 1 P 54 | X ~ 4 150 0 100 L 40 40 1 1 P 55 | X ~ 5 -150 -100 100 R 40 40 1 1 P 56 | X ~ 6 150 -100 100 L 40 40 1 1 P 57 | ENDDRAW 58 | ENDDEF 59 | # 60 | #End Library 61 | -------------------------------------------------------------------------------- /driver_pcb_2.0/avr.pretty/pin_array_3x2.kicad_mod: -------------------------------------------------------------------------------- 1 | (module pin_array_3x2 (layer F.Cu) (tedit 5527C087) 2 | (descr "Double rangee de contacts 2 x 4 pins") 3 | (tags CONN) 4 | (fp_text reference CON1 (at 0 -3.81) (layer F.SilkS) hide 5 | (effects (font (size 1.016 1.016) (thickness 0.2032))) 6 | ) 7 | (fp_text value AVR-ISP-6-NEW (at 0 3.81) (layer F.SilkS) hide 8 | (effects (font (size 1.016 1.016) (thickness 0.2032))) 9 | ) 10 | (pad 1 smd rect (at -2.54 1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 11 | (pad 2 smd circle (at -2.54 -1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 12 | (pad 3 smd circle (at 0 1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 13 | (pad 4 smd circle (at 0 -1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 14 | (pad 5 smd circle (at 2.54 1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 15 | (pad 6 smd circle (at 2.54 -1.27) (size 1.524 1.524) (layers F.Cu F.Paste F.Mask)) 16 | (model pin_array/pins_array_3x2.wrl 17 | (at (xyz 0 0 0)) 18 | (scale (xyz 1 1 1)) 19 | (rotate (xyz 0 0 0)) 20 | ) 21 | ) 22 | -------------------------------------------------------------------------------- /driver_pcb_2.0/fiducial.pretty/Fiducial_1mm_Dia_2.54mm_Outer_CopperTop.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Fiducials:Fiducial_1mm_Dia_2.54mm_Outer_CopperTop (layer F.Cu) (tedit 5AF3564C) 2 | (descr "Circular Fiducial") 3 | (tags marker) 4 | (attr virtual) 5 | (fp_text reference REF** (at 3.4 0.7) (layer F.SilkS) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value Fiducial_1mm (at 0 -1.8) (layer F.Fab) hide 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_circle (center 0 0) (end 1.55 0) (layer F.CrtYd) (width 0.05)) 12 | (pad ~ smd circle (at 0 0) (size 1 1) (layers B.Cu B.Mask) 13 | (solder_mask_margin 0.77) (clearance 0.77)) 14 | (pad ~ smd circle (at 0 0) (size 1 1) (layers F.Cu F.Mask) 15 | (solder_mask_margin 0.77) (clearance 0.77)) 16 | ) 17 | -------------------------------------------------------------------------------- /driver_pcb_2.0/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name soic8)(type KiCad)(uri "$(KIPRJMOD)/soic8.pretty")(options "")(descr "")) 3 | (lib (name avr)(type KiCad)(uri "$(KIPRJMOD)/avr.pretty")(options "")(descr "")) 4 | (lib (name goodwatch21)(type KiCad)(uri "$(KIPRJMOD)/goodwatch/goodwatch21.pretty")(options "")(descr "")) 5 | (lib (name sot)(type KiCad)(uri "$(KIPRJMOD)/sot.pretty")(options "")(descr "")) 6 | (lib (name passives)(type KiCad)(uri "$(KIPRJMOD)/passives.pretty")(options "")(descr "")) 7 | (lib (name outline)(type KiCad)(uri "$(KIPRJMOD)/outline.pretty")(options "")(descr "")) 8 | (lib (name rotunda)(type KiCad)(uri "$(KIPRJMOD)/rotunda.pretty")(options "")(descr "")) 9 | ) 10 | -------------------------------------------------------------------------------- /driver_pcb_2.0/gerbrename.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rename s'/(.*?)-Edge.Cuts\..*$/$1.GKO/' gerb/* 4 | rename s'/(.*?)-.*?\.([^.]*)$/$1.\U$2/' gerb/* 5 | rename s'/(.*?).drl/$1.TXT/' gerb/* 6 | 7 | -------------------------------------------------------------------------------- /driver_pcb_2.0/goodwatch/goodwatch21.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_2.0/goodwatch/goodwatch21.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_2.0/goodwatch/goodwatch21.pretty/0433bm15a0001.kicad_mod: -------------------------------------------------------------------------------- 1 | (module 0433bm15a0001 (layer F.Cu) (tedit 59E25BCA) 2 | (fp_text reference REF** (at 0 2.5) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value 0433bm15a0001 (at 0 -1.25) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (pad 1 smd rect (at 0.64 0) (size 0.3 0.7) (layers F.Cu F.Paste F.Mask)) 9 | (pad 2 smd rect (at 0 0) (size 0.3 0.7) (layers F.Cu F.Paste F.Mask)) 10 | (pad 3 smd rect (at -0.64 0) (size 0.3 0.7) (layers F.Cu F.Paste F.Mask)) 11 | (pad 4 smd rect (at -0.64 1.25) (size 0.3 0.7) (layers F.Cu F.Paste F.Mask)) 12 | (pad 5 smd rect (at 0 1.25) (size 0.3 0.7) (layers F.Cu F.Paste F.Mask)) 13 | (pad 6 smd rect (at 0.64 1.25) (size 0.3 0.7) (layers F.Cu F.Paste F.Mask)) 14 | ) 15 | -------------------------------------------------------------------------------- /driver_pcb_2.0/goodwatch/goodwatch21.pretty/CC430F513x.kicad_mod: -------------------------------------------------------------------------------- 1 | (module CC430F513x (layer F.Cu) (tedit 5AE89B2E) 2 | (solder_mask_margin 0.07) 3 | (fp_text reference REF** (at 0 -5) (layer F.SilkS) hide 4 | (effects (font (size 0.75 0.75) (thickness 0.1))) 5 | ) 6 | (fp_text value CC430F513x (at 0 5) (layer F.Fab) hide 7 | (effects (font (size 0.75 0.75) (thickness 0.1))) 8 | ) 9 | (fp_line (start -4 -3.25) (end -3.25 -4) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start 3.25 -4) (end 4 -4) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start 4 -4) (end 4 -3.25) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start -3.25 4) (end -4 4) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start -4 4) (end -4 3.25) (layer F.SilkS) (width 0.15)) 14 | (fp_line (start 3.25 4) (end 4 4) (layer F.SilkS) (width 0.15)) 15 | (fp_line (start 4 4) (end 4 3.25) (layer F.SilkS) (width 0.15)) 16 | (pad 49 smd rect (at 0 0) (size 4.1 4.1) (layers F.Cu F.Paste F.Mask)) 17 | (pad 5 smd oval (at -3.55 -0.75 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 18 | (pad 6 smd oval (at -3.55 -0.25 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 19 | (pad 7 smd oval (at -3.55 0.25 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 20 | (pad 8 smd oval (at -3.55 0.75 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 21 | (pad 3 smd oval (at -3.55 -1.75 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 22 | (pad 1 smd oval (at -3.55 -2.75 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 23 | (pad 2 smd oval (at -3.55 -2.25 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 24 | (pad 4 smd oval (at -3.55 -1.25 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 25 | (pad 9 smd oval (at -3.55 1.25 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 26 | (pad 11 smd oval (at -3.55 2.25 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 27 | (pad 10 smd oval (at -3.55 1.75 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 28 | (pad 12 smd oval (at -3.55 2.75 90) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 29 | (pad 17 smd oval (at -0.75 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 30 | (pad 19 smd oval (at 0.25 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 31 | (pad 21 smd oval (at 1.25 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 32 | (pad 20 smd oval (at 0.75 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 33 | (pad 18 smd oval (at -0.25 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 34 | (pad 24 smd oval (at 2.75 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 35 | (pad 23 smd oval (at 2.25 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 36 | (pad 22 smd oval (at 1.75 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 37 | (pad 15 smd oval (at -1.75 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 38 | (pad 16 smd oval (at -1.25 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 39 | (pad 14 smd oval (at -2.25 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 40 | (pad 13 smd oval (at -2.75 3.55 180) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 41 | (pad 36 smd oval (at 3.55 -2.75 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 42 | (pad 34 smd oval (at 3.55 -1.75 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 43 | (pad 35 smd oval (at 3.55 -2.25 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 44 | (pad 27 smd oval (at 3.55 1.75 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 45 | (pad 33 smd oval (at 3.55 -1.25 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 46 | (pad 32 smd oval (at 3.55 -0.75 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 47 | (pad 31 smd oval (at 3.55 -0.25 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 48 | (pad 26 smd oval (at 3.55 2.25 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 49 | (pad 25 smd oval (at 3.55 2.75 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 50 | (pad 28 smd oval (at 3.55 1.25 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 51 | (pad 30 smd oval (at 3.55 0.25 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 52 | (pad 29 smd oval (at 3.55 0.75 270) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 53 | (pad 42 smd oval (at 0.25 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 54 | (pad 44 smd oval (at -0.75 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 55 | (pad 43 smd oval (at -0.25 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 56 | (pad 38 smd oval (at 2.25 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 57 | (pad 37 smd oval (at 2.75 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 58 | (pad 40 smd oval (at 1.25 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 59 | (pad 39 smd oval (at 1.75 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 60 | (pad 41 smd oval (at 0.75 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 61 | (pad 45 smd oval (at -1.25 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 62 | (pad 48 smd oval (at -2.75 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 63 | (pad 46 smd oval (at -1.75 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 64 | (pad 47 smd oval (at -2.25 -3.55) (size 0.28 1) (layers F.Cu F.Paste F.Mask)) 65 | ) 66 | -------------------------------------------------------------------------------- /driver_pcb_2.0/goodwatch/goodwatch21.pretty/FA128.kicad_mod: -------------------------------------------------------------------------------- 1 | (module FA128 (layer F.Cu) (tedit 59D3C782) 2 | (fp_text reference REF** (at 0 2.3) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value FA128 (at -1.45 -1.15 90) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start -1 -2) (end 2 -2) (layer F.SilkS) (width 0.15)) 9 | (fp_line (start -1 1) (end -1 0) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start 0 1) (end -1 1) (layer F.SilkS) (width 0.15)) 11 | (pad 1 smd rect (at 0 0) (size 0.95 0.85) (layers F.Cu F.Paste F.Mask)) 12 | (pad 2 smd rect (at 1.45 0) (size 0.95 0.85) (layers F.Cu F.Paste F.Mask)) 13 | (pad 3 smd rect (at 1.45 -1.15) (size 0.95 0.85) (layers F.Cu F.Paste F.Mask)) 14 | (pad 4 smd rect (at 0 -1.15) (size 0.95 0.85) (layers F.Cu F.Paste F.Mask)) 15 | ) 16 | -------------------------------------------------------------------------------- /driver_pcb_2.0/goodwatch/goodwatch21.pretty/YageoS432.kicad_mod: -------------------------------------------------------------------------------- 1 | (module YageoS432 (layer F.Cu) (tedit 59D2F747) 2 | (fp_text reference REF** (at 6 1) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value YageoS432 (at 6 -1) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (pad 1 smd rect (at 0 0) (size 1 4) (layers F.Cu F.Paste F.Mask)) 9 | (pad 2 smd rect (at 12.3 0) (size 1 4) (layers F.Cu F.Paste F.Mask)) 10 | ) 11 | -------------------------------------------------------------------------------- /driver_pcb_2.0/goodwatch/goodwatch21.pretty/ca53board.kicad_mod: -------------------------------------------------------------------------------- 1 | (module ca53board (layer F.Cu) (tedit 59FA3392) 2 | (descr "PCB Layout for the Casio CA53W") 3 | (fp_text reference REF** (at 22.2 -25.9) (layer F.SilkS) hide 4 | (effects (font (size 1 1) (thickness 0.15))) 5 | ) 6 | (fp_text value ca53board (at 4.1 -25.9) (layer F.Fab) hide 7 | (effects (font (size 1 1) (thickness 0.15))) 8 | ) 9 | (fp_line (start 20 -2) (end 20 -3.5) (layer Dwgs.User) (width 0.15)) 10 | (fp_line (start 5.5 -2) (end 5.5 -3.5) (layer Dwgs.User) (width 0.15)) 11 | (fp_line (start 25.6 -2.8) (end 25 -2.8) (layer Dwgs.User) (width 0.15)) 12 | (fp_line (start 25 -2.8) (end 25 -13.2) (layer Dwgs.User) (width 0.15)) 13 | (fp_line (start 25 -13.2) (end 25.6 -13.9) (layer Dwgs.User) (width 0.15)) 14 | (fp_text user GND (at 17 -20.3) (layer B.SilkS) 15 | (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) 16 | ) 17 | (fp_text user VCC (at 18 -26 270) (layer B.SilkS) 18 | (effects (font (size 1 1) (thickness 0.15)) (justify mirror)) 19 | ) 20 | (fp_line (start 0 -14.8) (end 25.6 -14.8) (layer Dwgs.User) (width 0.15)) 21 | (fp_line (start 0 -17.6) (end 25.6 -17.6) (layer Dwgs.User) (width 0.15)) 22 | (fp_line (start 0 0) (end 25.6 0) (layer Dwgs.User) (width 0.15)) 23 | (fp_line (start 25.6 0) (end 25.6 -27.6) (layer Dwgs.User) (width 0.15)) 24 | (fp_line (start 25.6 -27.6) (end 0 -27.6) (layer Dwgs.User) (width 0.15)) 25 | (fp_line (start 0 -27.6) (end 0 0) (layer Dwgs.User) (width 0.15)) 26 | (pad 4 thru_hole oval (at 25.2 -3.8) (size 1.2 2.7) (drill oval 0.8 2.3) (layers *.Cu *.Mask)) 27 | (pad 3 thru_hole oval (at 25.2 -11.3) (size 1.2 2.7) (drill oval 0.8 2.3) (layers *.Cu *.Mask)) 28 | (pad 2 connect rect (at 17.3 -16.4 4.5) (size 6.4 6) (layers B.Cu B.Mask)) 29 | (pad "" np_thru_hole circle (at 20.3 -27.3) (size 1 1) (drill 1) (layers *.Cu *.Mask)) 30 | (pad "" np_thru_hole circle (at 23.9 -13.8) (size 1.2 1.2) (drill 1.2) (layers *.Cu *.Mask)) 31 | (pad "" np_thru_hole circle (at 1.6 -13.8) (size 1.2 1.2) (drill 1.2) (layers *.Cu *.Mask)) 32 | (pad "" np_thru_hole circle (at 5.3 -27.3) (size 1 1) (drill 1) (layers *.Cu *.Mask)) 33 | (pad 1 connect rect (at 12.9 -26) (size 8.3 2.75) (layers B.Cu B.Mask)) 34 | (pad 5 thru_hole circle (at 3 -2) (size 1.524 1.524) (drill 0.762) (layers *.Cu *.Mask)) 35 | (pad 6 thru_hole circle (at 1.27 -4) (size 1.524 1.524) (drill 0.762) (layers *.Cu *.Mask)) 36 | (pad 7 thru_hole circle (at 22 -2) (size 1.524 1.524) (drill 0.762) (layers *.Cu *.Mask)) 37 | (pad 8 smd circle (at 6.75 -5.5) (size 2 2) (layers B.Cu B.Mask)) 38 | ) 39 | -------------------------------------------------------------------------------- /driver_pcb_2.0/goodwatch/goodwatch21.pretty/ca53keypad.kicad_mod: -------------------------------------------------------------------------------- 1 | (module ca53keypad (layer F.Cu) (tedit 58F27465) 2 | (fp_text reference REF** (at 7.2 2) (layer F.SilkS) hide 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value keypad (at 5.9 -2) (layer F.Fab) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (pad 1 connect rect (at 0.5 0) (size 0.985 1.75) (layers F.Cu F.Mask)) 9 | (pad 2 connect rect (at 2 0) (size 0.985 1.75) (layers F.Cu F.Mask)) 10 | (pad 3 connect rect (at 3.5 0) (size 0.985 1.75) (layers F.Cu F.Mask)) 11 | (pad 4 connect rect (at 5 0) (size 0.985 1.75) (layers F.Cu F.Mask)) 12 | (pad 5 connect rect (at 6.5 0) (size 0.985 1.75) (layers F.Cu F.Mask)) 13 | (pad 6 connect rect (at 8 0) (size 0.985 1.75) (layers F.Cu F.Mask)) 14 | (pad 7 connect rect (at 9.5 0) (size 0.985 1.75) (layers F.Cu F.Mask)) 15 | (pad 8 connect rect (at 11 0) (size 0.985 1.75) (layers F.Cu F.Mask)) 16 | (pad 9 connect rect (at 12.5 0) (size 0.985 1.75) (layers F.Cu F.Mask)) 17 | ) 18 | -------------------------------------------------------------------------------- /driver_pcb_2.0/goodwatch/goodwatch21.pretty/ca53lcd.kicad_mod: -------------------------------------------------------------------------------- 1 | (module ca53lcd (layer F.Cu) (tedit 58F28911) 2 | (fp_text reference REF** (at 7.9 2.7) (layer F.SilkS) hide 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value ca53lcd (at 9.7 -2.4) (layer F.Fab) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (pad 1 connect rect (at 0.2 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 9 | (pad 2 connect rect (at 0.8 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 10 | (pad 3 connect rect (at 1.4 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 11 | (pad 4 connect rect (at 2 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 12 | (pad 5 connect rect (at 2.6 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 13 | (pad 6 connect rect (at 3.2 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 14 | (pad 7 connect rect (at 3.8 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 15 | (pad 8 connect rect (at 4.4 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 16 | (pad 9 connect rect (at 5 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 17 | (pad 10 connect rect (at 5.6 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 18 | (pad 11 connect rect (at 6.2 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 19 | (pad 12 connect rect (at 6.8 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 20 | (pad 13 connect rect (at 7.4 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 21 | (pad 14 connect rect (at 8 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 22 | (pad 15 connect rect (at 8.6 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 23 | (pad 16 connect rect (at 9.2 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 24 | (pad 17 connect rect (at 9.8 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 25 | (pad 18 connect rect (at 10.4 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 26 | (pad 19 connect rect (at 11 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 27 | (pad 20 connect rect (at 11.6 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 28 | (pad 21 connect rect (at 12.2 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 29 | (pad 22 connect rect (at 12.8 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 30 | (pad 23 connect rect (at 13.4 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 31 | (pad 24 connect rect (at 14 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 32 | (pad 25 connect rect (at 14.6 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 33 | (pad 26 connect rect (at 15.2 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 34 | (pad 27 connect rect (at 15.8 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 35 | (pad 28 connect rect (at 16.4 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 36 | (pad 29 connect rect (at 17 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 37 | (pad 30 connect rect (at 17.6 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 38 | (pad 31 connect rect (at 18.2 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 39 | (pad 32 connect rect (at 18.8 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 40 | (pad 33 connect rect (at 19.4 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 41 | (pad 34 connect rect (at 20 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 42 | (pad 35 connect rect (at 20.6 0) (size 0.31 1.75) (layers F.Cu F.Mask)) 43 | ) 44 | -------------------------------------------------------------------------------- /driver_pcb_2.0/goodwatch/goodwatch21.pretty/sot-563.kicad_mod: -------------------------------------------------------------------------------- 1 | (module sot-563 (layer F.Cu) (tedit 5AE8C91A) 2 | (fp_text reference REF** (at 0.1 -2) (layer F.SilkS) hide 3 | (effects (font (size 0.75 0.75) (thickness 0.1))) 4 | ) 5 | (fp_text value sot-563 (at 0 1.9) (layer F.SilkS) hide 6 | (effects (font (size 0.75 0.75) (thickness 0.1))) 7 | ) 8 | (fp_circle (center -0.5 0.2) (end -0.4 0.3) (layer F.SilkS) (width 0.1)) 9 | (pad 6 smd rect (at -0.5 -0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 10 | (pad 5 smd rect (at 0 -0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 11 | (pad 4 smd rect (at 0.5 -0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 12 | (pad 3 smd rect (at 0.5 0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 13 | (pad 2 smd rect (at 0 0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 14 | (pad 1 smd rect (at -0.5 0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 15 | ) 16 | -------------------------------------------------------------------------------- /driver_pcb_2.0/lipocharge.pro: -------------------------------------------------------------------------------- 1 | update=Thu 29 Nov 2018 10:37:26 PM CET 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | -------------------------------------------------------------------------------- /driver_pcb_2.0/mcp73831.bak: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # MCP73831 5 | # 6 | DEF MCP73831 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -450 60 H V C CNN 8 | F1 "MCP73831" 0 0 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | DRAW 12 | S -550 350 500 -350 0 1 0 f 13 | X stat 1 -750 250 200 R 50 50 1 1 O 14 | X vss 2 -750 100 200 R 50 50 1 1 W 15 | X vbat 3 -750 -50 200 R 50 50 1 1 w 16 | X vdd 4 700 -50 200 L 50 50 1 1 W 17 | X prog 5 700 250 200 L 50 50 1 1 I 18 | ENDDRAW 19 | ENDDEF 20 | # 21 | #End Library 22 | -------------------------------------------------------------------------------- /driver_pcb_2.0/mcp73831.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_2.0/mcp73831.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_2.0/mcp73831.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # MCP73831 5 | # 6 | DEF MCP73831 U 0 40 Y Y 1 F N 7 | F0 "U" 0 -450 60 H V C CNN 8 | F1 "MCP73831" 0 0 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | $FPLIST 12 | SOT23-5 13 | $ENDFPLIST 14 | DRAW 15 | S -550 350 500 -350 0 1 0 f 16 | X stat 1 -750 250 200 R 50 50 1 1 O 17 | X vss 2 -750 100 200 R 50 50 1 1 W 18 | X vbat 3 -750 -50 200 R 50 50 1 1 w 19 | X vdd 4 700 -50 200 L 50 50 1 1 W 20 | X prog 5 700 250 200 L 50 50 1 1 I 21 | ENDDRAW 22 | ENDDEF 23 | # 24 | #End Library 25 | -------------------------------------------------------------------------------- /driver_pcb_2.0/ncp170.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /driver_pcb_2.0/ncp170.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # ncp170axv330 5 | # 6 | DEF ncp170axv330 U 0 40 Y Y 1 F N 7 | F0 "U" 0 300 60 H V C CNN 8 | F1 "ncp170axv330" 0 -500 60 H V C CNN 9 | F2 "" 0 0 60 H I C CNN 10 | F3 "" 0 0 60 H I C CNN 11 | DRAW 12 | S -350 200 350 -200 0 1 0 N 13 | X IN 1 -550 100 200 R 50 50 1 1 W 14 | X GND 2 -100 -400 200 U 50 50 1 1 W 15 | X OUT 3 550 100 200 L 50 50 1 1 w 16 | X NC 4 550 -100 200 L 50 50 1 1 N 17 | X GND 5 100 -400 200 U 50 50 1 1 W 18 | X EN 6 -550 -100 200 R 50 50 1 1 I 19 | ENDDRAW 20 | ENDDEF 21 | # 22 | #End Library 23 | -------------------------------------------------------------------------------- /driver_pcb_2.0/passives.pretty/C_0201_NoSilk.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Capacitors_SMD:C_0201_NoSilk (layer F.Cu) (tedit 5AF06C4C) 2 | (descr "Capacitor SMD 0201, reflow soldering, AVX (see smccp.pdf)") 3 | (tags "capacitor 0201") 4 | (attr smd) 5 | (fp_text reference C1 (at 0 -1.27) (layer F.SilkS) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value 100n (at 0 1.27) (layer F.Fab) hide 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (pad 1 smd rect (at -0.28 0) (size 0.3 0.35) (layers F.Cu F.Paste F.Mask)) 12 | (pad 2 smd rect (at 0.28 0) (size 0.3 0.35) (layers F.Cu F.Paste F.Mask)) 13 | (model Capacitors_SMD.3dshapes/C_0201.wrl 14 | (at (xyz 0 0 0)) 15 | (scale (xyz 1 1 1)) 16 | (rotate (xyz 0 0 0)) 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /driver_pcb_2.0/passives.pretty/C_0402.kicad_mod: -------------------------------------------------------------------------------- 1 | (module C_0402 (layer F.Cu) (tedit 5AF06DB4) 2 | (descr "Capacitor SMD 0402, reflow soldering, AVX (see smccp.pdf)") 3 | (tags "capacitor 0402") 4 | (attr smd) 5 | (fp_text reference C5 (at 0 -1.27) (layer F.SilkS) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value 1u (at 0 1.27) (layer F.Fab) hide 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (pad 1 smd rect (at -0.55 0) (size 0.6 0.5) (layers F.Cu F.Paste F.Mask)) 12 | (pad 2 smd rect (at 0.55 0) (size 0.6 0.5) (layers F.Cu F.Paste F.Mask)) 13 | (model Capacitors_SMD.3dshapes/C_0402.wrl 14 | (at (xyz 0 0 0)) 15 | (scale (xyz 1 1 1)) 16 | (rotate (xyz 0 0 0)) 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /driver_pcb_2.0/passives.pretty/C_0402_NoSilk.kicad_mod: -------------------------------------------------------------------------------- 1 | (module C_0402_NoSilk (layer F.Cu) (tedit 5AF376B8) 2 | (descr "Capacitor SMD 0402, reflow soldering, AVX (see smccp.pdf)") 3 | (tags "capacitor 0402") 4 | (attr smd) 5 | (fp_text reference C5 (at 0 -1.27) (layer F.SilkS) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value 1u (at 0 1.27) (layer F.Fab) hide 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (pad 1 smd rect (at -0.45 0) (size 0.4 0.6) (layers F.Cu F.Paste F.Mask)) 12 | (pad 2 smd rect (at 0.45 0) (size 0.4 0.6) (layers F.Cu F.Paste F.Mask)) 13 | (model Capacitors_SMD.3dshapes/C_0402.wrl 14 | (at (xyz 0 0 0)) 15 | (scale (xyz 1 1 1)) 16 | (rotate (xyz 0 0 0)) 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /driver_pcb_2.0/passives.pretty/Magnet_2mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Magnet_2mm (layer F.Cu) (tedit 5AF419DA) 2 | (descr "Through hole straight pin header, 1x01, 2.54mm pitch, single row") 3 | (tags "Through hole pin header THT 1x01 2.54mm single row") 4 | (fp_text reference - (at -1.9 1.5) (layer F.SilkS) hide 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value CONN_01X01 (at 0 2.39) (layer F.Fab) hide 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (pad 1 thru_hole circle (at 0 0) (size 2.8 2.8) (drill 2.2) (layers *.Cu *.Mask)) 11 | ) 12 | -------------------------------------------------------------------------------- /driver_pcb_2.0/passives.pretty/R_0201_NoSilk.kicad_mod: -------------------------------------------------------------------------------- 1 | (module R_0201_NoSilk (layer F.Cu) (tedit 5AF06D3D) 2 | (descr "Resistor SMD 0201, reflow soldering, Vishay (see crcw0201e3.pdf)") 3 | (tags "resistor 0201") 4 | (attr smd) 5 | (fp_text reference R1 (at 0 -1.1) (layer F.SilkS) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value 15K (at 0 1.15) (layer F.Fab) hide 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (pad 1 smd rect (at -0.26 0) (size 0.28 0.43) (layers F.Cu F.Paste F.Mask)) 12 | (pad 2 smd rect (at 0.26 0) (size 0.28 0.43) (layers F.Cu F.Paste F.Mask)) 13 | (model ${KISYS3DMOD}/Resistors_SMD.3dshapes/R_0201.wrl 14 | (at (xyz 0 0 0)) 15 | (scale (xyz 1 1 1)) 16 | (rotate (xyz 0 0 0)) 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /driver_pcb_2.0/passives.pretty/R_0402_NoSilk.kicad_mod: -------------------------------------------------------------------------------- 1 | (module R_0402_NoSilk (layer F.Cu) (tedit 5AF376B8) 2 | (descr "Resistor SMD 0402, reflow soldering") 3 | (tags "resistor 0402") 4 | (attr smd) 5 | (fp_text reference R5 (at 0 -1.27) (layer F.SilkS) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value 15K (at 0 1.27) (layer F.Fab) hide 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (pad 1 smd rect (at -0.45 0) (size 0.4 0.6) (layers F.Cu F.Paste F.Mask)) 12 | (pad 2 smd rect (at 0.45 0) (size 0.4 0.6) (layers F.Cu F.Paste F.Mask)) 13 | (model Resistors_SMD.3dshapes/R_0402.wrl 14 | (at (xyz 0 0 0)) 15 | (scale (xyz 1 1 1)) 16 | (rotate (xyz 0 0 0)) 17 | ) 18 | ) 19 | -------------------------------------------------------------------------------- /driver_pcb_2.0/passives.pretty/small_hole.kicad_mod: -------------------------------------------------------------------------------- 1 | (module small_hole (layer F.Cu) (tedit 5AF453F2) 2 | (descr "Through hole straight pin header, 1x01, 1.00mm pitch, single row") 3 | (tags "Through hole pin header THT 1x01 1.00mm single row") 4 | (fp_text reference ANT1 (at 0 -1.56) (layer F.SilkS) hide 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value Conn_01x01 (at 0 1.56) (layer F.Fab) hide 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (pad 1 thru_hole circle (at 0 0) (size 0.6 0.6) (drill 0.4) (layers *.Cu *.Mask) 11 | (clearance 0.7)) 12 | (model ${KISYS3DMOD}/Pin_Headers.3dshapes/Pin_Header_Straight_1x01_Pitch1.00mm.wrl 13 | (at (xyz 0 0 0)) 14 | (scale (xyz 1 1 1)) 15 | (rotate (xyz 0 0 0)) 16 | ) 17 | ) 18 | -------------------------------------------------------------------------------- /driver_pcb_2.0/rotunda.pretty/rotunda_base.kicad_mod: -------------------------------------------------------------------------------- 1 | (module "module" (layer F.Cu) (tedit 0) 2 | (fp_text reference "" (at 0 0) (layer F.SilkS) 3 | (effects (font (thickness 0.15))) 4 | ) 5 | (fp_text value "" (at 0 0) (layer F.SilkS) 6 | (effects (font (thickness 0.15))) 7 | ) 8 | (fp_poly (pts (xy -0.341064 -14.781526) 9 | (xy -8.413440 -12.158947) 10 | (xy -8.963794 -11.758454) 11 | (xy -13.953670 -4.891690) 12 | (xy -14.163476 -4.244701) 13 | (xy -14.163476 4.244703) 14 | (xy -13.953670 4.891692) 15 | (xy -8.963794 11.758455) 16 | (xy -8.413440 12.158950) 17 | (xy -0.341064 14.781529) 18 | (xy 0.341065 14.781529) 19 | (xy 8.413440 12.158950) 20 | (xy 8.963794 11.758455) 21 | (xy 7.698243 10.098093) 22 | (xy 7.225403 10.442258) 23 | (xy 0.292493 12.694315) 24 | (xy -0.292488 12.694315) 25 | (xy -7.225399 10.442258) 26 | (xy -7.698238 10.098093) 27 | (xy -11.983248 4.200778) 28 | (xy -12.163598 3.645256) 29 | (xy -12.163598 -3.645255) 30 | (xy -11.983248 -4.200776) 31 | (xy -7.698238 -10.098091) 32 | (xy -7.225399 -10.442256) 33 | (xy -0.292484 -12.694315) 34 | (xy 0.292493 -12.694315) 35 | (xy 7.225403 -10.442256) 36 | (xy 7.698243 -10.098091) 37 | (xy 11.983253 -4.200776) 38 | (xy 12.163603 -3.645255) 39 | (xy 12.163603 3.645256) 40 | (xy 11.983253 4.200778) 41 | (xy 7.698243 10.098093) 42 | (xy 8.963794 11.758455) 43 | (xy 13.953670 4.891692) 44 | (xy 14.163477 4.244703) 45 | (xy 14.163477 -4.244701) 46 | (xy 13.953670 -4.891690) 47 | (xy 8.963794 -11.758454) 48 | (xy 8.413440 -12.158947) 49 | (xy 0.341065 -14.781526) 50 | (xy -0.341064 -14.781526) 51 | ) (layer B.Mask) (width 0.000001)) 52 | (fp_poly (pts (xy -0.341064 -14.781527) 53 | (xy -8.413440 -12.158948) 54 | (xy -8.963794 -11.758455) 55 | (xy -7.698238 -10.098092) 56 | (xy -7.225399 -10.442257) 57 | (xy -0.292489 -12.694316) 58 | (xy 0.292489 -12.694316) 59 | (xy 7.225399 -10.442257) 60 | (xy 7.698238 -10.098092) 61 | (xy 11.983248 -4.200777) 62 | (xy 12.163598 -3.645256) 63 | (xy 12.163598 3.645256) 64 | (xy 11.983248 4.200777) 65 | (xy 7.698238 10.098092) 66 | (xy 7.225399 10.442257) 67 | (xy 0.292489 12.694316) 68 | (xy -0.292489 12.694316) 69 | (xy -7.225399 10.442257) 70 | (xy -7.698238 10.098092) 71 | (xy -11.983248 4.200777) 72 | (xy -12.163598 3.645256) 73 | (xy -12.163598 -3.645256) 74 | (xy -11.983248 -4.200777) 75 | (xy -7.698238 -10.098092) 76 | (xy -8.963794 -11.758455) 77 | (xy -13.953670 -4.891691) 78 | (xy -14.163476 -4.244702) 79 | (xy -14.163476 4.244702) 80 | (xy -13.953670 4.891691) 81 | (xy -8.963794 11.758455) 82 | (xy -8.413440 12.158948) 83 | (xy -0.341064 14.781527) 84 | (xy 0.341064 14.781527) 85 | (xy 8.413440 12.158948) 86 | (xy 8.963794 11.758455) 87 | (xy 13.953670 4.891691) 88 | (xy 14.163476 4.244702) 89 | (xy 14.163476 -4.244702) 90 | (xy 13.953670 -4.891691) 91 | (xy 8.963794 -11.758455) 92 | (xy 8.413440 -12.158948) 93 | (xy 0.341064 -14.781527) 94 | (xy -0.341064 -14.781527) 95 | ) (layer F.Mask) (width 0.000001)) 96 | ) 97 | -------------------------------------------------------------------------------- /driver_pcb_2.0/soic8.pretty/SO8E.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SO8E (layer F.Cu) (tedit 5527BFF7) 2 | (descr "module CMS SOJ 8 pins etroit") 3 | (tags "CMS SOJ") 4 | (attr smd) 5 | (fp_text reference IC1 (at 0 -0.889) (layer F.SilkS) hide 6 | (effects (font (size 1.143 1.143) (thickness 0.1524))) 7 | ) 8 | (fp_text value ATTINY85-S (at 0 1.016) (layer F.SilkS) hide 9 | (effects (font (size 0.889 0.889) (thickness 0.1524))) 10 | ) 11 | (pad 8 smd rect (at -1.905 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 12 | (pad 1 smd rect (at -1.905 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 13 | (pad 7 smd rect (at -0.635 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 14 | (pad 6 smd rect (at 0.635 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 15 | (pad 5 smd rect (at 1.905 -3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 16 | (pad 2 smd rect (at -0.635 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 17 | (pad 3 smd rect (at 0.635 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 18 | (pad 4 smd rect (at 1.905 3.5) (size 0.59944 2) (layers F.Cu F.Paste F.Mask)) 19 | (model smd/cms_so8.wrl 20 | (at (xyz 0 0 0)) 21 | (scale (xyz 0.5 0.32 0.5)) 22 | (rotate (xyz 0 0 0)) 23 | ) 24 | ) 25 | -------------------------------------------------------------------------------- /driver_pcb_2.0/sot.pretty/sot-563.kicad_mod: -------------------------------------------------------------------------------- 1 | (module sot-563 (layer F.Cu) (tedit 5AE8C889) 2 | (fp_text reference REF** (at 0 -7.5) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value sot-563 (at 0 7.5) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_circle (center -0.5 0.2) (end -0.4 0.3) (layer F.SilkS) (width 0.1)) 9 | (pad 6 smd rect (at -0.5 -0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 10 | (pad 5 smd rect (at 0 -0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 11 | (pad 4 smd rect (at 0.5 -0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 12 | (pad 3 smd rect (at 0.5 0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 13 | (pad 2 smd rect (at 0 0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 14 | (pad 1 smd rect (at -0.5 0.675) (size 0.3 0.45) (layers F.Cu F.Paste F.Mask)) 15 | ) 16 | -------------------------------------------------------------------------------- /driver_pcb_2.0/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name lipocharge-rescue)(type Legacy)(uri ${KIPRJMOD}/lipocharge-rescue.lib)(options "")(descr "")) 3 | (lib (name mcp73831)(type Legacy)(uri ${KIPRJMOD}/mcp73831.lib)(options "")(descr "")) 4 | (lib (name goodwatch21)(type Legacy)(uri ${KIPRJMOD}/goodwatch/goodwatch21.lib)(options "")(descr "")) 5 | (lib (name ncp170)(type Legacy)(uri ${KIPRJMOD}/ncp170.lib)(options "")(descr "")) 6 | ) 7 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball/cutting-.9mm.path: -------------------------------------------------------------------------------- 1 | m 237.33203,182.78516 -19.10547,3.61718 -5.37695,17.00391 -3.56445,17.48828 13.71484,11.42188 9.14062,6.11328 -13.4121,-3.94727 -17.56055,-3.19531 -12.125,15.20117 15.43164,11.0332 -18.38281,-4.74804 -3.86328,19.05859 13.59375,11.29883 0.0625,0.0606 14.90625,9.94336 15.75586,-8.38672 13.31054,-8.99414 14.86719,6.08398 0.70117,0.20313 -13.80469,5.61132 -0.0625,0.0312 -0.0234,0.0117 -15.66993,8.38477 -0.0371,17.84961 1.84766,17.7539 16.50781,6.7793 17.13282,5.00195 12.51953,-12.71875 10.00195,-12.57226 16.00781,1.33594 17.84375,-0.38477 8.11133,-15.89844 6.37891,-16.66797 -12.70117,-14.72265 -13.69336,13.13476 8.05859,-17.19531 -18.01758,-7.3125 -1.88281,1.55859 1.51562,-1.91015 -7.20117,-16.70508 6.94336,4.60937 15.73633,-8.42382 14.75391,-10.04297 -2.02344,-19.33789 -18.74219,2.96679 16.4336,-9.51757 -10.61719,-16.28907 -17.7793,1.50196 -17.52148,3.35937 -5.3418,17.03125 -2.11914,10.54883 -1.38867,-13.71484 -3.66992,-17.4668 -18.6543,-5.48633 -4.39063,18.45703 z m -159.999999,0 -19.105469,3.61718 -5.376953,17.00391 -3.564453,17.48828 L 63,232.31641 l 9.140625,6.11328 -13.412109,-3.94727 -17.560547,-3.19531 -12.125,15.20117 15.43164,11.0332 -18.382812,-4.74804 -3.863281,19.05859 13.59375,11.29883 0.0625,0.0606 14.90625,9.94336 15.755859,-8.38672 13.310547,-8.99414 14.867187,6.08398 0.701172,0.20313 -13.804687,5.61132 -0.0625,0.0312 -0.02344,0.0117 -15.669922,8.38477 -0.03711,17.84961 1.847656,17.7539 16.507813,6.7793 17.132819,5.00195 12.51953,-12.71875 10.00195,-12.57226 16.00781,1.33594 17.84375,-0.38477 8.11133,-15.89844 6.37891,-16.66797 -12.70117,-14.72265 -13.69336,13.13476 8.05859,-17.19531 -18.01758,-7.3125 -1.88281,1.55859 1.51562,-1.91015 -7.20117,-16.70508 6.94336,4.60937 15.73633,-8.42382 14.75391,-10.04297 -2.02344,-19.33789 -18.74219,2.96679 16.4336,-9.51757 -10.61719,-16.28907 -17.7793,1.50196 -17.52148,3.35937 -5.3418,17.03125 -2.11914,10.54883 -1.38867,-13.71484 -3.66992,-17.4668 -18.654305,-5.48633 -4.390625,18.45703 z M 237.33203,10.785156 218.22656,14.402344 212.84961,31.40625 209.28516,48.894531 223,60.316406 l 9.14062,6.113282 -13.4121,-3.947266 -17.56055,-3.195313 -12.125,15.201172 15.43164,11.033203 -18.38281,-4.748046 -3.86328,19.058593 13.59375,11.298829 0.0625,0.0606 14.90625,9.94336 15.75586,-8.38672 13.31054,-8.99414 14.86719,6.08398 0.70117,0.20313 -13.80469,5.61132 -0.0625,0.0312 -0.0234,0.0117 -15.66993,8.38477 -0.0371,17.84961 1.84766,17.7539 16.50781,6.7793 17.13282,5.00195 12.51953,-12.71875 10.00195,-12.57226 16.00781,1.33594 17.84375,-0.38477 8.11133,-15.89844 6.37891,-16.66797 -12.70117,-14.722652 -13.69336,13.134762 8.05859,-17.195309 -18.01758,-7.3125 -1.88281,1.558593 1.51562,-1.910156 -7.20117,-16.705078 6.94336,4.609375 15.73633,-8.423828 14.75391,-10.042969 -2.02344,-19.33789 -18.74219,2.966796 16.4336,-9.517578 -10.61719,-16.289062 -17.7793,1.501953 -17.52148,3.359375 -5.3418,17.03125 -2.11914,10.548828 -1.38867,-13.714844 -3.66992,-17.466797 -18.6543,-5.486328 -4.39063,18.457031 z m -159.999999,0 L 58.226562,14.402344 52.849609,31.40625 49.285156,48.894531 63,60.316406 l 9.140625,6.113282 -13.412109,-3.947266 -17.560547,-3.195313 -12.125,15.201172 15.43164,11.033203 -18.382812,-4.748046 -3.863281,19.058593 13.59375,11.298829 0.0625,0.0606 14.90625,9.94336 15.755859,-8.38672 13.310547,-8.99414 14.867187,6.08398 0.701172,0.20313 -13.804687,5.61132 -0.0625,0.0312 -0.02344,0.0117 -15.669922,8.38477 -0.03711,17.84961 1.847656,17.7539 16.507813,6.7793 17.132819,5.00195 12.51953,-12.71875 10.00195,-12.57226 16.00781,1.33594 17.84375,-0.38477 8.11133,-15.89844 6.37891,-16.66797 -12.70117,-14.722652 -13.69336,13.134762 8.05859,-17.195309 -18.01758,-7.3125 -1.88281,1.558593 1.51562,-1.910156 -7.20117,-16.705078 6.94336,4.609375 15.73633,-8.423828 14.75391,-10.042969 -2.02344,-19.33789 -18.74219,2.966796 16.4336,-9.517578 -10.61719,-16.289062 -17.7793,1.501953 -17.52148,3.359375 -5.3418,17.03125 L 107.98047,47.8125 106.5918,34.097656 102.92188,16.630859 84.267578,11.144531 79.876953,29.601562 Z 2 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball/cutting-1mm.path: -------------------------------------------------------------------------------- 1 | m 112.46338,294.29877 1.84387,5.86669 -13.28796,6.56624 z m -10.05615,-10.03801 7.59521,2.21008 1.73035,5.50598 z m 19.15649,-45.0844 5.13428,3.4076 -15.1648,7.50732 z m -44.080809,-56.59972 -1.834718,0.34607 -17.557983,3.32519 -5.410767,17.11487 -3.590698,17.6001 13.806153,11.49719 8.182983,5.47302 -12.30835,-3.62183 -17.673339,-3.21533 -12.306519,15.42664 14.80957,10.58898 -17.644043,-4.55566 -3.920288,19.34326 13.670655,11.36352 0.06775,0.0678 15.007325,10.01037 15.858764,-8.44116 13.238526,-8.9447 14.787595,6.05164 0.219731,0.0641 -13.267824,5.39246 -0.07324,0.0293 -0.09155,0.0458 -15.76538,8.4375 -0.03845,17.96263 1.862183,17.8674 16.613159,6.8244 17.243044,5.0354 12.60132,-12.8028 9.94811,-12.5042 15.92286,1.3275 17.95898,-0.3864 8.16467,-15.9997 6.41968,-16.77613 -12.89245,-14.94324 -13.14148,12.60315 7.73437,-16.50147 -18.28857,-7.42309 -0.66285,0.54931 0.53101,-0.67016 -7.00378,-16.25244 6.5332,4.33593 15.8368,-8.47778 14.84802,-10.10558 -2.05262,-19.63075 -17.98462,2.84546 15.77088,-9.1333 -10.77759,-16.53259 -17.89307,1.50879 -17.63488,3.38379 -5.37781,17.13867 -1.88782,9.40613 -1.27258,-12.55372 -3.69324,-17.57812 -18.934936,-5.57006 -4.213257,17.71179 z m 194.979859,111.72013 1.8457,5.86852 -13.2898,6.56621 z m -10.05798,-10.03801 7.59888,2.21192 1.73034,5.50781 z m 19.15832,-45.0824 5.13428,3.4076 -15.16297,7.50732 z m -44.08081,-56.59972 -1.83472,0.34607 -17.55798,3.32519 -5.41077,17.11487 -3.58886,17.6001 13.80432,11.49719 8.18298,5.47302 -12.30835,-3.62183 -17.67334,-3.21533 -12.30652,15.42664 14.81141,10.58898 -17.64588,-4.55566 -3.92029,19.34326 13.66882,11.36352 0.0696,0.0678 15.00732,10.01037 15.85877,-8.44116 13.23852,-8.9447 14.78943,6.05164 0.21789,0.0641 -13.33557,5.41992 0.0439,-0.022 -0.0293,0.009 -15.87524,8.49792 -0.0385,17.96265 1.85852,17.8674 16.61683,6.8244 17.24304,5.0354 12.59948,-12.8028 9.94813,-12.5042 15.92468,1.3275 17.95716,-0.3864 8.16466,-15.9997 6.41969,-16.77615 -12.89247,-14.94324 -13.14148,12.60315 7.73438,-16.50147 -18.28857,-7.42309 -0.66284,0.54931 0.531,-0.67016 -7.00379,-16.25427 6.53504,4.33776 15.83496,-8.47778 14.85169,-10.10558 -2.05628,-19.63075 -17.98461,2.84546 15.77087,-9.1333 -10.77759,-16.53259 -17.89307,1.50879 -17.63489,3.38379 -5.3778,17.13867 -1.88782,9.40979 -1.27258,-12.55738 -3.69324,-17.57812 -18.9331,-5.57006 -4.2151,17.71362 z m 34.98047,-60.28033 1.8457,5.86853 -13.2898,6.56616 z m -10.05798,-10.03801 7.59888,2.21191 1.73034,5.50782 z m 19.15832,-45.0824 5.13428,3.4076 -15.16297,7.50732 z m -44.08081,-56.59973 -1.83472,0.34607 -17.55798,3.3252 -5.41077,17.11486 -3.58886,17.6001 13.80432,11.49719 8.18298,5.47303 -12.30835,-3.62183 -17.67334,-3.21533 -12.30652,15.42663 14.81141,10.58899 -17.64588,-4.55566 -3.92029,19.34326 13.66882,11.36353 0.0696,0.0677 15.00732,10.01038 15.85877,-8.44116 13.23852,-8.94287 14.78943,6.0498 0.21789,0.0641 -13.33557,5.41992 0.0439,-0.022 -0.0293,0.009 -15.87524,8.49793 -0.0385,17.96265 1.85852,17.86742 16.61683,6.82435 17.24304,5.0354 12.59948,-12.80274 9.94813,-12.50427 15.92468,1.32752 17.95716,-0.38636 8.16466,-15.99976 6.41969,-16.77612 -12.89247,-14.94323 -13.14148,12.60315 7.73438,-16.50146 -18.28857,-7.4231 -0.66284,0.54931 0.531,-0.67016 -7.00379,-16.25428 6.53504,4.33777 15.83496,-8.47778 14.85169,-10.10559 -2.05628,-19.63074 -17.98461,2.84546 15.77087,-9.1333 -10.77759,-16.53259 -17.89307,1.50879 -17.63489,3.38379 -5.3778,17.13867 -1.88782,9.40979 -1.27258,-12.55738 -3.69324,-17.57812 -18.9331,-5.57007 -4.2151,17.71362 z m -159.999389,0 -1.834718,0.34607 -17.557983,3.3252 -5.410767,17.11486 -3.590698,17.6001 13.806153,11.49719 8.182983,5.47303 -12.30835,-3.62183 -17.673339,-3.21533 -12.306519,15.42663 14.80957,10.58899 -17.644043,-4.55566 -3.920288,19.34326 13.670655,11.36353 0.06775,0.0677 15.007325,10.01038 15.858764,-8.44116 13.238526,-8.94287 14.787595,6.0498 0.219731,0.0641 -13.267824,5.39246 -0.07324,0.0293 -0.08972,0.0439 -15.767212,8.43933 -0.03845,17.96265 1.862183,17.86742 16.613159,6.82435 17.243046,5.0354 12.60132,-12.80274 9.94811,-12.50427 15.92286,1.32752 17.95898,-0.38636 8.16467,-15.99976 6.41968,-16.77612 -12.89245,-14.94323 -13.14148,12.60315 7.73437,-16.50146 -18.28857,-7.4231 -0.66285,0.54931 0.53101,-0.67016 -7.00378,-16.25244 6.5332,4.33593 15.8368,-8.47778 14.84802,-10.10559 -2.05262,-19.63074 -17.98462,2.84546 15.77088,-9.1333 -10.77759,-16.53259 -17.89307,1.50879 -17.63488,3.38379 -5.37781,17.13867 -1.88782,9.40613 -1.27258,-12.55372 -3.69324,-17.57812 -18.934938,-5.57007 -4.213257,17.71179 z m 44.080809,56.59973 5.13428,3.4076 -15.1648,7.50732 z m -19.15649,45.08423 7.59521,2.21008 1.73035,5.50599 z m 10.05615,10.03784 1.84387,5.8667 -13.28796,6.56616 z 2 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_center_holes.ngc: -------------------------------------------------------------------------------- 1 | G17 2 | G90 3 | G91.1 4 | G21 5 | G17 G64 P0.0001 M3 S3000 6 | G0 Z2.000000 7 | G0 X26.323000 Y39.663000 8 | G0 Z0.200000 9 | G1 F100.000000 Z-1.000000 10 | G0 Z2.000000 11 | G0 X39.710000 Y33.881000 12 | G0 Z0.200000 13 | G1 F100.000000 Z-1.000000 14 | G0 Z2.000000 15 | G0 X14.786000 Y25.179000 16 | G0 Z0.200000 17 | G1 F100.000000 Z-1.000000 18 | G0 Z2.000000 19 | G0 X29.288000 Y23.682000 20 | G0 Z0.200000 21 | G1 F100.000000 Z-1.000000 22 | G0 Z2.000000 23 | G0 X22.421000 Y10.815000 24 | G0 Z0.200000 25 | G1 F100.000000 Z-1.000000 26 | G0 Z2.000000 27 | G0 X38.579000 Y12.445000 28 | G0 Z0.200000 29 | G1 F100.000000 Z-1.000000 30 | G0 Z2.000000 31 | G0 X71.482000 Y30.660000 32 | G0 Z0.200000 33 | G1 F100.000000 Z-1.000000 34 | G0 Z2.000000 35 | G0 X84.869000 Y24.878000 36 | G0 Z0.200000 37 | G1 F100.000000 Z-1.000000 38 | G0 Z2.000000 39 | G0 X59.945000 Y16.176000 40 | G0 Z0.200000 41 | G1 F100.000000 Z-1.000000 42 | G0 Z2.000000 43 | G0 X74.447000 Y14.679000 44 | G0 Z0.200000 45 | G1 F100.000000 Z-1.000000 46 | G0 Z2.000000 47 | G0 X67.580000 Y1.812000 48 | G0 Z0.200000 49 | G1 F100.000000 Z-1.000000 50 | G0 Z2.000000 51 | G0 X83.738000 Y3.442000 52 | G0 Z0.200000 53 | G1 F100.000000 Z-1.000000 54 | G0 Z2.000000 55 | G0 X26.323000 Y88.204000 56 | G0 Z0.200000 57 | G1 F100.000000 Z-1.000000 58 | G0 Z2.000000 59 | G0 X39.710000 Y82.422000 60 | G0 Z0.200000 61 | G1 F100.000000 Z-1.000000 62 | G0 Z2.000000 63 | G0 X14.786000 Y73.720000 64 | G0 Z0.200000 65 | G1 F100.000000 Z-1.000000 66 | G0 Z2.000000 67 | G0 X29.288000 Y72.223000 68 | G0 Z0.200000 69 | G1 F100.000000 Z-1.000000 70 | G0 Z2.000000 71 | G0 X22.421000 Y59.356000 72 | G0 Z0.200000 73 | G1 F100.000000 Z-1.000000 74 | G0 Z2.000000 75 | G0 X38.579000 Y60.986000 76 | G0 Z0.200000 77 | G1 F100.000000 Z-1.000000 78 | G0 Z2.000000 79 | G0 X71.482000 Y88.204000 80 | G0 Z0.200000 81 | G1 F100.000000 Z-1.000000 82 | G0 Z2.000000 83 | G0 X84.869000 Y82.422000 84 | G0 Z0.200000 85 | G1 F100.000000 Z-1.000000 86 | G0 Z2.000000 87 | G0 X59.945000 Y73.720000 88 | G0 Z0.200000 89 | G1 F100.000000 Z-1.000000 90 | G0 Z2.000000 91 | G0 X74.447000 Y72.223000 92 | G0 Z0.200000 93 | G1 F100.000000 Z-1.000000 94 | G0 Z2.000000 95 | G0 X67.580000 Y59.356000 96 | G0 Z0.200000 97 | G1 F100.000000 Z-1.000000 98 | G0 Z2.000000 99 | G0 X83.738000 Y60.986000 100 | G0 Z0.200000 101 | G1 F100.000000 Z-1.000000 102 | G0 Z40.000000 103 | M5 104 | M2 105 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_center_holes.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from pathtogcode import * 4 | 5 | DRILL_DEPTH=-1 6 | 7 | centers_first = [ (26.323, 60.337), (39.710, 66.119), (14.786, 74.821), (29.288, 76.318), (22.421, 89.185), (38.579, 87.555) ] 8 | copies = [ (26.323, 60.337), (71.482, 69.340), (26.323, 11.796), (71.482, 11.796) ] 9 | 10 | offx, offy = copies[0] 11 | offsets = [ (x-offx, y-offy) for x, y in copies ] 12 | holes = [ (dx+x, dy+y) for dx,dy in offsets for x, y in centers_first ] 13 | 14 | # translate from inkscape to svg coords 15 | holes = [ (x, 100-y) for x, y in holes ] 16 | 17 | print_gcode_start() 18 | #print_gcode_from_svg(paths) 19 | 20 | for x, y in holes: 21 | move(x, y, DRILL_DEPTH) 22 | 23 | print_gcode_end() 24 | 25 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_cuts.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from pathtogcode import * 4 | 5 | DRILL_DEPTH=-1 6 | 7 | paths = [ 8 | 9 | # depth speed filename 10 | (-1, 500, "microball/cutting-.9mm.path"), 11 | ] 12 | 13 | print_gcode_start() 14 | print_gcode_from_svg(paths) 15 | print_gcode_end() 16 | 17 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_grooves.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from pathtogcode import * 4 | 5 | GROOVE_DEPTH=-.6 6 | 7 | paths = [ 8 | 9 | # depth speed filename 10 | (GROOVE_DEPTH, 500, "microball/grooves.path"), 11 | ] 12 | 13 | print_gcode_start() 14 | print_gcode_from_svg(paths) 15 | print_gcode_end() 16 | 17 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_jig.ngc: -------------------------------------------------------------------------------- 1 | G17 2 | G90 3 | G91.1 4 | G21 5 | G17 G64 P0.0001 M3 S3000 6 | G0 Z2.000000 7 | G0 X3.000000 Y3.000000 8 | G0 Z0.200000 9 | G1 F100.000000 Z-2.000000 10 | G1 F500.000000 X97.000000 Y3.000000 Z-2.000000 11 | G1 F500.000000 X97.000000 Y97.000000 Z-2.000000 12 | G1 F500.000000 X3.000000 Y97.000000 Z-2.000000 13 | G1 F500.000000 X3.000000 Y5.400000 Z-2.000000 14 | G1 F500.000000 X94.600000 Y5.400000 Z-2.000000 15 | G1 F500.000000 X94.600000 Y94.600000 Z-2.000000 16 | G1 F500.000000 X5.400000 Y94.600000 Z-2.000000 17 | G1 F500.000000 X5.400000 Y7.800000 Z-2.000000 18 | G1 F500.000000 X92.200000 Y7.800000 Z-2.000000 19 | G1 F500.000000 X92.200000 Y92.200000 Z-2.000000 20 | G1 F500.000000 X7.800000 Y92.200000 Z-2.000000 21 | G1 F500.000000 X7.800000 Y10.200000 Z-2.000000 22 | G1 F500.000000 X89.800000 Y10.200000 Z-2.000000 23 | G1 F500.000000 X89.800000 Y89.800000 Z-2.000000 24 | G1 F500.000000 X10.200000 Y89.800000 Z-2.000000 25 | G1 F500.000000 X10.200000 Y12.600000 Z-2.000000 26 | G1 F500.000000 X87.400000 Y12.600000 Z-2.000000 27 | G1 F500.000000 X87.400000 Y87.400000 Z-2.000000 28 | G1 F500.000000 X12.600000 Y87.400000 Z-2.000000 29 | G1 F500.000000 X12.600000 Y15.000000 Z-2.000000 30 | G1 F500.000000 X85.000000 Y15.000000 Z-2.000000 31 | G1 F500.000000 X85.000000 Y85.000000 Z-2.000000 32 | G1 F500.000000 X15.000000 Y85.000000 Z-2.000000 33 | G1 F500.000000 X15.000000 Y17.400000 Z-2.000000 34 | G1 F500.000000 X82.600000 Y17.400000 Z-2.000000 35 | G1 F500.000000 X82.600000 Y82.600000 Z-2.000000 36 | G1 F500.000000 X17.400000 Y82.600000 Z-2.000000 37 | G1 F500.000000 X17.400000 Y19.800000 Z-2.000000 38 | G1 F500.000000 X80.200000 Y19.800000 Z-2.000000 39 | G1 F500.000000 X80.200000 Y80.200000 Z-2.000000 40 | G1 F500.000000 X19.800000 Y80.200000 Z-2.000000 41 | G1 F500.000000 X19.800000 Y22.200000 Z-2.000000 42 | G1 F500.000000 X77.800000 Y22.200000 Z-2.000000 43 | G1 F500.000000 X77.800000 Y77.800000 Z-2.000000 44 | G1 F500.000000 X22.200000 Y77.800000 Z-2.000000 45 | G1 F500.000000 X22.200000 Y24.600000 Z-2.000000 46 | G1 F500.000000 X75.400000 Y24.600000 Z-2.000000 47 | G1 F500.000000 X75.400000 Y75.400000 Z-2.000000 48 | G1 F500.000000 X24.600000 Y75.400000 Z-2.000000 49 | G1 F500.000000 X24.600000 Y27.000000 Z-2.000000 50 | G1 F500.000000 X73.000000 Y27.000000 Z-2.000000 51 | G1 F500.000000 X73.000000 Y73.000000 Z-2.000000 52 | G1 F500.000000 X27.000000 Y73.000000 Z-2.000000 53 | G1 F500.000000 X27.000000 Y29.400000 Z-2.000000 54 | G1 F500.000000 X70.600000 Y29.400000 Z-2.000000 55 | G1 F500.000000 X70.600000 Y70.600000 Z-2.000000 56 | G1 F500.000000 X29.400000 Y70.600000 Z-2.000000 57 | G1 F500.000000 X29.400000 Y31.800000 Z-2.000000 58 | G1 F500.000000 X68.200000 Y31.800000 Z-2.000000 59 | G1 F500.000000 X68.200000 Y68.200000 Z-2.000000 60 | G1 F500.000000 X31.800000 Y68.200000 Z-2.000000 61 | G1 F500.000000 X31.800000 Y34.200000 Z-2.000000 62 | G1 F500.000000 X65.800000 Y34.200000 Z-2.000000 63 | G1 F500.000000 X65.800000 Y65.800000 Z-2.000000 64 | G1 F500.000000 X34.200000 Y65.800000 Z-2.000000 65 | G1 F500.000000 X34.200000 Y36.600000 Z-2.000000 66 | G1 F500.000000 X63.400000 Y36.600000 Z-2.000000 67 | G1 F500.000000 X63.400000 Y63.400000 Z-2.000000 68 | G1 F500.000000 X36.600000 Y63.400000 Z-2.000000 69 | G1 F500.000000 X36.600000 Y39.000000 Z-2.000000 70 | G1 F500.000000 X61.000000 Y39.000000 Z-2.000000 71 | G1 F500.000000 X61.000000 Y61.000000 Z-2.000000 72 | G1 F500.000000 X39.000000 Y61.000000 Z-2.000000 73 | G1 F500.000000 X39.000000 Y41.400000 Z-2.000000 74 | G1 F500.000000 X58.600000 Y41.400000 Z-2.000000 75 | G1 F500.000000 X58.600000 Y58.600000 Z-2.000000 76 | G1 F500.000000 X41.400000 Y58.600000 Z-2.000000 77 | G1 F500.000000 X41.400000 Y43.800000 Z-2.000000 78 | G1 F500.000000 X56.200000 Y43.800000 Z-2.000000 79 | G1 F500.000000 X56.200000 Y56.200000 Z-2.000000 80 | G1 F500.000000 X43.800000 Y56.200000 Z-2.000000 81 | G1 F500.000000 X43.800000 Y46.200000 Z-2.000000 82 | G1 F500.000000 X53.800000 Y46.200000 Z-2.000000 83 | G1 F500.000000 X53.800000 Y53.800000 Z-2.000000 84 | G1 F500.000000 X46.200000 Y53.800000 Z-2.000000 85 | G1 F500.000000 X46.200000 Y48.600000 Z-2.000000 86 | G1 F500.000000 X51.400000 Y48.600000 Z-2.000000 87 | G1 F500.000000 X51.400000 Y51.400000 Z-2.000000 88 | G1 F500.000000 X48.600000 Y51.400000 Z-2.000000 89 | G0 Z2.000000 90 | G0 X0.000000 Y0.000000 91 | G0 Z0.200000 92 | G1 F100.000000 Z-2.000000 93 | G0 Z2.000000 94 | G0 X100.000000 Y0.000000 95 | G0 Z0.200000 96 | G1 F100.000000 Z-2.000000 97 | G0 Z2.000000 98 | G0 X100.000000 Y100.000000 99 | G0 Z0.200000 100 | G1 F100.000000 Z-2.000000 101 | G0 Z2.000000 102 | G0 X0.000000 Y100.000000 103 | G0 Z0.200000 104 | G1 F100.000000 Z-2.000000 105 | G0 Z40.000000 106 | M5 107 | M2 108 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_jig.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from pathtogcode import * 4 | 5 | paths = [ 6 | 7 | # depth speed filename 8 | (-2, 500, "microball_jig/zigzag.path"), 9 | (-2, 100, "microball_jig/circles.path"), 10 | (-2, 500, "microball_jig/outline.path"), 11 | ] 12 | 13 | print_gcode_start() 14 | #print_gcode_from_svg(paths) 15 | route_path( fill_square(0,0,100,100,6), -2, 500 ) 16 | move(0, 0, -2) 17 | move(100, 0, -2) 18 | move(100, 100, -2) 19 | move(0, 100, -2) 20 | 21 | #move(5, 5, -4) 22 | #move(95, 0, -4) 23 | #move(95, 95, -4) 24 | #move(0, 95, -4) 25 | 26 | print_gcode_end() 27 | 28 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_jig/circles.path: -------------------------------------------------------------------------------- 1 | m 336.61377,317.12586 c -10.76282,1.5e-4 -19.48776,8.72509 -19.48791,19.48791 1.5e-4,10.76282 8.72509,19.48777 19.48791,19.48792 10.76282,-1.5e-4 19.48777,-8.7251 19.48792,-19.48792 -1.5e-4,-10.76282 -8.7251,-19.48776 -19.48792,-19.48791 z m -318.896484,0 c -10.7635312,-8.7e-4 -19.4895953,8.72438 -19.4897469,19.48791 1.517e-4,10.76353 8.7262157,19.48878 19.4897469,19.48792 10.762815,-1.5e-4 19.487762,-8.7251 19.487914,-19.48792 -1.52e-4,-10.76282 -8.725099,-19.48776 -19.487914,-19.48791 z M 336.61377,-1.7724609 c -10.76353,1.517e-4 -19.48878,8.7262157 -19.48791,19.4897469 1.5e-4,10.762815 8.72509,19.487762 19.48791,19.487914 10.76282,-1.52e-4 19.48777,-8.725099 19.48792,-19.487914 8.6e-4,-10.7635312 -8.72439,-19.4895953 -19.48792,-19.4897469 z m -318.896484,0 C 6.9530398,-1.7733205 -1.7733205,6.9530398 -1.7724609,17.717286 -1.7723088,28.480816 6.9537552,37.20606 17.717286,37.2052 28.480101,37.205048 37.205048,28.480101 37.2052,17.717286 37.20606,6.9537552 28.480816,-1.7723088 17.717286,-1.7724609 Z 2 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_jig/outline.path: -------------------------------------------------------------------------------- 1 | M 42.518921,14.172364 V 42.518921 H 14.172364 V 311.81031 h 28.346557 v 28.34655 H 311.81031 v -28.34655 h 28.34655 V 42.518921 H 311.81031 V 14.172364 Z 2 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_jig/zigzag.path: -------------------------------------------------------------------------------- 1 | M 35.433071,38.97638 H 318.89764 V 60.236222 H 35.433071 V 81.496068 H 318.89764 V 102.75591 H 35.433071 v 21.25984 H 318.89764 v 21.25984 H 35.433071 v 21.25985 H 318.89764 v 21.25984 H 35.433071 v 21.25984 H 318.89764 v 21.25984 H 35.433071 V 251.5748 H 318.89764 v 21.25985 H 35.433071 v 21.25984 H 318.89764 v 21.25984 H 35.433071 2 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_jig_holes.ngc: -------------------------------------------------------------------------------- 1 | G17 2 | G90 3 | G91.1 4 | G21 5 | G17 G64 P0.0001 M3 S3000 6 | G0 Z2.000000 7 | G0 X5.000000 Y5.000000 8 | G0 Z0.200000 9 | G1 F100.000000 Z-4.000000 10 | G0 Z2.000000 11 | G0 X95.000000 Y0.000000 12 | G0 Z0.200000 13 | G1 F100.000000 Z-4.000000 14 | G0 Z2.000000 15 | G0 X95.000000 Y95.000000 16 | G0 Z0.200000 17 | G1 F100.000000 Z-4.000000 18 | G0 Z2.000000 19 | G0 X0.000000 Y95.000000 20 | G0 Z0.200000 21 | G1 F100.000000 Z-4.000000 22 | G0 Z40.000000 23 | M5 24 | M2 25 | -------------------------------------------------------------------------------- /gen/pathtogcode/microball_jig_holes.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from pathtogcode import * 4 | 5 | paths = [ 6 | 7 | # depth speed filename 8 | (-2, 500, "microball_jig/zigzag.path"), 9 | (-2, 100, "microball_jig/circles.path"), 10 | (-2, 500, "microball_jig/outline.path"), 11 | ] 12 | 13 | print_gcode_start() 14 | #print_gcode_from_svg(paths) 15 | #route_path( fill_square(0,0,100,100,6), -2, 500 ) 16 | #move(0, 0, -2) 17 | #move(100, 0, -2) 18 | #move(100, 100, -2) 19 | #move(0, 100, -2) 20 | 21 | move(5, 5, -4) 22 | move(95, 0, -4) 23 | move(95, 95, -4) 24 | move(0, 95, -4) 25 | 26 | print_gcode_end() 27 | 28 | -------------------------------------------------------------------------------- /gen/pathtogcode/pathtogcode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import svgpath 4 | 5 | ROUTE_SPEED=100 6 | ROUTE_Z_SPEED=20 7 | 8 | BASE=0. 9 | 10 | ROUTE_MARGIN=0.2 11 | MOVE_MARGIN=2. 12 | 13 | ROUTE_TOP_Z=BASE+ROUTE_MARGIN 14 | 15 | MOVE_Z=BASE+MOVE_MARGIN 16 | 17 | ROUTE_Z=BASE-2 18 | 19 | END_Z=40 20 | 21 | def up(): 22 | print "G0 Z%f" % (MOVE_Z,) 23 | 24 | def down(z): 25 | print "G0 Z%f" % (ROUTE_TOP_Z,) 26 | print "G1 F%f Z%f" % (ROUTE_Z_SPEED, z) 27 | 28 | def move_unsafe(x, y, z): 29 | print "G0 X%f Y%f Z%f" % (x, y, z) 30 | 31 | def move_unsafe_xy(x, y): 32 | print "G0 X%f Y%f" % (x, y) 33 | 34 | def route(x, y, z, speed=ROUTE_SPEED): 35 | print "G1 F%f X%f Y%f Z%f" % (speed, x, y, z) 36 | 37 | def move(x, y, z): 38 | up() 39 | move_unsafe_xy(x, y) 40 | down(z) 41 | 42 | def end(): 43 | print "G0 Z%f" % (END_Z,) 44 | 45 | def route_path(path, z, speed): 46 | if len(path) == 0: 47 | return 48 | 49 | x, y = path[0] 50 | move(x, y, z) 51 | for coord in path[1:]: 52 | x, y = coord 53 | route(x, y, z, speed) 54 | 55 | def fill_square(x, y, w, h, milldiameter, overlapratio=.6): 56 | millradius = milldiameter/2. 57 | d=milldiameter*(1-overlapratio) 58 | x1, x2 = x+millradius, x+w-millradius 59 | y1, y2 = y+millradius, y+h-millradius 60 | poly = [] 61 | if x1 > x2 or y1 > y2: 62 | return poly 63 | 64 | poly.append( (x1, y1) ) 65 | 66 | while True: 67 | poly.append( (x2, y1) ) 68 | y1 += d 69 | if y1 >= y2: 70 | break 71 | 72 | poly.append( (x2, y2) ) 73 | x2 -= d 74 | if x1 >= x2: 75 | break 76 | 77 | poly.append( (x1, y2) ) 78 | y2 -= d 79 | if y1 >= y2: 80 | break 81 | 82 | poly.append( (x1, y1) ) 83 | x1 += d 84 | if x1 >= x2: 85 | break 86 | 87 | return poly 88 | 89 | def voodoo_spell(): 90 | """prologue: I have no clue what this does""" 91 | print "G17" 92 | print "G90" 93 | print "G91.1" 94 | print "G21" 95 | print "G17 G64 P0.0001 M3 S3000" 96 | 97 | def kthxbye(): 98 | """epilogue: I have no clue what this does""" 99 | print "M5" 100 | print "M2" 101 | 102 | 103 | def readall(f): 104 | d=r=f.read() 105 | while True: 106 | r=f.read() 107 | if r == '': 108 | return d 109 | d=d+r 110 | 111 | def load_svg_path(filename, scale=25.4/90., translate=(0,0), flipX=False, flipY=False): 112 | with open(filename) as f: 113 | polygons = svgpath.path_to_polygons(readall(f)) 114 | polygons = svgpath.transform_polygon_list(polygons, scale=scale, translate=translate, flipX=flipX, flipY=flipY, conv=float) 115 | return polygons 116 | 117 | def print_gcode_start(): 118 | voodoo_spell() 119 | 120 | def print_gcode_end(): 121 | end() 122 | kthxbye() 123 | 124 | def print_gcode_from_svg(paths, scale=25.4/90., translate=(0,0), flipX=False, flipY=False): 125 | 126 | for depth, speed, filename in paths: 127 | polygons = load_svg_path(filename, scale, translate, flipX, flipY) 128 | for p in polygons: 129 | route_path(p, depth, speed) 130 | 131 | -------------------------------------------------------------------------------- /gen/pathtogcode/svgpath.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys, math, itertools 4 | 5 | cubic_sections = 32 6 | 7 | in_dpi, out_dpi = 90., 10000. 8 | scale = out_dpi/in_dpi 9 | new_scale = 25400/in_dpi 10 | 11 | def roundint(x): 12 | return int(round(x)) 13 | 14 | def dist(a, b): 15 | ax, ay = a 16 | bx, by = b 17 | return math.sqrt((ax-bx)**2 + (ay-by)**2) 18 | 19 | def interpolate(pos1, pos2, d): 20 | x1, y1 = pos1 21 | x2, y2 = pos2 22 | return ( x1*(1-d) + x2*d, y1*(1-d) + y2*d ) 23 | 24 | def vector_add(a, b): 25 | return tuple( i+j for i, j in zip(a,b) ) 26 | 27 | def vector_sub(a, b): 28 | return tuple( i-j for i, j in zip(a,b) ) 29 | 30 | def cubic_spline( start, guide1, guide2, end ): 31 | n = min(int(dist(start, end)*scale/40.)+1, cubic_sections) 32 | 33 | v = [] 34 | for i in xrange(1, n+1): 35 | d = i/float(n) 36 | a = interpolate(start, guide1, d) 37 | b = interpolate(guide1, guide2, d) 38 | c = interpolate(guide2, end, d) 39 | 40 | ab = interpolate(a, b, d) 41 | bc = interpolate(b, c, d) 42 | abc = interpolate(ab, bc, d) 43 | v.append(abc) 44 | return v 45 | 46 | def get_coords(s): 47 | return map(float, s) 48 | 49 | def path_to_polygons(data): 50 | 51 | values = (x for x in data.replace(',', ' ').replace('\n',' ').split(' ') if x != '' ) 52 | 53 | mode = 'z' 54 | pos = (0.,0.) 55 | 56 | polygons = [] 57 | p = [] 58 | 59 | for x in values: 60 | 61 | if x in 'zZ': 62 | pos = p[0] 63 | p.append( pos ) 64 | 65 | if x in 'zZmM': 66 | if len(p) > 0: 67 | polygons.append( p ) 68 | p = [] 69 | 70 | if x in 'zZmclMCLhHvV': 71 | mode = x 72 | continue 73 | 74 | if mode == 'm': 75 | mode = 'l' 76 | 77 | if mode == 'M': 78 | mode = 'L' 79 | 80 | if mode == 'l': 81 | pos = vector_add(pos, get_coords((x, values.next()))) 82 | p.append( pos ) 83 | 84 | elif mode == 'L': 85 | pos = get_coords((x, values.next())) 86 | p.append( pos ) 87 | 88 | elif mode == 'H': 89 | pos = ( float(x), pos[1] ) 90 | p.append( pos ) 91 | 92 | elif mode == 'V': 93 | pos = ( pos[0], float(x) ) 94 | p.append( pos ) 95 | 96 | elif mode == 'h': 97 | pos = vector_add(pos, [float(x), 0]) 98 | p.append( pos ) 99 | 100 | elif mode == 'v': 101 | pos = vector_add(pos, [0, float(x)]) 102 | p.append( pos ) 103 | 104 | elif mode in 'cC': 105 | start = pos 106 | guide1 = get_coords( (x, values.next()) ) 107 | guide2 = get_coords( (values.next(), values.next()) ) 108 | end = get_coords( (values.next(), values.next()) ) 109 | 110 | if mode == 'c': 111 | guide1 = vector_add(pos, guide1) 112 | guide2 = vector_add(pos, guide2) 113 | end = vector_add(pos, end) 114 | 115 | pos = end 116 | p.extend( cubic_spline(start, guide1, guide2, end) ) 117 | else: 118 | print "ERROR: " + x 119 | sys.exit(1) 120 | 121 | if len(p) > 0: 122 | polygons.append( p ) 123 | 124 | return polygons 125 | 126 | def rescale_point(p, scale, conv=lambda x: x): 127 | x, y = p 128 | return ( conv(x*scale), conv(y*scale) ) 129 | 130 | def rescale_polygon(polygon, scale, conv=lambda x: x): 131 | return [ rescale_point(p, scale, conv) for p in polygon ] 132 | 133 | def rescale_polygon_list(polygon_list, scale, conv=lambda x: x): 134 | return [ rescale_polygon(polygon, scale, conv) for polygon in polygon_list ] 135 | 136 | 137 | def transform_point(p, scale, translate, flipX, flipY, conv): 138 | x, y = p 139 | dx, dy = translate 140 | scaleX, scaleY = scale, scale 141 | if flipX: 142 | scaleX = -scaleX 143 | if flipY: 144 | scaleY = -scaleY 145 | return ( conv(dx+(x*scaleX)), conv(dy+(y*scaleY)) ) 146 | 147 | def transform_polygon(polygon, scale, translate, flipX, flipY, conv): 148 | return [ transform_point(p, scale, translate, flipX, flipY, conv) for p in polygon ] 149 | 150 | def transform_polygon_list(polygon_list, scale, translate=(0,0), flipX=False, flipY=False, conv=lambda x: x): 151 | return [ transform_polygon(polygon, scale, translate, flipX, flipY, conv) for polygon in polygon_list ] 152 | 153 | def translate_polygon(polygon_list, translate): 154 | dx, dy = translate 155 | return [ (x+dx, y+dy) for x, y in polygon ] 156 | 157 | def translate_polygon_list(polygon_list, translate): 158 | return [ translate_polygon(polygon, translate) for polygon in polygon_list ] 159 | 160 | -------------------------------------------------------------------------------- /gen/pathtokicad/microball.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from pathtokicad import * 4 | 5 | fill_paths = [ 6 | 7 | (FRONT_MASK, "microball/mask_top.path"), # soldermask front 8 | (FRONT_COPPER, "microball/copper_top.path"), 9 | (BACK_COPPER, "microball/copper_bottom.path"), 10 | (BACK_MASK, "microball/mask_bottom.path"), 11 | (FRONT_PASTE, "microball/paste.path"), 12 | ] 13 | 14 | segment_paths = [ 15 | ] 16 | 17 | pads = [ 18 | ] 19 | 20 | print_module("microball", fill_paths, segment_paths, pads) 21 | 22 | -------------------------------------------------------------------------------- /gen/pathtokicad/svgpath.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys, math, itertools 4 | 5 | cubic_sections = 32 6 | 7 | in_dpi, out_dpi = 90., 10000. 8 | scale = out_dpi/in_dpi 9 | new_scale = 25400/in_dpi 10 | 11 | def roundint(x): 12 | return int(round(x)) 13 | 14 | def dist(a, b): 15 | ax, ay = a 16 | bx, by = b 17 | return math.sqrt((ax-bx)**2 + (ay-by)**2) 18 | 19 | def interpolate(pos1, pos2, d): 20 | x1, y1 = pos1 21 | x2, y2 = pos2 22 | return ( x1*(1-d) + x2*d, y1*(1-d) + y2*d ) 23 | 24 | def vector_add(a, b): 25 | return tuple( i+j for i, j in zip(a,b) ) 26 | 27 | def vector_sub(a, b): 28 | return tuple( i-j for i, j in zip(a,b) ) 29 | 30 | def cubic_spline( start, guide1, guide2, end ): 31 | n = min(int(dist(start, end)*scale/40.)+1, cubic_sections) 32 | 33 | v = [] 34 | for i in xrange(1, n+1): 35 | d = i/float(n) 36 | a = interpolate(start, guide1, d) 37 | b = interpolate(guide1, guide2, d) 38 | c = interpolate(guide2, end, d) 39 | 40 | ab = interpolate(a, b, d) 41 | bc = interpolate(b, c, d) 42 | abc = interpolate(ab, bc, d) 43 | v.append(abc) 44 | return v 45 | 46 | def get_coords(s): 47 | return map(float, s) 48 | 49 | def path_to_polygons(data): 50 | 51 | values = (x for x in data.replace(',', ' ').replace('\n',' ').split(' ') if x != '' ) 52 | 53 | mode = 'z' 54 | pos = (0.,0.) 55 | 56 | polygons = [] 57 | p = [] 58 | 59 | for x in values: 60 | 61 | if x in 'zZ': 62 | pos = p[0] 63 | p.append( pos ) 64 | 65 | if x in 'zZmM': 66 | if len(p) > 0: 67 | polygons.append( p ) 68 | p = [] 69 | 70 | if x in 'zZmclMCLhHvV': 71 | mode = x 72 | continue 73 | 74 | if mode == 'm': 75 | mode = 'l' 76 | 77 | if mode == 'M': 78 | mode = 'L' 79 | 80 | if mode == 'l': 81 | pos = vector_add(pos, get_coords((x, values.next()))) 82 | p.append( pos ) 83 | 84 | elif mode == 'L': 85 | pos = get_coords((x, values.next())) 86 | p.append( pos ) 87 | 88 | elif mode == 'H': 89 | pos = ( float(x), pos[1] ) 90 | p.append( pos ) 91 | 92 | elif mode == 'V': 93 | pos = ( pos[0], float(x) ) 94 | p.append( pos ) 95 | 96 | elif mode == 'h': 97 | pos = vector_add(pos, [float(x), 0]) 98 | p.append( pos ) 99 | 100 | elif mode == 'v': 101 | pos = vector_add(pos, [0, float(x)]) 102 | p.append( pos ) 103 | 104 | elif mode in 'cC': 105 | start = pos 106 | guide1 = get_coords( (x, values.next()) ) 107 | guide2 = get_coords( (values.next(), values.next()) ) 108 | end = get_coords( (values.next(), values.next()) ) 109 | 110 | if mode == 'c': 111 | guide1 = vector_add(pos, guide1) 112 | guide2 = vector_add(pos, guide2) 113 | end = vector_add(pos, end) 114 | 115 | pos = end 116 | p.extend( cubic_spline(start, guide1, guide2, end) ) 117 | else: 118 | print "ERROR: " + x 119 | sys.exit(1) 120 | 121 | if len(p) > 0: 122 | polygons.append( p ) 123 | 124 | return polygons 125 | 126 | def rescale_point(p, scale, conv=lambda x: x): 127 | x, y = p 128 | return ( conv(x*scale), conv(y*scale) ) 129 | 130 | def rescale_polygon(polygon, scale, conv=lambda x: x): 131 | return [ rescale_point(p, scale, conv) for p in polygon ] 132 | 133 | def rescale_polygon_list(polygon_list, scale, conv=lambda x: x): 134 | return [ rescale_polygon(polygon, scale, conv) for polygon in polygon_list ] 135 | 136 | -------------------------------------------------------------------------------- /gen/pathtokicad/uball.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from pathtokicad import * 4 | import svgpath 5 | 6 | in_dpi, out_dpi = 25.4, 10000. 7 | svgpath.scale = out_dpi/in_dpi 8 | svgpath.new_scale = 1000 9 | 10 | 11 | fill_paths = [ 12 | 13 | (FRONT_MASK, "uball/mask_top.path"), # soldermask front 14 | (FRONT_COPPER, "uball/copper_top.path"), 15 | (BACK_COPPER, "uball/copper_bottom.path"), 16 | (BACK_MASK, "uball/mask_bottom.path"), 17 | # (FRONT_PASTE, "uball/paste.path"), 18 | ] 19 | 20 | segment_paths = [ 21 | ] 22 | 23 | pads = [ 24 | ] 25 | 26 | print_module("uball", fill_paths, segment_paths, pads) 27 | 28 | -------------------------------------------------------------------------------- /mini_pcb/footprints.pretty/3mm_hole.kicad_mod: -------------------------------------------------------------------------------- 1 | (module 3mm_hole (layer F.Cu) (tedit 5895D0B5) 2 | (fp_text reference REF** (at 0 -3.81) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value "3mm hole" (at -0.635 3.81) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (pad "" thru_hole circle (at 0 0) (size 3 3) (drill 3) (layers *.Cu *.Mask)) 9 | ) 10 | -------------------------------------------------------------------------------- /mini_pcb/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name footprints)(type KiCad)(uri "$(KIPRJMOD)/footprints.pretty")(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /mini_pcb/gerb/miniball.GBO: -------------------------------------------------------------------------------- 1 | G04 #@! TF.FileFunction,Legend,Bot* 2 | %FSLAX46Y46*% 3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 4 | G04 Created by KiCad (PCBNEW 4.0.4+dfsg1-stable) date Sat Feb 4 15:40:44 2017* 5 | %MOMM*% 6 | %LPD*% 7 | G01* 8 | G04 APERTURE LIST* 9 | %ADD10C,0.100000*% 10 | G04 APERTURE END LIST* 11 | D10* 12 | M02* 13 | -------------------------------------------------------------------------------- /mini_pcb/gerb/miniball.GKO: -------------------------------------------------------------------------------- 1 | G04 #@! TF.FileFunction,Profile,NP* 2 | %FSLAX46Y46*% 3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 4 | G04 Created by KiCad (PCBNEW 4.0.4+dfsg1-stable) date Sat Feb 4 15:40:44 2017* 5 | %MOMM*% 6 | %LPD*% 7 | G01* 8 | G04 APERTURE LIST* 9 | %ADD10C,0.100000*% 10 | %ADD11C,0.150000*% 11 | G04 APERTURE END LIST* 12 | D10* 13 | D11* 14 | X100000000Y0D02* 15 | X0Y0D01* 16 | X100000000Y-100000000D02* 17 | X100000000Y0D01* 18 | X0Y-100000000D02* 19 | X100000000Y-100000000D01* 20 | X0Y0D02* 21 | X0Y-100000000D01* 22 | M02* 23 | -------------------------------------------------------------------------------- /mini_pcb/gerb/miniball.GTO: -------------------------------------------------------------------------------- 1 | G04 #@! TF.FileFunction,Legend,Top* 2 | %FSLAX46Y46*% 3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 4 | G04 Created by KiCad (PCBNEW 4.0.4+dfsg1-stable) date Sat Feb 4 15:40:44 2017* 5 | %MOMM*% 6 | %LPD*% 7 | G01* 8 | G04 APERTURE LIST* 9 | %ADD10C,0.100000*% 10 | %ADD11C,0.150000*% 11 | G04 APERTURE END LIST* 12 | D10* 13 | D11* 14 | M02* 15 | -------------------------------------------------------------------------------- /mini_pcb/gerbrename.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rename s'/(.*?)-Edge.Cuts\..*/$1.GKO/' gerb/* 4 | rename s'/(.*?)-.*\.(...)$/$1.\U$2/' gerb/* 5 | rename s'/(.*?).drl/$1.TXT/' gerb/* 6 | 7 | -------------------------------------------------------------------------------- /mini_pcb/miniball.pro: -------------------------------------------------------------------------------- 1 | update=Sat 04 Feb 2017 01:23:09 PM CET 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [eeschema] 27 | version=1 28 | LibDir= 29 | [eeschema/libraries] 30 | LibName1=power 31 | LibName2=device 32 | LibName3=transistors 33 | LibName4=conn 34 | LibName5=linear 35 | LibName6=regul 36 | LibName7=74xx 37 | LibName8=cmos4000 38 | LibName9=adc-dac 39 | LibName10=memory 40 | LibName11=xilinx 41 | LibName12=microcontrollers 42 | LibName13=dsp 43 | LibName14=microchip 44 | LibName15=analog_switches 45 | LibName16=motorola 46 | LibName17=texas 47 | LibName18=intel 48 | LibName19=audio 49 | LibName20=interface 50 | LibName21=digital-audio 51 | LibName22=philips 52 | LibName23=display 53 | LibName24=cypress 54 | LibName25=siliconi 55 | LibName26=opto 56 | LibName27=atmel 57 | LibName28=contrib 58 | LibName29=valves 59 | [general] 60 | version=1 61 | -------------------------------------------------------------------------------- /mini_pcb/miniball.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 2 2 | -------------------------------------------------------------------------------- /mini_pcb/miniball.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/mini_pcb/miniball.zip -------------------------------------------------------------------------------- /mini_pcb/miniball/miniball.GBO: -------------------------------------------------------------------------------- 1 | G04 #@! TF.FileFunction,Legend,Bot* 2 | %FSLAX46Y46*% 3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 4 | G04 Created by KiCad (PCBNEW 4.0.4+dfsg1-stable) date Sat Feb 4 15:40:44 2017* 5 | %MOMM*% 6 | %LPD*% 7 | G01* 8 | G04 APERTURE LIST* 9 | %ADD10C,0.100000*% 10 | G04 APERTURE END LIST* 11 | D10* 12 | M02* 13 | -------------------------------------------------------------------------------- /mini_pcb/miniball/miniball.GKO: -------------------------------------------------------------------------------- 1 | G04 #@! TF.FileFunction,Profile,NP* 2 | %FSLAX46Y46*% 3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 4 | G04 Created by KiCad (PCBNEW 4.0.4+dfsg1-stable) date Sat Feb 4 15:40:44 2017* 5 | %MOMM*% 6 | %LPD*% 7 | G01* 8 | G04 APERTURE LIST* 9 | %ADD10C,0.100000*% 10 | %ADD11C,0.150000*% 11 | G04 APERTURE END LIST* 12 | D10* 13 | D11* 14 | X100000000Y0D02* 15 | X0Y0D01* 16 | X100000000Y-100000000D02* 17 | X100000000Y0D01* 18 | X0Y-100000000D02* 19 | X100000000Y-100000000D01* 20 | X0Y0D02* 21 | X0Y-100000000D01* 22 | M02* 23 | -------------------------------------------------------------------------------- /mini_pcb/miniball/miniball.GTO: -------------------------------------------------------------------------------- 1 | G04 #@! TF.FileFunction,Legend,Top* 2 | %FSLAX46Y46*% 3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 4 | G04 Created by KiCad (PCBNEW 4.0.4+dfsg1-stable) date Sat Feb 4 15:40:44 2017* 5 | %MOMM*% 6 | %LPD*% 7 | G01* 8 | G04 APERTURE LIST* 9 | %ADD10C,0.100000*% 10 | %ADD11C,0.150000*% 11 | G04 APERTURE END LIST* 12 | D10* 13 | D11* 14 | M02* 15 | -------------------------------------------------------------------------------- /openscad/ballbase.scad: -------------------------------------------------------------------------------- 1 | use 2 | use 3 | use 4 | 5 | SWITCH_POS = [0,-8.3,0]; 6 | DRIVER_POS = [0,3.,0]; 7 | 8 | module cutouts() 9 | { 10 | union () 11 | { 12 | translate(SWITCH_POS) 13 | switch_cutout(); 14 | translate (DRIVER_POS) 15 | rotate([0,0,90]) 16 | driver_cutout(); 17 | } 18 | } 19 | 20 | difference() 21 | { 22 | union() 23 | { 24 | translate([0,0,5]) 25 | { 26 | intersection() 27 | { 28 | cube( size = [30, 30, 10], center=true ); 29 | difference() 30 | { 31 | eggshell25mm(); 32 | translate ([0,12.5,0]) 33 | rotate([90,0,0]) 34 | cylinder(r = .5, h=6, $fn=20, center=true); 35 | } 36 | } 37 | } 38 | cylinder(r = 11.5, h=1.2); 39 | translate (DRIVER_POS) 40 | rotate ([0,0,90]) 41 | driver_positive(1); 42 | } 43 | cutouts(); 44 | } 45 | 46 | render(); 47 | -------------------------------------------------------------------------------- /openscad/ballbase20mm.scad: -------------------------------------------------------------------------------- 1 | use 2 | use 3 | use 4 | 5 | SWITCH_POS = [0,-6.81,0]; 6 | DRIVER_POS = [0,1.4,0]; 7 | 8 | module cutouts() 9 | { 10 | union () 11 | { 12 | translate(SWITCH_POS) 13 | switch_cutout(); 14 | translate (DRIVER_POS) 15 | rotate([0,0,90]) 16 | driver_cutout(); 17 | } 18 | } 19 | 20 | difference() 21 | { 22 | union() 23 | { 24 | translate([0,0,4]) 25 | { 26 | intersection() 27 | { 28 | cube( size = [30, 30, 8], center=true ); 29 | difference() 30 | { 31 | eggshell20mm(); 32 | translate ([0,10,0]) 33 | rotate([90,0,0]) 34 | cylinder(r = .5, h=6, $fn=20, center=true); 35 | } 36 | } 37 | } 38 | cylinder(r = 9.1, h=1.2); 39 | difference() 40 | { 41 | translate (DRIVER_POS) 42 | rotate([0,0,90]) 43 | driver_positive(.5); 44 | translate([0,0,4]) 45 | rotate([180,0,0]) 46 | eggshell20mm(); 47 | } 48 | } 49 | cutouts(); 50 | } 51 | 52 | 53 | render(); 54 | -------------------------------------------------------------------------------- /openscad/ballbase20mm_driver2.scad: -------------------------------------------------------------------------------- 1 | use 2 | use 3 | use 4 | 5 | SWITCH_POS = [0,-6.81,0]; 6 | DRIVER_POS = [0,1.4,0]; 7 | 8 | module cutouts() 9 | { 10 | union () 11 | { 12 | translate(SWITCH_POS) 13 | switch_cutout(); 14 | //translate (DRIVER_POS) 15 | //rotate([0,0,90]) 16 | //driver_cutout(); 17 | translate([0,0,-.1]) cylinder(r = 9, h=10, $fn=100); 18 | } 19 | } 20 | 21 | difference() 22 | { 23 | translate([0,0,4]) 24 | { 25 | intersection() 26 | { 27 | cube( size = [30, 30, 8], center=true ); 28 | difference() 29 | { 30 | eggshell20mm(); 31 | translate ([0,10,0]) 32 | rotate([90,0,0]) 33 | cylinder(r = .5, h=6, $fn=20, center=true); 34 | } 35 | } 36 | } 37 | cutouts(); 38 | } 39 | 40 | 41 | render(); 42 | -------------------------------------------------------------------------------- /openscad/balldome_new.scad: -------------------------------------------------------------------------------- 1 | 2 | use 3 | 4 | rotate([0,180,0]) ball(); 5 | //hold(); 6 | //base(); 7 | render(convexity=10); 8 | 9 | 10 | -------------------------------------------------------------------------------- /openscad/balldome_new_base.scad: -------------------------------------------------------------------------------- 1 | 2 | use 3 | 4 | //ball(); 5 | //hold(); 6 | base(); 7 | render(convexity=10); 8 | 9 | 10 | -------------------------------------------------------------------------------- /openscad/balldome_new_hold.scad: -------------------------------------------------------------------------------- 1 | 2 | use 3 | 4 | //ball(); 5 | hold(); 6 | //base(); 7 | render(convexity=10); 8 | 9 | 10 | -------------------------------------------------------------------------------- /openscad/driver.scad: -------------------------------------------------------------------------------- 1 | 2 | function snub(xmin, ymin, xmax, ymax, d) = [ [xmax, ymax-d], [xmax, ymin+d], [xmax-d, ymin], [xmin+d, ymin], [xmin, ymin+d], [xmin, ymax-d], [xmin+d, ymax], [xmax-d, ymax] ]; 3 | 4 | BOTTOM_THICKNESS = .8; 5 | D = .01; 6 | 7 | //DRIVER_PCB_SHAPE = [ [6,4], [4,6], [-4,6], [-6,4], [-6, -4], [-4, -6], [4, -6], [6, -4] ]; 8 | DRIVER_KEEPOUT_SHAPE = snub(-6.2, -6.2, 6.2, 6.2, 2); 9 | DRIVER_WALL_SHAPE = snub(-7.2, -7.2, 7.2, 7.2, 2); 10 | 11 | 12 | DRIVER_PCB_SHAPE = snub(-6, -6, 6, 6, 2); 13 | DRIVER_CLAMP_SHAPE = [ [-5.4-D, 5], [5.4+D, 5], [4.2+D, 6.2+D], [-4.2-D, 6.2+D] ]; 14 | DRIVER_ISP_KEEPOUT = snub(-5, -.5, 3, 4.5, .5);// -3, -4.5, 5, .5, .5); 15 | DRIVER_STANDOFF_1 = [ [-1.7, -6.2-D], [-1.7, -4.5], [-2.8, -4.5], [-2.8, -6.2-D] ] ; 16 | DRIVER_STANDOFF_2 = [ [ 1.7, -6.2-D], [ 1.7, -4.5], [ 2.8, -4.5], [ 2.8, -6.2-D] ] ; 17 | 18 | 19 | module driver_cutout() 20 | { 21 | difference() 22 | { 23 | union() 24 | { 25 | translate([0,0,BOTTOM_THICKNESS]) 26 | linear_extrude(5) 27 | polygon(DRIVER_KEEPOUT_SHAPE); 28 | translate([0,0,-D]) 29 | linear_extrude(5) 30 | polygon(DRIVER_ISP_KEEPOUT); 31 | driver_isp_hole(); 32 | } 33 | driver_standoffs(); 34 | } 35 | } 36 | 37 | module driver_standoffs() 38 | { 39 | translate([0,0,BOTTOM_THICKNESS-D]) 40 | linear_extrude(2+D) 41 | { 42 | polygon(DRIVER_CLAMP_SHAPE); 43 | polygon(DRIVER_STANDOFF_1); 44 | polygon(DRIVER_STANDOFF_2); 45 | } 46 | } 47 | 48 | module driver_wall(w) 49 | { 50 | difference () 51 | { 52 | translate([0,0,BOTTOM_THICKNESS-D]) 53 | linear_extrude(3+D) 54 | polygon(snub(-6.2-w, -6.2-w, 6.2+w, 6.2+w, 2)); 55 | translate([0,0,BOTTOM_THICKNESS-D-D]) 56 | linear_extrude(3+D+D+D) 57 | polygon([ [-4.2, -5], [4.2, -5], [4.2, -8], [-4.2, -8] ]); 58 | } 59 | } 60 | 61 | module driver_isp_hole() 62 | { 63 | translate([0,0,-100]) 64 | linear_extrude(105) 65 | polygon(DRIVER_ISP_KEEPOUT); 66 | } 67 | 68 | 69 | module driver_positive(w) 70 | { 71 | driver_wall(w); 72 | driver_standoffs(); 73 | } 74 | 75 | difference() 76 | { 77 | union() 78 | { 79 | cylinder(r=12.5, h=1.2); 80 | driver_positive(1); 81 | } 82 | driver_cutout(); 83 | } 84 | -------------------------------------------------------------------------------- /openscad/egg.scad: -------------------------------------------------------------------------------- 1 | 2 | module dhxdron(r) { 3 | scale ( [r,r,r] ){ 4 | polyhedron( points = [ [-3.142158e-01, -9.670568e-01, -1.941960e-01], [-2.771276e-01, -8.529112e-01, -5.542553e-01], [2.989346e-01, -9.200262e-01, -4.836864e-01], [0.000000e+00, -1.054256e+00, 0.000000e+00], [5.084118e-01, -3.693828e-01, -8.226276e-01], [1.712743e-01, -5.271281e-01, -8.968039e-01], [5.551115e-17, 0.000000e+00, -1.081556e+00], [5.542553e-01, 0.000000e+00, -8.968039e-01], [-6.284316e-01, 0.000000e+00, -8.226276e-01], [-4.484020e-01, -3.257831e-01, -8.968039e-01], [-7.826210e-01, -5.686075e-01, -4.836864e-01], [-8.968039e-01, 0.000000e+00, -5.542553e-01], [-3.142158e-01, 9.670568e-01, -1.941960e-01], [0.000000e+00, 1.054256e+00, -0.000000e+00], [2.989346e-01, 9.200262e-01, -4.836864e-01], [-2.771276e-01, 8.529112e-01, -5.542553e-01], [-5.084118e-01, -3.693828e-01, 8.226276e-01], [-5.542553e-01, 0.000000e+00, 8.968039e-01], [-9.673728e-01, 0.000000e+00, 4.836864e-01], [-7.255296e-01, -5.271281e-01, 5.542553e-01], [1.016824e+00, 0.000000e+00, 1.941960e-01], [8.968039e-01, 0.000000e+00, 5.542553e-01], [7.826210e-01, -5.686075e-01, 4.836864e-01], [1.002657e+00, -3.257831e-01, 5.551115e-17], [3.142158e-01, -9.670568e-01, 1.941960e-01], [6.196763e-01, -8.529112e-01, -0.000000e+00], [5.084118e-01, 3.693828e-01, -8.226276e-01], [1.712743e-01, 5.271281e-01, -8.968039e-01], [-1.016824e+00, 0.000000e+00, -1.941960e-01], [-1.002657e+00, -3.257831e-01, -5.551115e-17], [3.142158e-01, 9.670568e-01, 1.941960e-01], [6.196763e-01, 8.529112e-01, -0.000000e+00], [-5.084118e-01, 3.693828e-01, 8.226276e-01], [-7.255296e-01, 5.271281e-01, 5.542553e-01], [6.284316e-01, 0.000000e+00, 8.226276e-01], [4.484020e-01, -3.257831e-01, 8.968039e-01], [-2.989346e-01, -9.200262e-01, 4.836864e-01], [-6.196763e-01, -8.529112e-01, -0.000000e+00], [9.673728e-01, 0.000000e+00, -4.836864e-01], [7.255296e-01, -5.271281e-01, -5.542553e-01], [-7.826210e-01, 5.686075e-01, -4.836864e-01], [-4.484020e-01, 3.257831e-01, -8.968039e-01], [-6.196763e-01, 8.529112e-01, -0.000000e+00], [-2.989346e-01, 9.200262e-01, 4.836864e-01], [-1.712743e-01, -5.271281e-01, 8.968039e-01], [-5.551115e-17, 0.000000e+00, 1.081556e+00], [1.002657e+00, 3.257831e-01, 5.551115e-17], [7.826210e-01, 5.686075e-01, 4.836864e-01], [2.771276e-01, -8.529112e-01, 5.542553e-01], [7.255296e-01, 5.271281e-01, -5.542553e-01], [-1.002657e+00, 3.257831e-01, -5.551115e-17], [2.771276e-01, 8.529112e-01, 5.542553e-01], [-1.712743e-01, 5.271281e-01, 8.968039e-01], [4.484020e-01, 3.257831e-01, 8.968039e-01], [-1.941960e-01, -5.976740e-01, -8.226276e-01], [-1.941960e-01, 5.976740e-01, -8.226276e-01], [-8.226276e-01, -5.976740e-01, 1.941960e-01], [8.226276e-01, -5.976740e-01, -1.941960e-01], [8.226276e-01, 5.976740e-01, -1.941960e-01], [-8.226276e-01, 5.976740e-01, 1.941960e-01], [1.941960e-01, -5.976740e-01, 8.226276e-01], [1.941960e-01, 5.976740e-01, 8.226276e-01] ], faces = [ [ 3, 2, 1, 0 ] , [ 7, 6, 5, 4 ] , [ 11, 10, 9, 8 ] , [ 15, 14, 13, 12 ] , [ 19, 18, 17, 16 ] , [ 23, 22, 21, 20 ] , [ 25, 2, 3, 24 ] , [ 27, 6, 7, 26 ] , [ 29, 10, 11, 28 ] , [ 13, 14, 31, 30 ] , [ 17, 18, 33, 32 ] , [ 21, 22, 35, 34 ] , [ 37, 36, 3, 0 ] , [ 39, 38, 7, 4 ] , [ 41, 40, 11, 8 ] , [ 13, 43, 42, 12 ] , [ 17, 45, 44, 16 ] , [ 21, 47, 46, 20 ] , [ 3, 36, 48, 24 ] , [ 7, 38, 49, 26 ] , [ 11, 40, 50, 28 ] , [ 51, 43, 13, 30 ] , [ 52, 45, 17, 32 ] , [ 53, 47, 21, 34 ] , [ 1, 2, 5, 54 ] , [ 5, 6, 9, 54 ] , [ 9, 10, 1, 54 ] , [ 27, 14, 15, 55 ] , [ 29, 18, 19, 56 ] , [ 25, 22, 23, 57 ] , [ 39, 2, 25, 57 ] , [ 41, 6, 27, 55 ] , [ 37, 10, 29, 56 ] , [ 31, 14, 49, 58 ] , [ 33, 18, 50, 59 ] , [ 35, 22, 48, 60 ] , [ 19, 36, 37, 56 ] , [ 23, 38, 39, 57 ] , [ 15, 40, 41, 55 ] , [ 42, 43, 33, 59 ] , [ 44, 45, 35, 60 ] , [ 46, 47, 31, 58 ] , [ 48, 36, 44, 60 ] , [ 49, 38, 46, 58 ] , [ 50, 40, 42, 59 ] , [ 52, 43, 51, 61 ] , [ 53, 45, 52, 61 ] , [ 51, 47, 53, 61 ] , [ 5, 2, 39, 4 ] , [ 9, 6, 41, 8 ] , [ 1, 10, 37, 0 ] , [ 49, 14, 27, 26 ] , [ 50, 18, 29, 28 ] , [ 48, 22, 25, 24 ] , [ 44, 36, 19, 16 ] , [ 46, 38, 23, 20 ] , [ 42, 40, 15, 12 ] , [ 33, 43, 52, 32 ] , [ 35, 45, 53, 34 ] , [ 31, 47, 51, 30 ] ], convexity = 4); 5 | } 6 | } 7 | 8 | module egg(inner, outer) { 9 | difference () { 10 | dhxdron(outer); 11 | dhxdron(inner); 12 | } 13 | } 14 | 15 | render() egg(1,2); -------------------------------------------------------------------------------- /openscad/eggshell20mm.scad: -------------------------------------------------------------------------------- 1 | module eggshell20mm() 2 | { 3 | rotate ([0,0,18]) 4 | polyhedron( points = [ [4.575706e+00, 3.324445e+00, -7.403649e+00], [6.529766e+00, 4.744153e+00, -4.988298e+00], [8.706355e+00, -0.000000e+00, -4.353178e+00], [4.988298e+00, 0.000000e+00, -8.071235e+00], [0.000000e+00, 0.000000e+00, -9.734001e+00], [1.541469e+00, 4.744153e+00, -8.071235e+00], [-1.747764e+00, 5.379066e+00, -7.403649e+00], [-4.035618e+00, 2.932048e+00, -8.071235e+00], [-7.043589e+00, 5.117467e+00, -4.353178e+00], [-2.494149e+00, 7.676201e+00, -4.988298e+00], [-2.827942e+00, 8.703511e+00, -1.747764e+00], [-5.577086e+00, 7.676201e+00, -0.000000e+00], [-7.403649e+00, 5.379066e+00, 1.747764e+00], [-9.023915e+00, 2.932048e+00, 8.881784e-16], [-9.151413e+00, 0.000000e+00, -1.747764e+00], [-8.071235e+00, 0.000000e+00, -4.988298e+00], [-5.655884e+00, 0.000000e+00, -7.403649e+00], [-4.035618e+00, -2.932048e+00, -8.071235e+00], [-7.043589e+00, -5.117467e+00, -4.353178e+00], [-9.023915e+00, -2.932048e+00, 8.881784e-16], [-7.403649e+00, -5.379066e+00, 1.747764e+00], [-5.577086e+00, -7.676201e+00, -0.000000e+00], [-2.827942e+00, -8.703511e+00, -1.747764e+00], [-2.494149e+00, -7.676201e+00, -4.988298e+00], [-1.747764e+00, -5.379066e+00, -7.403649e+00], [1.541469e+00, -4.744153e+00, -8.071235e+00], [2.690412e+00, -8.280236e+00, -4.353178e+00], [0.000000e+00, -9.488306e+00, -0.000000e+00], [2.827942e+00, -8.703511e+00, 1.747764e+00], [5.577086e+00, -7.676201e+00, -0.000000e+00], [7.403649e+00, -5.379066e+00, -1.747764e+00], [6.529766e+00, -4.744153e+00, -4.988298e+00], [4.575706e+00, -3.324445e+00, -7.403649e+00], [9.023915e+00, -2.932048e+00, -8.881784e-16], [9.151413e+00, -0.000000e+00, 1.747764e+00], [9.023915e+00, 2.932048e+00, -8.881784e-16], [7.403649e+00, 5.379066e+00, -1.747764e+00], [2.690412e+00, 8.280236e+00, -4.353178e+00], [5.577086e+00, 7.676201e+00, -0.000000e+00], [2.827942e+00, 8.703511e+00, 1.747764e+00], [-0.000000e+00, 9.488306e+00, -0.000000e+00], [5.236642e+00, 3.804643e+00, -8.473064e+00], [7.472955e+00, 5.429420e+00, -5.708830e+00], [9.963940e+00, -0.000000e+00, -4.981970e+00], [5.708830e+00, 0.000000e+00, -9.237080e+00], [-8.881784e-16, 0.000000e+00, -1.114002e+01], [1.764125e+00, 5.429420e+00, -9.237080e+00], [-2.000219e+00, 6.156042e+00, -8.473064e+00], [-4.618540e+00, 3.355566e+00, -9.237080e+00], [-8.060997e+00, 5.856657e+00, -4.981970e+00], [-2.854415e+00, 8.784985e+00, -5.708830e+00], [-3.236423e+00, 9.960685e+00, -2.000219e+00], [-6.382665e+00, 8.784985e+00, -0.000000e+00], [-8.473064e+00, 6.156042e+00, 2.000219e+00], [-1.032737e+01, 3.355566e+00, 8.881784e-16], [-1.047328e+01, 0.000000e+00, -2.000219e+00], [-9.237080e+00, 0.000000e+00, -5.708830e+00], [-6.472845e+00, 0.000000e+00, -8.473064e+00], [-4.618540e+00, -3.355566e+00, -9.237080e+00], [-8.060997e+00, -5.856657e+00, -4.981970e+00], [-1.032737e+01, -3.355566e+00, 8.881784e-16], [-8.473064e+00, -6.156042e+00, 2.000219e+00], [-6.382665e+00, -8.784985e+00, -0.000000e+00], [-3.236423e+00, -9.960685e+00, -2.000219e+00], [-2.854415e+00, -8.784985e+00, -5.708830e+00], [-2.000219e+00, -6.156042e+00, -8.473064e+00], [1.764125e+00, -5.429420e+00, -9.237080e+00], [3.079027e+00, -9.476270e+00, -4.981970e+00], [0.000000e+00, -1.085884e+01, -0.000000e+00], [3.236423e+00, -9.960685e+00, 2.000219e+00], [6.382665e+00, -8.784985e+00, -0.000000e+00], [8.473064e+00, -6.156042e+00, -2.000219e+00], [7.472955e+00, -5.429420e+00, -5.708830e+00], [5.236642e+00, -3.804643e+00, -8.473064e+00], [1.032737e+01, -3.355566e+00, -8.881784e-16], [1.047328e+01, -0.000000e+00, 2.000219e+00], [1.032737e+01, 3.355566e+00, -8.881784e-16], [8.473064e+00, 6.156042e+00, -2.000219e+00], [3.079027e+00, 9.476270e+00, -4.981970e+00], [6.382665e+00, 8.784985e+00, -0.000000e+00], [3.236423e+00, 9.960685e+00, 2.000219e+00], [-0.000000e+00, 1.085884e+01, -0.000000e+00] ], faces = [ [ 1, 2, 3, 0 ] , [ 3, 4, 5, 0 ] , [ 5, 4, 7, 6 ] , [ 7, 8, 9, 6 ] , [ 9, 8, 11, 10 ] , [ 11, 8, 13, 12 ] , [ 13, 8, 15, 14 ] , [ 15, 8, 7, 16 ] , [ 7, 4, 17, 16 ] , [ 17, 18, 15, 16 ] , [ 15, 18, 19, 14 ] , [ 19, 18, 21, 20 ] , [ 21, 18, 23, 22 ] , [ 23, 18, 17, 24 ] , [ 17, 4, 25, 24 ] , [ 25, 26, 23, 24 ] , [ 23, 26, 27, 22 ] , [ 27, 26, 29, 28 ] , [ 29, 26, 31, 30 ] , [ 31, 26, 25, 32 ] , [ 25, 4, 3, 32 ] , [ 3, 2, 31, 32 ] , [ 31, 2, 33, 30 ] , [ 33, 2, 35, 34 ] , [ 35, 2, 1, 36 ] , [ 1, 37, 38, 36 ] , [ 38, 37, 40, 39 ] , [ 40, 37, 9, 10 ] , [ 9, 37, 5, 6 ] , [ 5, 37, 1, 0 ] , [ 44, 43, 42, 41 ] , [ 46, 45, 44, 41 ] , [ 48, 45, 46, 47 ] , [ 50, 49, 48, 47 ] , [ 52, 49, 50, 51 ] , [ 54, 49, 52, 53 ] , [ 56, 49, 54, 55 ] , [ 48, 49, 56, 57 ] , [ 58, 45, 48, 57 ] , [ 56, 59, 58, 57 ] , [ 60, 59, 56, 55 ] , [ 62, 59, 60, 61 ] , [ 64, 59, 62, 63 ] , [ 58, 59, 64, 65 ] , [ 66, 45, 58, 65 ] , [ 64, 67, 66, 65 ] , [ 68, 67, 64, 63 ] , [ 70, 67, 68, 69 ] , [ 72, 67, 70, 71 ] , [ 66, 67, 72, 73 ] , [ 44, 45, 66, 73 ] , [ 72, 43, 44, 73 ] , [ 74, 43, 72, 71 ] , [ 76, 43, 74, 75 ] , [ 42, 43, 76, 77 ] , [ 79, 78, 42, 77 ] , [ 81, 78, 79, 80 ] , [ 50, 78, 81, 51 ] , [ 46, 78, 50, 47 ] , [ 42, 78, 46, 41 ] , [ 52, 51, 10, 11 ] , [ 53, 52, 11, 12 ] , [ 54, 53, 12, 13 ] , [ 55, 54, 13, 14 ] , [ 60, 55, 14, 19 ] , [ 61, 60, 19, 20 ] , [ 62, 61, 20, 21 ] , [ 63, 62, 21, 22 ] , [ 68, 63, 22, 27 ] , [ 69, 68, 27, 28 ] , [ 70, 69, 28, 29 ] , [ 71, 70, 29, 30 ] , [ 74, 71, 30, 33 ] , [ 75, 74, 33, 34 ] , [ 76, 75, 34, 35 ] , [ 77, 76, 35, 36 ] , [ 79, 77, 36, 38 ] , [ 80, 79, 38, 39 ] , [ 81, 80, 39, 40 ] , [ 51, 81, 40, 10 ] ], convexity = 10); 5 | 6 | } 7 | 8 | 9 | eggshell20mm(); 10 | 11 | -------------------------------------------------------------------------------- /openscad/eggshell25.scad: -------------------------------------------------------------------------------- 1 | module eggshell25mm() { 2 | 3 | rotate ([0,0,18]) 4 | polyhedron( points = [ [5.592530e+00, 4.063211e+00, -9.048904e+00], [7.980826e+00, 5.798409e+00, -6.096808e+00], [1.064110e+01, -0.000000e+00, -5.320550e+00], [6.096808e+00, 0.000000e+00, -9.864843e+00], [-8.881784e-16, 0.000000e+00, -1.189711e+01], [1.884017e+00, 5.798409e+00, -9.864843e+00], [-2.136156e+00, 6.574413e+00, -9.048904e+00], [-4.932421e+00, 3.583614e+00, -9.864843e+00], [-8.608831e+00, 6.254682e+00, -5.320550e+00], [-3.048404e+00, 9.382023e+00, -6.096808e+00], [-3.456374e+00, 1.063762e+01, -2.136156e+00], [-6.816439e+00, 9.382023e+00, -0.000000e+00], [-9.048904e+00, 6.574413e+00, 2.136156e+00], [-1.102923e+01, 3.583614e+00, 8.881784e-16], [-1.118506e+01, 0.000000e+00, -2.136156e+00], [-9.864843e+00, 0.000000e+00, -6.096808e+00], [-6.912747e+00, 0.000000e+00, -9.048904e+00], [-4.932421e+00, -3.583614e+00, -9.864843e+00], [-8.608831e+00, -6.254682e+00, -5.320550e+00], [-1.102923e+01, -3.583614e+00, 8.881784e-16], [-9.048904e+00, -6.574413e+00, 2.136156e+00], [-6.816439e+00, -9.382023e+00, -0.000000e+00], [-3.456374e+00, -1.063762e+01, -2.136156e+00], [-3.048404e+00, -9.382023e+00, -6.096808e+00], [-2.136156e+00, -6.574413e+00, -9.048904e+00], [1.884017e+00, -5.798409e+00, -9.864843e+00], [3.288281e+00, -1.012029e+01, -5.320550e+00], [0.000000e+00, -1.159682e+01, -0.000000e+00], [3.456374e+00, -1.063762e+01, 2.136156e+00], [6.816439e+00, -9.382023e+00, -0.000000e+00], [9.048904e+00, -6.574413e+00, -2.136156e+00], [7.980826e+00, -5.798409e+00, -6.096808e+00], [5.592530e+00, -4.063211e+00, -9.048904e+00], [1.102923e+01, -3.583614e+00, -8.881784e-16], [1.118506e+01, -0.000000e+00, 2.136156e+00], [1.102923e+01, 3.583614e+00, -8.881784e-16], [9.048904e+00, 6.574413e+00, -2.136156e+00], [3.288281e+00, 1.012029e+01, -5.320550e+00], [6.816439e+00, 9.382023e+00, -0.000000e+00], [3.456374e+00, 1.063762e+01, 2.136156e+00], [-0.000000e+00, 1.159682e+01, -0.000000e+00], [6.609354e+00, 4.801977e+00, -1.069416e+01], [9.431885e+00, 6.852665e+00, -7.205319e+00], [1.257585e+01, -0.000000e+00, -6.287923e+00], [7.205319e+00, 0.000000e+00, -1.165845e+01], [-8.881784e-16, 0.000000e+00, -1.406022e+01], [2.226566e+00, 6.852665e+00, -1.165845e+01], [-2.524549e+00, 7.769761e+00, -1.069416e+01], [-5.829225e+00, 4.235180e+00, -1.165845e+01], [-1.017407e+01, 7.391897e+00, -6.287923e+00], [-3.602659e+00, 1.108785e+01, -7.205319e+00], [-4.084805e+00, 1.257174e+01, -2.524549e+00], [-8.055791e+00, 1.108785e+01, 4.440892e-16], [-1.069416e+01, 7.769761e+00, 2.524549e+00], [-1.303454e+01, 4.235180e+00, 8.881784e-16], [-1.321871e+01, 0.000000e+00, -2.524549e+00], [-1.165845e+01, 0.000000e+00, -7.205319e+00], [-8.169611e+00, 0.000000e+00, -1.069416e+01], [-5.829225e+00, -4.235180e+00, -1.165845e+01], [-1.017407e+01, -7.391897e+00, -6.287923e+00], [-1.303454e+01, -4.235180e+00, 8.881784e-16], [-1.069416e+01, -7.769761e+00, 2.524549e+00], [-8.055791e+00, -1.108785e+01, 4.440892e-16], [-4.084805e+00, -1.257174e+01, -2.524549e+00], [-3.602659e+00, -1.108785e+01, -7.205319e+00], [-2.524549e+00, -7.769761e+00, -1.069416e+01], [2.226566e+00, -6.852665e+00, -1.165845e+01], [3.886150e+00, -1.196034e+01, -6.287923e+00], [0.000000e+00, -1.370533e+01, -0.000000e+00], [4.084805e+00, -1.257174e+01, 2.524549e+00], [8.055791e+00, -1.108785e+01, -4.440892e-16], [1.069416e+01, -7.769761e+00, -2.524549e+00], [9.431885e+00, -6.852665e+00, -7.205319e+00], [6.609354e+00, -4.801977e+00, -1.069416e+01], [1.303454e+01, -4.235180e+00, -8.881784e-16], [1.321871e+01, -0.000000e+00, 2.524549e+00], [1.303454e+01, 4.235180e+00, -8.881784e-16], [1.069416e+01, 7.769761e+00, -2.524549e+00], [3.886150e+00, 1.196034e+01, -6.287923e+00], [8.055791e+00, 1.108785e+01, -4.440892e-16], [4.084805e+00, 1.257174e+01, 2.524549e+00], [-0.000000e+00, 1.370533e+01, -0.000000e+00] ], faces = [ [ 1, 2, 3, 0 ] , [ 3, 4, 5, 0 ] , [ 5, 4, 7, 6 ] , [ 7, 8, 9, 6 ] , [ 9, 8, 11, 10 ] , [ 11, 8, 13, 12 ] , [ 13, 8, 15, 14 ] , [ 15, 8, 7, 16 ] , [ 7, 4, 17, 16 ] , [ 17, 18, 15, 16 ] , [ 15, 18, 19, 14 ] , [ 19, 18, 21, 20 ] , [ 21, 18, 23, 22 ] , [ 23, 18, 17, 24 ] , [ 17, 4, 25, 24 ] , [ 25, 26, 23, 24 ] , [ 23, 26, 27, 22 ] , [ 27, 26, 29, 28 ] , [ 29, 26, 31, 30 ] , [ 31, 26, 25, 32 ] , [ 25, 4, 3, 32 ] , [ 3, 2, 31, 32 ] , [ 31, 2, 33, 30 ] , [ 33, 2, 35, 34 ] , [ 35, 2, 1, 36 ] , [ 1, 37, 38, 36 ] , [ 38, 37, 40, 39 ] , [ 40, 37, 9, 10 ] , [ 9, 37, 5, 6 ] , [ 5, 37, 1, 0 ] , [ 44, 43, 42, 41 ] , [ 46, 45, 44, 41 ] , [ 48, 45, 46, 47 ] , [ 50, 49, 48, 47 ] , [ 52, 49, 50, 51 ] , [ 54, 49, 52, 53 ] , [ 56, 49, 54, 55 ] , [ 48, 49, 56, 57 ] , [ 58, 45, 48, 57 ] , [ 56, 59, 58, 57 ] , [ 60, 59, 56, 55 ] , [ 62, 59, 60, 61 ] , [ 64, 59, 62, 63 ] , [ 58, 59, 64, 65 ] , [ 66, 45, 58, 65 ] , [ 64, 67, 66, 65 ] , [ 68, 67, 64, 63 ] , [ 70, 67, 68, 69 ] , [ 72, 67, 70, 71 ] , [ 66, 67, 72, 73 ] , [ 44, 45, 66, 73 ] , [ 72, 43, 44, 73 ] , [ 74, 43, 72, 71 ] , [ 76, 43, 74, 75 ] , [ 42, 43, 76, 77 ] , [ 79, 78, 42, 77 ] , [ 81, 78, 79, 80 ] , [ 50, 78, 81, 51 ] , [ 46, 78, 50, 47 ] , [ 42, 78, 46, 41 ] , [ 52, 51, 10, 11 ] , [ 53, 52, 11, 12 ] , [ 54, 53, 12, 13 ] , [ 55, 54, 13, 14 ] , [ 60, 55, 14, 19 ] , [ 61, 60, 19, 20 ] , [ 62, 61, 20, 21 ] , [ 63, 62, 21, 22 ] , [ 68, 63, 22, 27 ] , [ 69, 68, 27, 28 ] , [ 70, 69, 28, 29 ] , [ 71, 70, 29, 30 ] , [ 74, 71, 30, 33 ] , [ 75, 74, 33, 34 ] , [ 76, 75, 34, 35 ] , [ 77, 76, 35, 36 ] , [ 79, 77, 36, 38 ] , [ 80, 79, 38, 39 ] , [ 81, 80, 39, 40 ] , [ 51, 81, 40, 10 ] ], convexity = 10); 5 | 6 | } 7 | 8 | eggshell25mm(); 9 | 10 | -------------------------------------------------------------------------------- /openscad/switch.scad: -------------------------------------------------------------------------------- 1 | 2 | module switch_cutout() 3 | { 4 | translate ([ 0, 0, .69 ]) 5 | union () 6 | { 7 | cube(size=[6.9,3,5], center=true); 8 | translate ([0,-2.4,0]) 9 | cube(size=[4,5,1.42], center=true); 10 | } 11 | } 12 | 13 | switch_cutout(); 14 | 15 | -------------------------------------------------------------------------------- /pics/README.md: -------------------------------------------------------------------------------- 1 | 2 | Pictures 3 | ======== 4 | 5 | ![Ball](ball.jpg) 6 | 7 | ![CNC Milling](cnc.jpg) 8 | 9 | ![Grooves](folded.jpg) 10 | 11 | ![Connect VCC traces](vcc_connected.jpg) 12 | 13 | ![LEDs](leds_on.jpg) 14 | 15 | ![Driver PCB with ATTINY85 & MCP73831](driver.jpg) 16 | -------------------------------------------------------------------------------- /pics/ball.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/pics/ball.jpg -------------------------------------------------------------------------------- /pics/cnc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/pics/cnc.jpg -------------------------------------------------------------------------------- /pics/driver.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/pics/driver.jpg -------------------------------------------------------------------------------- /pics/eur5ct.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/pics/eur5ct.JPG -------------------------------------------------------------------------------- /pics/folded.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/pics/folded.jpg -------------------------------------------------------------------------------- /pics/folded_big.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/pics/folded_big.jpg -------------------------------------------------------------------------------- /pics/leds_on.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/pics/leds_on.jpg -------------------------------------------------------------------------------- /pics/miniball.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/pics/miniball.jpg -------------------------------------------------------------------------------- /pics/uball.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/pics/uball.jpg -------------------------------------------------------------------------------- /pics/vcc_connected.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/pics/vcc_connected.jpg -------------------------------------------------------------------------------- /src/avrrc/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TARGETS=avrrc2812.elf avrrc2812.hex 3 | 4 | all: $(TARGETS) 5 | 6 | %.hex: %.elf 7 | avr-objcopy -j .text -j .data -O ihex $< $@ 8 | 9 | %.elf: %.o 10 | avr-ld -m avrtiny -o $@ $^ 11 | 12 | %.o: %.S 13 | avr-gcc -mmcu=attiny4 -c -o $@ $^ 14 | 15 | clean: 16 | -rm -- $(TARGETS) 17 | -------------------------------------------------------------------------------- /src/avrrc/intelhex.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Copyright (c) 2020 Erik Bosman 4 | # 5 | # Permission is hereby granted, free of charge, to any person 6 | # obtaining a copy of this software and associated documentation 7 | # files (the "Software"), to deal in the Software without restriction, 8 | # including without limitation the rights to use, copy, modify, 9 | # merge, publish, distribute, sublicense, and/or sell copies of the 10 | # Software, and to permit persons to whom the Software is furnished to 11 | # do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | # SOFTWARE. 24 | # 25 | # (http://opensource.org/licenses/mit-license.html) 26 | # 27 | # Intel HEX file parser 28 | # 29 | 30 | def parse(s): 31 | base_addr = 0 32 | mem = {} 33 | end = False 34 | for record in s.split('\n'): 35 | if record[0:1] == ':': 36 | if end: 37 | raise 'meh.' 38 | b = bytes.fromhex(record[1:]) 39 | if sum(b) & 0xff == 0: 40 | n_bytes = b[0] 41 | addr16 = b[1]<<8 | b[2] 42 | rec_type = b[3] 43 | data = b[4:-1] 44 | if n_bytes != len(data): 45 | raise ValueError(record) 46 | if rec_type == 0: 47 | for i,v in enumerate(data): 48 | mem[base_addr+addr16+i] = v 49 | elif rec_type == 1: 50 | end = True 51 | elif rec_type == 2: 52 | if len(data) != 2: 53 | raise ValueError(record) 54 | base_addr = ( data[1]<<8 | data[2] ) << 4 55 | elif rec_type == 4: 56 | if len(data) != 2: 57 | raise ValueError(record) 58 | base_addr = ( data[1]<<8 | data[2] ) << 16 59 | else: 60 | raise ValueError('rec_type \''+str(rec_type)+'\' unsupported') 61 | else: 62 | raise ValueError(record) 63 | return mem 64 | 65 | -------------------------------------------------------------------------------- /src/avrrc/virt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Copyright (c) 2020 Erik Bosman 4 | # 5 | # Permission is hereby granted, free of charge, to any person 6 | # obtaining a copy of this software and associated documentation 7 | # files (the "Software"), to deal in the Software without restriction, 8 | # including without limitation the rights to use, copy, modify, 9 | # merge, publish, distribute, sublicense, and/or sell copies of the 10 | # Software, and to permit persons to whom the Software is furnished to 11 | # do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | # SOFTWARE. 24 | # 25 | # (http://opensource.org/licenses/mit-license.html) 26 | 27 | import sys, os, time, cmath 28 | 29 | import pygame 30 | 31 | positions = [ 32 | 33 | (0.425919, 0.689152, -0.586227), 34 | (0.498675, 0.308198, -0.810146), 35 | (0.806873, 0.072756, -0.586227), 36 | (0.924594, 0.308198, -0.223919), 37 | (0.689152, 0.689152, -0.223919), 38 | (0.380954, 0.924594, 0.000000), 39 | (0.689152, 0.689152, 0.223919), 40 | (0.924594, 0.308198, 0.223919), 41 | (0.806873, 0.072756, 0.586227), 42 | (0.498675, 0.308198, 0.810146), 43 | (0.425919, 0.689152, 0.586227), 44 | (0.117721, 0.924594, 0.362309), 45 | (0.000000, 0.689152, 0.724617), 46 | (0.072756, 0.308198, 0.948536), 47 | (-0.308198, 0.072756, 0.948536), 48 | (-0.616396, 0.308198, 0.724617), 49 | (-0.425919, 0.689152, 0.586227), 50 | (-0.308198, 0.924594, 0.223919), 51 | (-0.689152, 0.689152, 0.223919), 52 | (-0.879629, 0.308198, 0.362309), 53 | (-0.997350, 0.072756, -0.000000), 54 | (-0.879629, 0.308198, -0.362309), 55 | (-0.689152, 0.689152, -0.223919), 56 | (-0.308198, 0.924594, -0.223919), 57 | (-0.425919, 0.689152, -0.586227), 58 | (-0.616396, 0.308198, -0.724617), 59 | (-0.308198, 0.072756, -0.948536), 60 | (0.072756, 0.308198, -0.948536), 61 | (0.000000, 0.689152, -0.724617), 62 | (0.117721, 0.924594, -0.362309), 63 | 64 | ] 65 | 66 | positions = positions + [ (-x,-y,z) for (x,y,z) in positions ] 67 | 68 | def rotate( x, y, angle): 69 | z = (x + y*1j)*cmath.rect(1, angle) 70 | return (z.real, z.imag) 71 | 72 | def flatten(coords, angle=0): 73 | return [ rotate(x, z, angle) for (x, y, z) in positions ] 74 | 75 | black = (0, 0, 0) 76 | 77 | class Metronome(object): 78 | def __init__(self, fps): 79 | self.delay = 1./fps 80 | 81 | def start(self): 82 | self.last = time.time() 83 | 84 | def sync(self): 85 | now = time.time() 86 | if self.delay > now-self.last: 87 | time.sleep(self.delay - (now-self.last)) 88 | self.last = max(now, self.last+self.delay) 89 | 90 | class VirtualScreen(object): 91 | 92 | def recalc(self, w, h ): 93 | self.pos = [ ( int((1+x*.9)*w/2), int((1+y*.9)*h/2) ) for (x,y) in self.positions ] 94 | 95 | def __init__(self, positions, windowsize=(500, 500)): 96 | pygame.init() 97 | self.screen = pygame.display.set_mode(windowsize, pygame.RESIZABLE | pygame.DOUBLEBUF) 98 | self.screen.fill(black) 99 | self.positions = positions 100 | min_dim = min(windowsize) 101 | self.recalc(min_dim, min_dim) 102 | self.r = min_dim / 10 103 | 104 | def draw_led(self, surf, x, y, r, color): 105 | midcolor = tuple( int(((x/255.)**.6) * 127.5) for x in color ) 106 | ledcolor = tuple( min(255, int(((x/255.)**.6) * 765)) for x in color ) 107 | for dim, bcolor in (.5, midcolor), (.25, ledcolor): 108 | pygame.draw.circle(surf, bcolor, (x, y), int(r*dim)) 109 | 110 | def draw(self): 111 | surf = pygame.display.get_surface() 112 | for i, (x, y) in enumerate(self.pos): 113 | self.draw_led(surf, x, y, self.r, self.buf[i*3:i*3+3]) 114 | 115 | def check_events(self): 116 | for event in pygame.event.get(): 117 | if event.type in (pygame.QUIT,): 118 | sys.exit(0) 119 | if event.type in (pygame.VIDEORESIZE,): 120 | self.screen = pygame.display.set_mode((event.w, event.h), 121 | pygame.RESIZABLE | pygame.DOUBLEBUF) 122 | self.r = float(event.w) / 10 123 | self.recalc(event.w, event.h) 124 | 125 | def load_data(self, data): 126 | self.buf = data 127 | 128 | def push_data(self, data): 129 | self.load_data(data) 130 | self.push() 131 | 132 | def push(self): 133 | self.check_events() 134 | self.draw() 135 | pygame.display.flip() 136 | self.screen.fill(black) 137 | 138 | 139 | pos = flatten(positions) 140 | pos = pos[:30]+[ (2-x, y) for (x,y) in pos[30:] ] 141 | s = VirtualScreen(windowsize=(640, 320), positions=pos) 142 | 143 | fps = 400. 144 | metronome = Metronome(fps) 145 | metronome.start() 146 | 147 | while True: 148 | d = sys.stdin.buffer.read(180) 149 | if len(d) == 0: 150 | break 151 | 152 | s.push_data(d) 153 | metronome.sync() 154 | -------------------------------------------------------------------------------- /src/avrrc/ws2812.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Copyright (c) 2020 Erik Bosman 4 | # 5 | # Permission is hereby granted, free of charge, to any person 6 | # obtaining a copy of this software and associated documentation 7 | # files (the "Software"), to deal in the Software without restriction, 8 | # including without limitation the rights to use, copy, modify, 9 | # merge, publish, distribute, sublicense, and/or sell copies of the 10 | # Software, and to permit persons to whom the Software is furnished to 11 | # do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | # SOFTWARE. 24 | # 25 | # (http://opensource.org/licenses/mit-license.html) 26 | # 27 | 28 | import sys 29 | import intelhex, avrrc 30 | 31 | PIN = 2 32 | 33 | def frame_timing(frame, idle_cycles, frame_cycles): 34 | print() 35 | print('cycles/frame+pause: {:d}, idle time: {:d}'.format(frame_cycles, idle_cycles)) 36 | 37 | def byte_hex(byte): 38 | print ('{:02x} '.format(byte), end='') 39 | 40 | def frame_stdout(frame, idle_cycles, frame_cycles): 41 | sys.stdout.buffer.write(bytes(frame)) 42 | sys.stdout.flush() 43 | 44 | def wave_func(pin, byte_func=None, frame_func=None): 45 | 46 | last_up=-1 47 | last_frame=-1 48 | byte=0 49 | bits=0 50 | frame = [] 51 | 52 | def func(ctx, addr, old, new): 53 | nonlocal last_up, last_frame, bits, byte, frame 54 | old = old>>pin & 1 55 | new = new>>pin &1 56 | if old ^ new: 57 | ts=ctx['ts'] 58 | d = ts-last_up 59 | if new: 60 | if d == 10: 61 | pass 62 | elif last_frame >= 0 and d < 2400: 63 | raise ValueError("wrong timing: timeout too short? "+str(d)) 64 | elif bits != 0: 65 | raise ValueError("incomplete byte") 66 | else: 67 | if last_frame >= 0: 68 | if frame_func: 69 | frame_func(frame, ts-last_up-10, ts-last_frame) 70 | frame = [] 71 | last_frame = ts 72 | 73 | last_up=ts 74 | first = False 75 | elif old: 76 | if d not in (3,7): 77 | raise ValueError("wrong timing: "+str(d)) 78 | byte = byte<<1 | int( d == 7 ) 79 | bits += 1 80 | if bits == 8: 81 | if byte_func: 82 | byte_func(byte) 83 | frame.append(byte) 84 | byte = 0 85 | bits = 0 86 | return func 87 | 88 | if __name__ == '__main__': 89 | 90 | if sys.argv[1:2] == ['-out']: 91 | func = wave_func(PIN, None, frame_stdout) 92 | elif sys.argv[1:2] == ['-timing']: 93 | func = wave_func(PIN, byte_hex, frame_timing) 94 | else: 95 | print ("Usage: {} -out|-timing < hexfile".format(sys.argv[0]), file=sys.stderr) 96 | sys.exit(1) 97 | 98 | flash = intelhex.parse(sys.stdin.read()) 99 | 100 | ctx = avrrc.init_ctx(flash) 101 | avrrc.watch_io(ctx, avrrc.PORTB, func) 102 | 103 | avrrc.run(ctx) 104 | -------------------------------------------------------------------------------- /src/msp2812/Makefile: -------------------------------------------------------------------------------- 1 | 2 | MCU=cc430f5137 3 | 4 | CC=msp430-gcc 5 | OBJCOPY=msp430-objcopy 6 | BSL=bin/cc430-bsl.py 7 | CFLAGS=-mmcu=$(MCU) -Wall -Wextra -I. -Os -g 8 | LDFLAGS= 9 | 10 | LDSCRIPT=msp430.x 11 | OBJS=dmesg.o uart.o ucs.o ws2812.o gamma_map.o rgbwaves.o ref.o lipo.o power.o radio.o packet.o transmit.o 12 | 13 | .PHONY: flash 14 | 15 | all: ball.elf ball.hex tx_tick.elf tx_tick.hex 16 | 17 | %.hex: %.elf 18 | $(OBJCOPY) -O ihex $< $@ 19 | 20 | %.elf: %.o $(LDSCRIPT) $(OBJS) 21 | $(CC) $(CFLAGS) -T $(LDSCRIPT) -o $@ $< $(OBJS) $(LDFLAGS) 22 | 23 | flash: ball.hex 24 | $(BSL) -ef $< -r 38400 25 | cp ball.hex lastflash.hex 26 | 27 | tflash: tx_tick.hex 28 | $(BSL) -ef $< -p /dev/ttyUSB3 -r 38400 29 | cp tx_tick.hex lastflash.hex 30 | 31 | %.o: %.c 32 | $(CC) -c $(CFLAGS) -o $@ $< 33 | 34 | clean: 35 | -rm -- *.hex *.elf *.o 36 | -------------------------------------------------------------------------------- /src/msp2812/README.md: -------------------------------------------------------------------------------- 1 | 2 | Software for the miniball driver board 2.0, which is based on the 3 | CC430F5137, and ultra-low-power msp430 chip. 4 | 5 | This board design and firmware is based on the firmware of the Goodwatch project: 6 | https://goodwatch.org/ 7 | https://github.com/travisgoodspeed/goodwatch/ 8 | 9 | This means that as per its license, I now owe Travis Goodspeed a pint of good, 10 | hoppy pale ale. 11 | 12 | ## WS2812 Driver 13 | 14 | The WS2812 LEDs (or in this case SK6805) are driven using a trick from 15 | https://github.com/RoXXoR/ws2812 . Every bit-encoding-waveform from the 16 | WS2812 protocol is encoded using 3 data-bits in an spi master output 17 | stream (0 -> 100, 1 -> 110). DMA is used to make sure the spi data is sent 18 | without hiccups at a bitrate of 2.4Mbit, resulting in a 800kHz waveform. 19 | 20 | As with the tiny2812 implementation, animations are gamma-corrected and 21 | use temporal dithering to still have decent colour-depth, even though the leds 22 | are never used at full brightness. 23 | 24 | The CPU clock runs at approx. 2.4MHz, so, 3 cycles per bit transmitted! 25 | 26 | ## TODO 27 | 28 | - Measure LiPO battery voltage using the ADC and a voltage drop over an LED. 29 | - Receive commands over the radio. 30 | - Shutdown on low power. 31 | 32 | -------------------------------------------------------------------------------- /src/msp2812/ball.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Severly stripped down version of the goodwatch main code 3 | */ 4 | 5 | 6 | /*! \file main.c 7 | 8 | \brief Main module. This version just initializes the LCD and then 9 | drops to a low power mode, letting the WDT do the work on a slow 10 | interval. 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | //#include "api.h" 19 | #include "dmesg.h" 20 | #include "uart.h" 21 | #include "ucs.h" 22 | #include "ref.h" 23 | #include "lipo.h" 24 | //#include "rng.h" 25 | #include "ws2812.h" 26 | #include "rgbwaves.h" 27 | #include "packet.h" 28 | 29 | static int q=0; 30 | 31 | void power_up_leds(void) 32 | { 33 | __delay_cycles(3000); 34 | P1OUT &= ~BIT2; 35 | P1DIR |= BIT2; 36 | __delay_cycles(3000); 37 | } 38 | 39 | void power_down_leds(void) 40 | { 41 | P1OUT |= BIT2; 42 | } 43 | 44 | void frame_clear(uint8_t *fb) 45 | { 46 | uint16_t i=0; 47 | for (i=0; i>4)&15] ); 63 | uart_tx("0123456789ABCDEF"[packet[i]&15] ); 64 | } 65 | uart_tx('\n'); 66 | } 67 | 68 | 69 | //! Power On Self Test 70 | int post(){ 71 | /* 72 | if (has_radio && RF1AIFERR & 2){ 73 | }else if(has_radio && RF1AIFERR & 4){ 74 | }else if(has_radio && RF1AIFERR & 8){ 75 | }else{ 76 | return 0; 77 | } 78 | 79 | printf("POST failure.\n"); 80 | //We had a failure, indicated above. 81 | return 1; 82 | */ 83 | return 0; 84 | } 85 | 86 | //! Main method. 87 | int main(void) { 88 | 89 | WDTCTL = WDTPW + WDTHOLD; // Stop WDT 90 | dmesg_init(); 91 | 92 | //printf("Initializing RNG "); 93 | //srand(true_rand()); // we do this as early as possible, because it messes with clocks 94 | 95 | /*printf("rtc "); 96 | lcd_string("RTC INIT"); 97 | rtc_init(); 98 | */ 99 | // P2OUT &= ~BIT2; 100 | // P2DIR |= BIT2; 101 | 102 | ws2812_init(); 103 | power_up_leds(); 104 | 105 | 106 | ucs_init(); 107 | __delay_cycles(30000); 108 | 109 | printf("uart\n"); 110 | uart_init(); 111 | ref_init(); 112 | lipo_init(); 113 | 114 | //printf("radio\n"); 115 | //radio_init(); 116 | 117 | printf("Beginning POST.\n"); 118 | // Run the POST until it passes. 119 | while( post() ); 120 | 121 | // Setup and enable WDT 250ms, ACLK, interval timer 122 | // WDTCTL = WDT_ADLY_250; 123 | // SFRIE1 |= WDTIE; 124 | 125 | printf("Booted.\n"); 126 | __bis_SR_register(GIE); 127 | 128 | rgbwaves_init(); 129 | 130 | ws2812_run(); 131 | 132 | int f=0, vOK=1, vnew; 133 | for (;;) 134 | { 135 | f++; 136 | if ((f & 0x3f) == 0) 137 | { 138 | vnew = lipo_voltage_ok_check(); 139 | if (vnew != vOK) 140 | { 141 | vOK = vnew; 142 | if (vOK) 143 | power_up_leds(); 144 | else 145 | { 146 | frame_clear(ws2812_fb); 147 | ws2812_next_sleep(); 148 | frame_clear(ws2812_fb); 149 | power_down_leds(); 150 | } 151 | } 152 | } 153 | 154 | if (vOK) 155 | rgbwaves_frame(ws2812_fb); 156 | 157 | ws2812_next_sleep(); 158 | } 159 | 160 | //__bis_SR_register(LPM3_bits + GIE); // Enter LPM3 161 | //__bis_SR_register(LPM2_bits + GIE); // Enter LPM2 162 | //__bis_SR_register(LPM0_bits + GIE); // Enter LPM0 w/interrupt 163 | 164 | while(1){ 165 | printf("q = %d\n", q); 166 | // printf("main while().\n"); 167 | } 168 | } 169 | 170 | //! Watchdog Timer interrupt service routine, calls back to handler functions. 171 | void __attribute__ ((interrupt(WDT_VECTOR))) watchdog_timer (void) { 172 | //__bic_SR_register_on_exit(); 173 | //__bis_SR_register_on_exit(); 174 | q++; 175 | uart_tx('X'); 176 | // static int latch=0; 177 | 178 | /* When the UART is in use, we don't want to hog interrupt time, so 179 | we will silently return. 180 | */ 181 | // if(uartactive) 182 | // return; 183 | 184 | /* Similarly, we'll reboot if the SET/PRGM button has been held for 10 185 | seconds (40 polls). We'll draw a countdown if getting close, so 186 | there's no ambiguity as to whether the chip reset. 187 | 188 | The other features of this button are handled within each application's 189 | draw function. 190 | */ 191 | // if(latch++>40) 192 | // PMMCTL0 = PMMPW | PMMSWPOR; 193 | 194 | } 195 | -------------------------------------------------------------------------------- /src/msp2812/ball.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/src/msp2812/ball.elf -------------------------------------------------------------------------------- /src/msp2812/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 3 | 4 | #define N_LEDS (30) 5 | #define N_BYTES_PER_LED (3) 6 | 7 | 8 | // You definitely want to uncomment and change this to your callsign. 9 | #define CALLSIGN "N0CALL" 10 | 11 | // The core voltage should be 0 for a coin cell, 2 or 3 for quality power. 12 | #define COREVOLTAGE 3 13 | 14 | // Uncomment this to emulate the SET button by holding + and - at once. 15 | //#define EMULATESET 16 | 17 | #endif // CONFIG_H 18 | -------------------------------------------------------------------------------- /src/msp2812/configdefault.h: -------------------------------------------------------------------------------- 1 | /*! \file configdefault.h 2 | \brief Default configuration values, to be overloaded in config.h 3 | 4 | Each of these options can be over-written by defining them in 5 | config.h, which is intentionally not included by the distribution. 6 | See configtemplate.h as an example when constructing your 7 | configuration. 8 | */ 9 | 10 | #include "config.h" 11 | 12 | #ifndef CALLSIGN 13 | #define CALLSIGN "N0CALL" 14 | #warning "CALLSIGN is not defined in config.h" 15 | #endif 16 | 17 | #ifndef COREVOLTAGE 18 | #define COREVOLTAGE 0 19 | #endif 20 | 21 | //Override this in config.h if you're testing an applet. 22 | #ifndef DEFAULTAPP 23 | #define DEFAULTAPP 0 24 | #endif 25 | 26 | /* This array holds the entries triggered by numbered buttons in the 27 | OOK applet. The first two bytes of each entry at MDMCFG4 and 28 | MDMCFG3 to set the bitrate, followed by the packet to be 29 | transmitted at that rate. See the GoodWatch wiki for details and 30 | sample projects to reverse engineer these settings. 31 | */ 32 | 33 | #ifndef OOKBUTTONS 34 | #define OOKBUTTONS \ 35 | /* Magicfly doorbell first, 200us.*/ \ 36 | "\xf7\x93" "\x00\xe8\xe8\x88\x88\xee\x88\x8e\x88\xee\x8e\x88\xee\x80\x00\x00", \ 37 | /* Settings for the Eco-Worthy Digital Motor Controller, ~430us */ \ 38 | "\x86\xd9" "\x00\xee\x8e\x8e\x8e\x8e\x8e\x8e\x8e\x88\x88\x88\xee\x80\x00\x00", \ 39 | "\x86\xd9" "\x00\xee\x8e\x8e\x8e\x8e\x8e\x8e\x8e\x88\x88\xee\x88\x80\x00\x00", \ 40 | "\x86\xd9" "\x00\xee\x8e\x8e\x8e\x8e\x8e\x8e\x8e\x88\xee\x88\x88\x80\x00\x00", \ 41 | "\x86\xd9" "\x00\xee\x8e\x8e\x8e\x8e\x8e\x8e\x8e\xee\x88\x88\x88\x80\x00\x00", \ 42 | /* No-name wireless relay controller. ~340us */ \ 43 | "\x86\xd9" "\x00\x00\xe8\xe8\xee\x88\xe8\x8e\xe8\x88\xee\xe8\x88\x8e\x80\x00", \ 44 | "\x86\xd9" "\x00\x00\xe8\xe8\xee\x88\xe8\x8e\xe8\x88\xee\xe8\x88\xe8\x80\x00", \ 45 | "\x86\xd9" "\x00\x00\xe8\xe8\xee\x88\xe8\x8e\xe8\x88\xee\xe8\x8e\x88\x80\x00", \ 46 | "\x86\xd9" "\x00\x00\xe8\xe8\xee\x88\xe8\x8e\xe8\x88\xee\xe8\xe8\x88\x80\x00" 47 | #endif 48 | -------------------------------------------------------------------------------- /src/msp2812/dmesg.c: -------------------------------------------------------------------------------- 1 | /*! \file dmesg.c 2 | \brief Kernel debug message buffer. 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | #include "dmesg.h" 9 | 10 | /* These three buffers are declared to be in the .noinit section so 11 | that a reboot will not wipe the buffer. Because the memory will be 12 | corrupted when power is lost, we manually wipe the buffer at 13 | startup if the magic is corrupted or if the index is unreasonable. 14 | */ 15 | 16 | //! Ought to be 0xdeadbeef except after power loss. 17 | uint32_t dmesg_magic __attribute__ ((section (".noinit"))); 18 | //! Index within that buffer. 19 | uint16_t dmesg_index __attribute__ ((section (".noinit"))); 20 | 21 | //! DMESG buffer itself. 22 | char *dmesg_buffer=(char*)0x2400; 23 | 24 | //! Writes a character to the dmesg buffer. 25 | int putchar(int c){ 26 | dmesg_index++; 27 | while(dmesg_index>DMESGLEN) 28 | dmesg_index=dmesg_index-DMESGLEN; 29 | return dmesg_buffer[dmesg_index]=(char) c; 30 | } 31 | 32 | //! Clears the dmesg buffer. 33 | void dmesg_clear(){ 34 | memset(dmesg_buffer, 0, DMESGLEN); 35 | dmesg_index=0; 36 | dmesg_magic=0xdeadbeef; 37 | } 38 | 39 | //! I ain't never initialized a buffer that didn't need initializin'. 40 | void dmesg_init(){ 41 | if(dmesg_magic!=0xdeadbeef){ 42 | dmesg_clear(); 43 | printf("Zeroed buffer for bad magic."); 44 | } 45 | printf("\n\n----\n"); 46 | } 47 | -------------------------------------------------------------------------------- /src/msp2812/dmesg.h: -------------------------------------------------------------------------------- 1 | /*! \file dmesg.h 2 | \brief Kernel debug message buffer. 3 | */ 4 | 5 | #define DMESGLEN 2048 6 | 7 | //! Ought to be 0xdeadbeef except after power loss. 8 | extern uint32_t dmesg_magic; 9 | //! Index within that buffer. 10 | extern uint16_t dmesg_index; 11 | 12 | extern char *dmesg_buffer; 13 | 14 | //! Clears the dmesg buffer. 15 | void dmesg_clear(); 16 | 17 | //! I ain't never initialized a buffer that didn't need initializin'. 18 | void dmesg_init(); 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/msp2812/gamma_map.c: -------------------------------------------------------------------------------- 1 | /* this file was auto-generated by gamma_map.py (max_val=0xf00, cut_off=0x18, gamma=2.5) */ 2 | #include 3 | 4 | const uint16_t gamma_map[256] = 5 | { 6 | 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1a,0x1c,0x1e,0x20,0x23,0x25,0x27,0x2a,0x2c,0x2f,0x32,0x35,0x38,0x3b,0x3e,0x41,0x44,0x48,0x4b,0x4f,0x52,0x56,0x5a,0x5e,0x62,0x67,0x6b,0x6f,0x74,0x79,0x7d,0x82,0x87,0x8d,0x92,0x97,0x9d,0xa2,0xa8,0xae,0xb4,0xba,0xc0,0xc6,0xcd,0xd3,0xda,0xe1,0xe8,0xe8,0x100,0x100,0x100,0x100,0x118,0x11c,0x124,0x12c,0x134,0x13c,0x145,0x14d,0x156,0x15f,0x168,0x171,0x17b,0x184,0x18e,0x197,0x1a1,0x1ab,0x1b5,0x1c0,0x1ca,0x1d5,0x1e0,0x1e8,0x200,0x200,0x200,0x218,0x223,0x22f,0x23b,0x247,0x253,0x25f,0x26c,0x279,0x286,0x293,0x2a0,0x2ad,0x2ba,0x2c8,0x2d6,0x2e4,0x2e8,0x300,0x318,0x31d,0x32c,0x33b,0x34a,0x359,0x369,0x378,0x388,0x398,0x3a8,0x3b8,0x3c8,0x3d9,0x3e8,0x400,0x400,0x41d,0x42e,0x440,0x452,0x464,0x476,0x488,0x49a,0x4ad,0x4c0,0x4d3,0x4e6,0x500,0x518,0x520,0x534,0x548,0x55d,0x571,0x586,0x59a,0x5af,0x5c4,0x5da,0x5e8,0x600,0x61b,0x631,0x647,0x65d,0x674,0x68b,0x6a2,0x6b9,0x6d0,0x6e8,0x700,0x718,0x730,0x748,0x761,0x779,0x792,0x7ab,0x7c4,0x7de,0x800,0x818,0x82b,0x846,0x860,0x87b,0x896,0x8b1,0x8cc,0x8e7,0x900,0x91f,0x93b,0x957,0x974,0x990,0x9ad,0x9ca,0x9e7,0xa00,0xa22,0xa40,0xa5e,0xa7d,0xa9b,0xaba,0xad9,0xb00,0xb18,0xb37,0xb56,0xb76,0xb96,0xbb7,0xbd7,0xc00,0xc19,0xc3a,0xc5c,0xc7d,0xc9f,0xcc1,0xce3,0xd00,0xd29,0xd4c,0xd6f,0xd92,0xdb6,0xdd9,0xe00,0xe22,0xe46,0xe6b,0xe90,0xeb5,0xeda,0xf00, 7 | }; 8 | 9 | -------------------------------------------------------------------------------- /src/msp2812/gamma_map.h: -------------------------------------------------------------------------------- 1 | #ifndef GAMMA_MAP_H 2 | #define GAMMA_MAP_H 3 | 4 | extern const uint16_t gamma_map[256]; 5 | #endif 6 | -------------------------------------------------------------------------------- /src/msp2812/gamma_map.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # 3 | # Copyright (c) 2017 Erik Bosman 4 | # 5 | # Permission is hereby granted, free of charge, to any person 6 | # obtaining a copy of this software and associated documentation 7 | # files (the "Software"), to deal in the Software without restriction, 8 | # including without limitation the rights to use, copy, modify, 9 | # merge, publish, distribute, sublicense, and/or sell copies of the 10 | # Software, and to permit persons to whom the Software is furnished to 11 | # do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | # SOFTWARE. 24 | # 25 | # (http://opensource.org/licenses/mit-license.html) 26 | # 27 | 28 | import sys 29 | 30 | max_val=0x0f00 31 | cut_off = 0x18 32 | gamma=2.5 33 | 34 | if len(sys.argv) >= 2: 35 | max_val = min(0xff00, int(sys.argv[1],0)) 36 | 37 | if len(sys.argv) >= 3: 38 | cutoff = min(0x7f, int(sys.argv[2],0)) 39 | 40 | if len(sys.argv) >= 4: 41 | gamma = float(sys.argv[3]) 42 | 43 | print ("/* this file was auto-generated by gamma_map.py (max_val={}, cut_off={}, gamma={}) */".format(hex(max_val), hex(cut_off), gamma)) 44 | print ("#include ") 45 | 46 | factor = max_val / (255.**gamma) 47 | gamma16 = [ int(x**gamma * factor) for x in range(256) ] 48 | 49 | for i,v in enumerate(gamma16): 50 | lo, hi = v&0xff, v>>8 51 | if lo <= cut_off/2: 52 | lo = 0 53 | elif lo < cut_off: 54 | lo = cut_off 55 | elif lo > 256-cut_off/2: 56 | lo, hi = 0, min(hi+1, max_val>>8) 57 | elif lo > 256-cut_off: 58 | lo = 256-cut_off 59 | gamma16[i] = lo | (hi<<8) 60 | 61 | print (""" 62 | const uint16_t gamma_map[256] = 63 | { 64 | """+','.join(hex(x) for x in gamma16)+""", 65 | }; 66 | """) 67 | -------------------------------------------------------------------------------- /src/msp2812/lipo.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "lipo.h" 5 | #include "uart.h" 6 | #include "ref.h" 7 | 8 | void lipo_init(void) 9 | { 10 | PMAPPWD = 0x02D52; 11 | P2MAP2 = PM_ANALOG; 12 | P2MAP3 = PM_ANALOG; 13 | PMAPPWD = 0; 14 | P2SEL |= BIT3; 15 | 16 | } 17 | 18 | /* code mostly copied from Goodwatch' adc_getvcc(), but since we use a voltage regulator, we measure 19 | * the LiPo battery's voltage behind a 1.718V diode (red LED) instead of via VCC. 20 | */ 21 | 22 | static int16_t get_adc_measurement(uint16_t mctl) 23 | { 24 | uint16_t meas; 25 | 26 | ADC12CTL0 = ADC12ON+ADC12SHT0_2; // Turn on and set up ADC12 27 | ADC12CTL1 = ADC12SHP; // Use sampling timer 28 | ADC12MCTL0 = mctl; 29 | 30 | // Enable conversions 31 | ADC12CTL0 |= ADC12ENC; 32 | 33 | //Start the conversion and fetch the result when ready. 34 | ADC12CTL0 |= ADC12SC; 35 | while ((ADC12IFG & BIT0)==0); 36 | meas=ADC12MEM0; 37 | 38 | /* The ADC is supposed to turn itself off automatically, but our 39 | watch will die an early death if we don't shut it down, so we do 40 | it manually. 41 | 42 | As an added tricky bit, we have to stop the current conversion, 43 | then power down the controller, or it will be stuck running. You 44 | can't just zero the registers. 45 | */ 46 | 47 | ADC12CTL0 &= ~ADC12ENC; //Disable conversion 48 | ADC12CTL0&=~ADC12ON; //Power off the controller. 49 | //Then we zero any remaining flags. 50 | ADC12CTL0=0; 51 | ADC12CTL1=0; 52 | ADC12MCTL0=0; 53 | 54 | return meas; 55 | } 56 | 57 | uint16_t get_lipo_voltage(void) 58 | { 59 | 60 | uint16_t adc = get_adc_measurement(ADC12SREF_1 | ADC12INCH_3); 61 | if (adc == 0xfff) 62 | { 63 | uint16_t adc_vcc_adc3 = get_adc_measurement(ADC12SREF_0 | ADC12INCH_3); 64 | uint16_t adc_vref_vcc = 2*get_adc_measurement(ADC12SREF_1 | ADC12INCH_11); 65 | adc = (uint16_t) ( ( (uint32_t)adc_vref_vcc*(uint32_t)adc_vcc_adc3 )/4096 ); 66 | } 67 | /* Millivolts 68 | */ 69 | return (uint16_t)(adc*0.6103515625+1430); 70 | } 71 | 72 | typedef enum 73 | { 74 | LOW = 0, HI = 1, HI_Z = 2, 75 | } lipo_status; 76 | 77 | static const char *lipo_stat_sym = "LHZ"; 78 | 79 | int lipo_stat(void) 80 | { 81 | P1DIR &=~BIT1; 82 | P1REN |= BIT1; 83 | P1OUT |= BIT1; 84 | int pu = !!(P1IN & BIT1); 85 | P1OUT &=~BIT1; 86 | int pd = !!(P1IN & BIT1); 87 | P1REN &=~BIT1; 88 | if (!pu) 89 | return LOW; 90 | if (!pd) 91 | return HI_Z; 92 | return HI; 93 | } 94 | 95 | void tx_num(uint16_t n) 96 | { 97 | char buf[10]; 98 | char *p; 99 | sprintf(buf, "%d\r\n", n); 100 | 101 | for (p=buf; *p; p++) 102 | uart_tx(*p); 103 | } 104 | 105 | static int vOK=1; 106 | 107 | int lipo_voltage_ok(void) 108 | { 109 | return vOK; 110 | } 111 | 112 | int lipo_voltage_ok_check(void) 113 | { 114 | ref_on(); 115 | __delay_cycles(1000); 116 | uint16_t mV = get_lipo_voltage(); 117 | tx_num(mV); 118 | ref_off(); 119 | uart_tx( lipo_stat_sym[lipo_stat()] ); 120 | uart_tx('\r'); 121 | uart_tx('\n'); 122 | 123 | if (vOK) 124 | vOK = !!(mV > 3300); 125 | else 126 | vOK = !!( (mV > 3500) || (lipo_stat()==LOW) ); 127 | 128 | return vOK; 129 | } 130 | -------------------------------------------------------------------------------- /src/msp2812/lipo.h: -------------------------------------------------------------------------------- 1 | #ifndef LIPO_H 2 | #define LIPO_H 3 | 4 | #include 5 | 6 | uint16_t get_lipo_voltage(void); 7 | int lipo_voltage_ok(void); 8 | int lipo_voltage_ok_check(void); 9 | 10 | void lipo_init(void); 11 | 12 | #endif // LIPO_H 13 | -------------------------------------------------------------------------------- /src/msp2812/memory.x: -------------------------------------------------------------------------------- 1 | /*! \file memory.x 2 | \brief Fork of linker script to reserve 2kB for dmesg. 3 | */ 4 | 5 | MEMORY { 6 | sfr : ORIGIN = 0x0000, LENGTH = 0x0010 /* END=0x0010, size 16 */ 7 | peripheral_8bit : ORIGIN = 0x0010, LENGTH = 0x00f0 /* END=0x0100, size 240 */ 8 | peripheral_16bit : ORIGIN = 0x0100, LENGTH = 0x0100 /* END=0x0200, size 256 */ 9 | bsl : ORIGIN = 0x1000, LENGTH = 0x0800 /* END=0x1800, size 2K as 4 512-byte segments */ 10 | infomem : ORIGIN = 0x1800, LENGTH = 0x0200 /* END=0x1a00, size 512 as 4 128-byte segments */ 11 | infod : ORIGIN = 0x1800, LENGTH = 0x0080 /* END=0x1880, size 128 */ 12 | infoc : ORIGIN = 0x1880, LENGTH = 0x0080 /* END=0x1900, size 128 */ 13 | infob : ORIGIN = 0x1900, LENGTH = 0x0080 /* END=0x1980, size 128 */ 14 | infoa : ORIGIN = 0x1980, LENGTH = 0x0080 /* END=0x1a00, size 128 */ 15 | /*ram (wx) : ORIGIN = 0x1c00, LENGTH = 0x0ffe /* END=0x2bfe, size 4094 */ 16 | ram (wx) : ORIGIN = 0x1c00, LENGTH = 0x0800 /* We use half of RAM for C code. */ 17 | dmesg (wx) : ORIGIN = 0x2400, LENGTH = 0x0800 /* Second half just for dmesg. */ 18 | rom (rx) : ORIGIN = 0x8000, LENGTH = 0x7f80 /* END=0xff80, size 32640 */ 19 | vectors : ORIGIN = 0xff80, LENGTH = 0x0080 /* END=0x10000, size 128 as 64 2-byte segments */ 20 | /* Remaining banks are absent */ 21 | ram2 (wx) : ORIGIN = 0x0000, LENGTH = 0x0000 22 | ram_mirror (wx) : ORIGIN = 0x0000, LENGTH = 0x0000 23 | usbram (wx) : ORIGIN = 0x0000, LENGTH = 0x0000 24 | far_rom : ORIGIN = 0x00000000, LENGTH = 0x00000000 25 | } 26 | REGION_ALIAS("REGION_TEXT", rom); 27 | REGION_ALIAS("REGION_DATA", ram); 28 | REGION_ALIAS("REGION_DMESG", dmesg); 29 | REGION_ALIAS("REGION_FAR_ROM", far_rom); 30 | PROVIDE (__info_segment_size = 0x80); 31 | PROVIDE (__infod = 0x1800); 32 | PROVIDE (__infoc = 0x1880); 33 | PROVIDE (__infob = 0x1900); 34 | PROVIDE (__infoa = 0x1980); 35 | -------------------------------------------------------------------------------- /src/msp2812/monitor.c: -------------------------------------------------------------------------------- 1 | /*! \file monitor.c 2 | \brief Debugging commands, often received over UART. 3 | 4 | These commands are transacted over the UART, in much the same way 5 | that the BSL commands would be transacted. 6 | 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "dmesg.h" 15 | #include "uart.h" 16 | #include "ucs.h" 17 | 18 | enum { 19 | SETTURBOMODE = 0x00, 20 | PEEK = 0x01, 21 | POKE = 0x02, 22 | DMESG = 0x04, 23 | 24 | } monitor_verb; 25 | 26 | 27 | //! Local command to send the dmesg buffer. 28 | static void send_dmesg(){ 29 | uint16_t i; 30 | char *dmesg_buffer=(char*)0x2400; 31 | 32 | //Start the frame. 33 | uart_tx(0x00); 34 | uart_tx(0x80); 35 | //Length 36 | uart_tx(DMESGLEN&0xFF); 37 | uart_tx(DMESGLEN>>8); 38 | 39 | //dmesg 40 | for(i=0;i>8); 65 | //Send integers byte by byte 66 | for(i=0;i 13 | #include 14 | #include "radio.h" 15 | #include "packet.h" 16 | 17 | //! Receive packet buffer, with room for RSSI and LQI. 18 | uint8_t rxbuffer[PACKETLEN+2]; 19 | //! Length of received packet. 20 | uint8_t rxlen; 21 | 22 | //! Transmit packet buffer. 23 | uint8_t txbuffer[PACKETLEN]; 24 | 25 | static int transmitting, receiving; 26 | 27 | //! Initialize the packet variables. Only called from radio_on(). 28 | void packet_init(){ 29 | transmitting=0; 30 | receiving=0; 31 | } 32 | 33 | //! Switch to receiving packets. 34 | void packet_rxon(){ 35 | receiving=1; 36 | 37 | RF1AIES |= BIT9; // Falling edge of RFIFG9 38 | RF1AIFG &= ~BIT9; // Clear a pending interrupt 39 | RF1AIE |= BIT9; // Enable the interrupt 40 | 41 | radio_strobe( RF_SRX ); 42 | } 43 | 44 | //! Stop receiving packets. 45 | void packet_rxoff(){ 46 | RF1AIE &= ~BIT9; // Disable RX interrupts 47 | RF1AIFG &= ~BIT9; // Clear pending IFG 48 | 49 | /* If RXOFF is called in the middle of a packet, it's necessary to 50 | flux the RX queue. 51 | */ 52 | radio_strobe( RF_SIDLE ); 53 | radio_strobe( RF_SFRX ); 54 | receiving=0; 55 | } 56 | 57 | //! Transmit a packet. 58 | void packet_tx(uint8_t *buffer, uint8_t length){ 59 | if(transmitting){ 60 | printf("Refusing to transmit with pending packet.\n"); 61 | return; 62 | } 63 | transmitting=1; 64 | 65 | RF1AIES |= BIT9; 66 | RF1AIFG &= ~BIT9; // Clear pending interrupts 67 | RF1AIE |= BIT9; // Enable TX end-of-packet interrupt 68 | 69 | 70 | //Write the packet into the buffer. 71 | radio_writeburstreg(RF_TXFIFOWR, buffer, length); 72 | 73 | //Strobe into transmit mode. 74 | radio_strobe( RF_STX ); 75 | 76 | } 77 | 78 | 79 | //! Interrupt handler for incoming packets. 80 | void __attribute__ ((interrupt(CC1101_VECTOR))) 81 | packet_isr (void) { 82 | int rf1aiv=RF1AIV; 83 | int state; 84 | 85 | switch(rf1aiv&~1){ // Prioritizing Radio Core Interrupt 86 | case 0: break; // No RF core interrupt pending 87 | case 2: break; // RFIFG0 88 | case 4: break; // RFIFG1 89 | case 6: break; // RFIFG2 90 | case 8: break; // RFIFG3 91 | case 10: break; // RFIFG4 92 | case 12: break; // RFIFG5 93 | case 14: break; // RFIFG6 94 | case 16: break; // RFIFG7 95 | case 18: break; // RFIFG8 96 | case 20: // RFIFG9 97 | if(receiving){//End of RX packet. 98 | 99 | //Wait for end of packet. 100 | do{ 101 | state=radio_getstate(); 102 | __delay_cycles(8500); 103 | }while(state==13 || state==14 || state==15 || state==20 || state==21); 104 | 105 | 106 | if(state==1){ 107 | // Read the length byte from the FIFO. 108 | rxlen = radio_readreg( RXBYTES ); 109 | //__delay_cycles(8500); 110 | 111 | /* We read no more than our buffer. */ 112 | radio_readburstreg(RF_RXFIFORD, rxbuffer, 113 | rxlen>PACKETLEN?PACKETLEN:rxlen); 114 | 115 | //Inform the application. 116 | app_packetrx(rxbuffer,rxlen); 117 | }else if(state==17){ 118 | printf("RX Overflow.\n"); 119 | radio_strobe(RF_SIDLE); 120 | }else{ 121 | printf("Unknown RX state %d.\n",state); 122 | printf("rx, tx = %d, %d\n", 123 | receiving, 124 | transmitting); 125 | } 126 | /* 127 | // Check the CRC results 128 | if(RxBuffer[CRC_LQI_IDX] & CRC_OK){ 129 | printf("Correct CRC\n"); 130 | }else{ 131 | printf("Incorrect CRC.\n"); 132 | } 133 | */ 134 | }else if(transmitting){ //End of TX packet. 135 | //printf("Transmitted packet.\n"); 136 | RF1AIE &= ~BIT9; // Disable TX end-of-packet interrupt 137 | transmitting = 0; 138 | //Inform the application. 139 | // app_packettx(); 140 | }else{ 141 | printf("Unexpected packet ISR.\n"); 142 | } 143 | break; 144 | case 22: break; // RFIFG10 145 | case 24: break; // RFIFG11 146 | case 26: break; // RFIFG12 147 | case 28: break; // RFIFG13 148 | case 30: break; // RFIFG14 149 | case 32: break; // RFIFG15 150 | } 151 | 152 | //printf("Handled.\n"); 153 | //__bic_SR_register_on_exit(LPM3_bits); 154 | } 155 | -------------------------------------------------------------------------------- /src/msp2812/packet.h: -------------------------------------------------------------------------------- 1 | /*! \file packet.h 2 | \brief Packet handling library. 3 | */ 4 | 5 | #include 6 | 7 | //! Length of the packet buffer. 8 | #define PACKETLEN 128 9 | 10 | //! Receive packet buffer. 11 | extern uint8_t rxbuffer[]; 12 | //! Transmit packet buffer. 13 | extern uint8_t txbuffer[]; 14 | 15 | void packet_init(void); 16 | 17 | //! Switch to receiving packets. 18 | void packet_rxon(); 19 | 20 | //! Stop receiving packets. 21 | void packet_rxoff(); 22 | 23 | //! Transmit a packet. 24 | void packet_tx(uint8_t *buffer, uint8_t length); 25 | 26 | 27 | //! Provide an incoming packet. 28 | void app_packetrx(uint8_t *packet, int len); 29 | //! Callback after a packet has been sent. 30 | void app_packettx(); 31 | 32 | -------------------------------------------------------------------------------- /src/msp2812/power.c: -------------------------------------------------------------------------------- 1 | /*! \file power.c 2 | \brief Power management library for the CC430F6137. 3 | 4 | These library functions are responsible for powering up the CC430 5 | when necessary for the radio, and for dropping power at all other 6 | times. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | //! Returns non-zero if in anything but the lowest power mode. 13 | int power_ishigh(){ 14 | return 15 | ( PMMCTL0_L & PMMHPMRE_L) //High power mode. 16 | || (PMMCTL0 & PMMCOREV_3) //VCore in anything but 0 mode. 17 | ; 18 | } 19 | 20 | //! Step the core voltage up 21 | static unsigned int power_vcoreup (unsigned char level) { 22 | unsigned int PMMRIE_backup,SVSMHCTL_backup; 23 | 24 | // Open PMM registers for write access 25 | PMMCTL0_H = 0xA5; 26 | 27 | // Disable dedicated Interrupts to prevent that needed flags will be 28 | // cleared 29 | PMMRIE_backup = PMMRIE; 30 | PMMRIE &= ~(SVSMHDLYIE | SVSMLDLYIE | SVMLVLRIE | SVMHVLRIE | SVMHVLRPE); 31 | // Set SVM highside to new level and check if a VCore increase is 32 | // possible 33 | SVSMHCTL_backup = SVSMHCTL; 34 | PMMIFG &= ~(SVMHIFG | SVSMHDLYIFG); 35 | SVSMHCTL = SVMHE | SVMHFP | (SVSMHRRL0 * level); 36 | // Wait until SVM highside is settled 37 | while ((PMMIFG & SVSMHDLYIFG) == 0); 38 | // Disable full-performance mode to save energy 39 | SVSMHCTL &= ~SVSLFP ; 40 | 41 | // Check if a VCore increase is possible 42 | if ((PMMIFG & SVMHIFG) == SVMHIFG){ 43 | // Vcc is too low for a Vcore increase, so recover the previous 44 | // settings. 45 | 46 | printf("VCC too low to raise core.\n"); 47 | 48 | PMMIFG &= ~SVSMHDLYIFG; 49 | SVSMHCTL = SVSMHCTL_backup; 50 | // Wait until SVM highside is settled 51 | while ((PMMIFG & SVSMHDLYIFG) == 0); 52 | // Clear all Flags 53 | PMMIFG &= ~(SVMHVLRIFG | SVMHIFG | SVSMHDLYIFG 54 | | SVMLVLRIFG | SVMLIFG | SVSMLDLYIFG); 55 | // backup PMM-Interrupt-Register 56 | PMMRIE = PMMRIE_backup; 57 | 58 | // Lock PMM registers for write access 59 | PMMCTL0_H = 0x00; 60 | return 0;//Not set. 61 | } 62 | 63 | // Set also SVS highside to new level 64 | //-> Vcc is high enough for a Vcore increase 65 | SVSMHCTL |= SVSHE | (SVSHRVL0 * level); 66 | // Set SVM low side to new level 67 | SVSMLCTL = SVMLE | SVMLFP | (SVSMLRRL0 * level); 68 | // Wait until SVM low side is settled 69 | while ((PMMIFG & SVSMLDLYIFG) == 0); 70 | // Clear already set flags 71 | PMMIFG &= ~(SVMLVLRIFG | SVMLIFG); 72 | // Set VCore to new level 73 | PMMCTL0_L = PMMCOREV0 * level; 74 | // Wait until new level reached 75 | if (PMMIFG & SVMLIFG) 76 | while ((PMMIFG & SVMLVLRIFG) == 0); 77 | // Set also SVS/SVM low side to new level 78 | PMMIFG &= ~SVSMLDLYIFG; 79 | SVSMLCTL |= SVSLE | (SVSLRVL0 * level); 80 | // wait for lowside delay flags 81 | while ((PMMIFG & SVSMLDLYIFG) == 0); 82 | 83 | // Disable SVS/SVM Low 84 | // Disable full-performance mode to save energy 85 | SVSMLCTL &= ~(SVSLE+SVMLE+SVSLFP ); 86 | 87 | // Clear all Flags 88 | PMMIFG &= ~(SVMHVLRIFG | SVMHIFG | SVSMHDLYIFG 89 | | SVMLVLRIFG | SVMLIFG | SVSMLDLYIFG); 90 | // backup PMM-Interrupt-Register 91 | PMMRIE = PMMRIE_backup; 92 | 93 | // Lock PMM registers for write access 94 | PMMCTL0_H = 0x00; 95 | return 1;//okay 96 | } 97 | 98 | //! Step the voltage core down. 99 | static unsigned int power_vcoredown (unsigned char level) { 100 | unsigned int PMMRIE_backup; 101 | 102 | // Open PMM registers for write access 103 | PMMCTL0_H = 0xA5; 104 | 105 | // Disable dedicated Interrupts to prevent that needed flags will be cleared 106 | PMMRIE_backup = PMMRIE; 107 | PMMRIE &= ~(SVSMHDLYIE | SVSMLDLYIE | SVMLVLRIE | SVMHVLRIE | SVMHVLRPE); 108 | 109 | // Set SVM high side and SVM low side to new level 110 | PMMIFG &= ~(SVMHIFG | SVSMHDLYIFG | SVMLIFG | SVSMLDLYIFG); 111 | SVSMHCTL = SVMHE | SVMHFP | (SVSMHRRL0 * level); 112 | SVSMLCTL = SVMLE | SVMLFP | (SVSMLRRL0 * level); 113 | // Wait until levels are settled. 114 | while ((PMMIFG & SVSMHDLYIFG) == 0 || (PMMIFG & SVSMLDLYIFG) == 0); 115 | 116 | 117 | // Set VCore to new level 118 | PMMCTL0_L = PMMCOREV0 * level; 119 | 120 | /* 121 | printf("Changing high and low sides.\n"); 122 | // Set also SVS highside and SVS low side to new level 123 | PMMIFG &= ~(SVSHIFG | SVSMHDLYIFG | SVSLIFG | SVSMLDLYIFG); 124 | 125 | printf("a\n"); 126 | SVSMHCTL |= SVSHE | SVSHFP | (SVSHRVL0 * level); 127 | printf("b\n"); 128 | SVSMLCTL |= SVSLE | SVSLFP | (SVSLRVL0 * level); 129 | */ 130 | 131 | 132 | // Wait until SVS high side and SVS low side is settled 133 | //while ((PMMIFG & SVSMHDLYIFG) == 0 || (PMMIFG & SVSMLDLYIFG) == 0); 134 | 135 | // Disable full-performance mode to save energy 136 | SVSMHCTL &= ~SVSLFP; 137 | // Disable SVS/SVM Low 138 | // Disable full-performance mode to save energy 139 | SVSMLCTL &= ~(SVSLE+SVMLE+SVSLFP); 140 | 141 | 142 | // Clear all Flags 143 | PMMIFG &= ~(SVMHVLRIFG | SVMHIFG | SVSMHDLYIFG 144 | | SVMLVLRIFG | SVMLIFG | SVSMLDLYIFG); 145 | // backup PMM-Interrupt-Register 146 | PMMRIE = PMMRIE_backup; 147 | // Lock PMM registers for write access 148 | PMMCTL0_H = 0x00; 149 | 150 | if ((PMMIFG & SVMHIFG) == SVMHIFG) 151 | // Highside is still too low for the adjusted VCore Level 152 | return 0; 153 | else 154 | return 1; 155 | } 156 | 157 | 158 | //! Sets the core core voltage. 159 | int power_setvcore (int level) { 160 | int oldlevel, origlevel; 161 | int status = 1; 162 | 163 | //Mask off the level. 164 | level &= PMMCOREV_3; 165 | //Current core voltage. 166 | origlevel = oldlevel = (PMMCTL0 & PMMCOREV_3); 167 | 168 | // step by step increase or decrease 169 | while (((level != oldlevel) && (status)) || (level < oldlevel)) { 170 | if (level > oldlevel) 171 | status = power_vcoreup(++oldlevel); 172 | else 173 | status = power_vcoredown(--oldlevel); 174 | __delay_cycles(850); 175 | } 176 | 177 | printf("Power %d->%d.\n", 178 | origlevel, 179 | PMMCTL0 & PMMCOREV_3); 180 | return status; 181 | } 182 | -------------------------------------------------------------------------------- /src/msp2812/power.h: -------------------------------------------------------------------------------- 1 | /*! \file power.h 2 | \brief Power management library for the CC430F6137. 3 | */ 4 | 5 | //! Returns non-zero if in anything but the lowest power mode. 6 | int power_ishigh(); 7 | 8 | //! Sets the core core voltage. 9 | int power_setvcore (int level); 10 | -------------------------------------------------------------------------------- /src/msp2812/radio.h: -------------------------------------------------------------------------------- 1 | /*! \file radio.h 2 | \brief RF1A Radio Module Driver 3 | 4 | */ 5 | 6 | //! Set to 1 if the watch has a radio. 7 | extern int has_radio; 8 | 9 | //! Called at boot. Gracefully fails if no radio. 10 | void radio_init(); 11 | 12 | //! Turns the radio on. Returns zero on failure. 13 | void radio_on(); 14 | 15 | //! Sets the radio frequency. 16 | void radio_setfreq(float freq); 17 | //! Sets the raw radio frequency registers. 18 | void radio_setrawfreq(uint8_t freq2, uint8_t freq1, uint8_t freq0); 19 | //! Gets the radio frequency. 20 | uint32_t radio_getfreq(); 21 | 22 | //! Restarts the radio. (Call this after radio_on().) 23 | void radio_resetcore(); 24 | 25 | //! Turns the radio off. 26 | void radio_off(); 27 | 28 | 29 | //! Read a register from the radio. 30 | uint8_t radio_readreg(uint8_t addr); 31 | //! Write to a register in the radio. 32 | void radio_writereg(uint8_t addr, uint8_t value); 33 | 34 | //! Read multiple bytes from a register. 35 | void radio_readburstreg(uint8_t addr, 36 | uint8_t *buffer, uint8_t count); 37 | //! Write multiple bytes to a register. 38 | void radio_writeburstreg(uint8_t addr, 39 | uint8_t *buffer, uint8_t count); 40 | 41 | //! Writes a set of values ot the power table. 42 | void radio_writepatable(uint8_t *table, uint8_t count); 43 | 44 | //! Strobe a radio register. 45 | uint8_t radio_strobe(uint8_t strobe); 46 | 47 | //! Writes a table of radio settings until the first null pair. 48 | void radio_writesettings(const uint8_t *settings); 49 | 50 | //! Writes one value to the power table. 51 | void radio_writepower(uint8_t value); 52 | 53 | //! Read the RSSI. 54 | int radio_getrssi(); 55 | //! Read the radio MARC state. 56 | int radio_getstate(); 57 | -------------------------------------------------------------------------------- /src/msp2812/ref.c: -------------------------------------------------------------------------------- 1 | /*! \file ref.c 2 | \brief Power reference module for the CC430F6137 and CC430F6147. 3 | 4 | Previously, we used the built-in power request features of the ADC12 5 | in the CC430F6137, but this is bad for two reasons. First, the 6 | ADC10 in the '6147 lacks power requests, and second, there are more 7 | efficient power modes that might reduce the current consumption of 8 | our LCD charge pump. 9 | 10 | */ 11 | 12 | #include 13 | #include 14 | 15 | 16 | //! Turn the reference on. 17 | void ref_on(){ 18 | REFCTL0 |= REFON; 19 | } 20 | 21 | //! Turn the reference off. 22 | void ref_off(){ 23 | REFCTL0 &= ~REFON; 24 | } 25 | 26 | //! Switch the the static mode, which is power hungry but more reliable. 27 | void ref_staticmode(){ 28 | REFCTL0 |= BGMODE; 29 | } 30 | 31 | //! Switch to sample mode, which is more efficient. 32 | void ref_sampledmode(){ 33 | REFCTL0 &= ~BGMODE; 34 | } 35 | 36 | 37 | //! Activates and configures the module, but does not turn on reference. 38 | void ref_init(){ 39 | //Setting the master bit disables legacy mode. 40 | REFCTL0|=REFMSTR; 41 | 42 | //Wait for register to not be busy before modifying voltage. 43 | while(REFCTL0 & REFGENBUSY); 44 | 45 | //2.5V reference. 46 | ref_sampledmode(); 47 | REFCTL0|=REFVSEL_2; 48 | } 49 | 50 | 51 | //! Print the REF status. 52 | void ref_status(){ 53 | printf("REFCTL0=0x%04x\n", REFCTL0); 54 | } 55 | -------------------------------------------------------------------------------- /src/msp2812/ref.h: -------------------------------------------------------------------------------- 1 | /*! \file ref.h 2 | \brief Power reference module for the CC430F6137 and CC430F6147. 3 | */ 4 | 5 | //! Turn the reference on. 6 | void ref_on(); 7 | 8 | //! Turn the reference off. 9 | void ref_off(); 10 | 11 | //! Activate the module and turn it on. 12 | void ref_init(); 13 | 14 | //! Switch the the static mode, which is power hungry but more reliable. 15 | void ref_staticmode(); 16 | 17 | //! Switch to sample mode, which is more efficient. 18 | void ref_sampledmode(); 19 | 20 | //! Print the REF status. 21 | void ref_status(); 22 | -------------------------------------------------------------------------------- /src/msp2812/rgbwaves.h: -------------------------------------------------------------------------------- 1 | #ifndef RGBWAVES_H 2 | #define RGBWAVES_H 3 | 4 | #include 5 | 6 | void rgbwaves_frame(uint8_t *frame); 7 | void rgbwaves_init(void); 8 | 9 | #endif // RGBWAVES_H 10 | -------------------------------------------------------------------------------- /src/msp2812/transmit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * adapted from goodwatch' ook.c 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "radio.h" 10 | #include "packet.h" 11 | 12 | /* Settings were prototyped first in Python. This is basic OOK with 13 | no preamble, no CRC, and 341µs symbol times. 14 | */ 15 | static const uint8_t ook_settings[]={ 16 | //Change these to change the rate. 17 | MDMCFG4, 0x86, // 0x80 | exponent // Modem Configuration 18 | MDMCFG3, 0xd9, // mantissa 19 | //These rest are consistent for all OOK emulation. 20 | MDMCFG2, 0x30, // Modem Configuration, no sync 21 | FREND0 , 0x11, // Front End TX Configuration 22 | FSCAL3 , 0xE9, // Frequency Synthesizer Calibration 23 | FSCAL2 , 0x2A, // Frequency Synthesizer Calibration 24 | FSCAL1 , 0x00, // Frequency Synthesizer Calibration 25 | FSCAL0 , 0x1F, // Frequency Synthesizer Calibration 26 | PKTCTRL0, 0x00, // Packet automation control, fixed length without CRC. 27 | // PKTLEN, LEN, // PKTLEN Packet length. 28 | 0,0 29 | }; 30 | 31 | void transmit_msg(uint8_t *msg, int len) 32 | { 33 | radio_on(); 34 | radio_writesettings(ook_settings); 35 | radio_writereg(PKTLEN, len); 36 | radio_writepower(0x25); 37 | radio_setfreq(433960000); 38 | packet_tx(msg, len); 39 | radio_off(); 40 | } 41 | -------------------------------------------------------------------------------- /src/msp2812/transmit.h: -------------------------------------------------------------------------------- 1 | 2 | #define TICK (uint8_t *)("\x00\x0e\x48\xeb\xa3\xae") 3 | #define TICK_LEN (6) 4 | 5 | void transmit_msg(uint8_t *msg, int len); 6 | 7 | -------------------------------------------------------------------------------- /src/msp2812/tx_tick.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Severly stripped down version of the goodwatch main code 3 | */ 4 | 5 | 6 | /*! \file main.c 7 | 8 | \brief Main module. This version just initializes the LCD and then 9 | drops to a low power mode, letting the WDT do the work on a slow 10 | interval. 11 | */ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | //#include "api.h" 19 | #include "dmesg.h" 20 | #include "uart.h" 21 | #include "ucs.h" 22 | #include "ref.h" 23 | #include "lipo.h" 24 | #include "dmesg.h" 25 | #include "radio.h" 26 | #include "packet.h" 27 | #include "transmit.h" 28 | #include "ws2812.h" 29 | #include "rgbwaves.h" 30 | 31 | static int q=0; 32 | 33 | void power_up_leds(void) 34 | { 35 | __delay_cycles(3000); 36 | P1OUT &= ~BIT2; 37 | P1DIR |= BIT2; 38 | __delay_cycles(3000); 39 | } 40 | 41 | void power_down_leds(void) 42 | { 43 | P1OUT |= BIT2; 44 | } 45 | 46 | void frame_clear(uint8_t *fb) 47 | { 48 | uint16_t i=0; 49 | for (i=0; i>4)&15] ); 65 | uart_tx("0123456789ABCDEF"[packet[i]&15] ); 66 | } 67 | uart_tx('\n'); 68 | } 69 | 70 | //! Callback after a packet has been sent. 71 | void app_packettx() 72 | { 73 | char *p = "Packet sent\n"; 74 | for ( ; *p ; p++ ) 75 | uart_tx(*p); 76 | } 77 | 78 | 79 | //! Power On Self Test 80 | int post(){ 81 | 82 | if (has_radio && RF1AIFERR & 2){ 83 | }else if(has_radio && RF1AIFERR & 4){ 84 | }else if(has_radio && RF1AIFERR & 8){ 85 | }else{ 86 | return 0; 87 | } 88 | 89 | uart_tx('.'); 90 | printf("POST failure.\n"); 91 | //We had a failure, indicated above. 92 | return 1; 93 | } 94 | 95 | //! Main method. 96 | int main(void) { 97 | 98 | WDTCTL = WDTPW + WDTHOLD; // Stop WDT 99 | dmesg_init(); 100 | 101 | ucs_init(); 102 | __delay_cycles(30000); 103 | 104 | printf("uart\n"); 105 | uart_init(); 106 | ref_init(); 107 | lipo_init(); 108 | 109 | printf("radio\n"); 110 | radio_init(); 111 | packet_init(); 112 | 113 | printf("Beginning POST.\n"); 114 | // Run the POST until it passes. 115 | while( post() ); 116 | 117 | printf("Booted.\n"); 118 | __bis_SR_register(GIE); 119 | 120 | for(;;) 121 | { 122 | uint8_t c = uart_rx_block(); 123 | if (c == '.') 124 | { 125 | uint16_t i; 126 | for (i=0 ; i40) 162 | // PMMCTL0 = PMMPW | PMMSWPOR; 163 | 164 | } 165 | -------------------------------------------------------------------------------- /src/msp2812/uart.c: -------------------------------------------------------------------------------- 1 | /*! \file uart.c 2 | \brief UART Driver for the GoodWatch 3 | 4 | 5 | The goal here is to use P1.5 and P1.6 as a UART, just as the BSL 6 | does. 7 | 8 | Because we *also* use these pins for the MODE and SET buttons, we 9 | need to be a bit tricky about their initialization, and the UART may 10 | not be used at the same time as those watch buttons. The general 11 | idea is that uartactive will be set to 1 when the UART receives its 12 | first commands. 13 | 14 | Similarly, we can't handle the UART at our normal rate of 32kHz, so 15 | the first command must be sent as individual bytes to raise the CPU 16 | speed. 17 | 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include "uart.h" 25 | #include "monitor.h" 26 | 27 | void uart_init(){ 28 | printf("Initializing UART "); 29 | 30 | PMAPPWD = 0x02D52; 31 | P1MAP5 = PM_UCA0RXD; // Map UCA0RXD output to P1.5 32 | P1MAP6 = PM_UCA0TXD; // Map UCA0TXD output to P1.6 33 | PMAPPWD = 0; 34 | 35 | P1DIR |= BIT6; // Set P1.6 as TX output 36 | P1SEL |= BIT5 + BIT6; // Select P1.5 & P1.6 to UART function 37 | 38 | UCA0CTL1 |= UCSWRST; // **Put state machine in reset** 39 | UCA0CTL1 |= UCSSEL_1; // ACLK 40 | UCA0BR0 = 3; // 32kHz 9600 (see User's Guide) 41 | UCA0BR1 = 0; // 32kHz 9600 42 | UCA0MCTL = UCBRS_3 + UCBRF_0; // Modln UCBRSx=0, UCBRFx=0, 43 | 44 | UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine** 45 | //UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt 46 | //UCA0IE |= UCTXIE; // Enable USCI_A0 TX interrupt 47 | 48 | } 49 | 50 | void uart_tx(uint8_t byte) 51 | { 52 | while (!(UCA0IFG&UCTXIFG)); 53 | UCA0TXBUF = byte; 54 | } 55 | 56 | int16_t uart_rx_nonblock(void) 57 | { 58 | if (!(UCA0IFG&UCRXIFG)) 59 | return -1; 60 | return (uint8_t)UCA0RXBUF; 61 | } 62 | 63 | uint8_t uart_rx_block(void) 64 | { 65 | while (!(UCA0IFG&UCRXIFG)); 66 | return (uint8_t)UCA0RXBUF; 67 | } 68 | 69 | -------------------------------------------------------------------------------- /src/msp2812/uart.h: -------------------------------------------------------------------------------- 1 | 2 | void uart_init(); 3 | void uart_tx(uint8_t byte); 4 | int16_t uart_rx_nonblock(void); 5 | uint8_t uart_rx_block(void); 6 | 7 | -------------------------------------------------------------------------------- /src/msp2812/ucs.c: -------------------------------------------------------------------------------- 1 | /*! \file ucs.c 2 | \brief Clocking functions. 3 | 4 | This module implements a minimal driver for the Unified Clock System 5 | of the CC430F6137 and related devices. In general, we try to run in 6 | slow mode whenever possible, jumping to fast mode only during 7 | diagnostics or if required (briefly) for a radio exchange. At all 8 | other times, we run the CPU at 32kHz for power efficiency. 9 | 10 | */ 11 | 12 | #include 13 | 14 | #include 15 | //#include "api.h" 16 | 17 | //! Fast mode. 18 | void ucs_fast() 19 | { 20 | // Loop until DCO stabilizes 21 | do 22 | { 23 | UCSCTL7 &= ~(DCOFFG|XT1LFOFFG); 24 | // Clear DCO fault flags 25 | SFRIFG1 &= ~OFIFG; // Clear fault flags 26 | } 27 | while (SFRIFG1 & OFIFG); // Test oscillator fault flag 28 | 29 | UCSCTL4 = SELA__REFOCLK | SELS__DCOCLK | SELM__DCOCLK; // REFO for ACLK (uart), SMCLK (spi) and MCLK from DCO. 30 | } 31 | 32 | //! Slow mode. 33 | void ucs_slow() 34 | { 35 | UCSCTL4 = SELA__REFOCLK | SELS__VLOCLK | SELM__VLOCLK; // REFO for ACLK (uart), SMCLK (spi) and MCLK from VLO very slow CPU. 36 | } 37 | 38 | void ucs_init(){ 39 | 40 | __bis_SR_register(SCG0); 41 | 42 | UCSCTL0 = 0x0000; 43 | UCSCTL1 = DCORSEL_3; 44 | UCSCTL2 = FLLD_0 | (FLLN0*73); /* 1 * (1*73) * REFO = 2.39MHz */ 45 | UCSCTL3 = SELREF__REFOCLK | FLLREFDIV_0; 46 | 47 | __bic_SR_register(SCG0); 48 | 49 | ucs_slow(); 50 | 51 | ucs_fast(); 52 | } 53 | -------------------------------------------------------------------------------- /src/msp2812/ucs.h: -------------------------------------------------------------------------------- 1 | /*! \file ucs.h 2 | \brief Clocking functions. 3 | */ 4 | 5 | //! Fast mode. 6 | void ucs_fast(); 7 | 8 | //! Slow mode. 9 | void ucs_slow(); 10 | 11 | //! Initialize the XT1 crystal, and stabilize it. 12 | void ucs_init(); 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/msp2812/ws2812.h: -------------------------------------------------------------------------------- 1 | #ifndef WS2812_H 2 | #define WS2812_H 3 | 4 | /* Uses: 5 | * UCB0 (using SPI MOSI as ws2812 waveform) 6 | * SMCLK as clocksource for spi 7 | * DMA0 8 | * TA1 400Hz interval timer with interrupt to generate frames at 400FPS 9 | * ACLK as interval timer clock source 10 | * 11 | * Assumes: 12 | * SMCLK clocked at ~2.4MHz 13 | * ACLK clocked at ~32.768kHz 14 | */ 15 | 16 | #include 17 | 18 | #include "config.h" 19 | 20 | #define DITHER_FRAMES (16) /* 400FPS actual frames, 25 FPS animation */ 21 | 22 | #ifndef N_LEDS 23 | #error "N_LEDS needs to be defined in config.h" 24 | #endif 25 | #ifndef N_BYTES_PER_LED 26 | #error "N_BYTES_PER_LED needs to be defined in config.h" 27 | #endif 28 | 29 | #define N_BYTES (N_LEDS*N_BYTES_PER_LED) 30 | 31 | extern uint8_t *ws2812_fb; /* points to current framebuffer to be drawn */ 32 | extern volatile uint8_t ws2812_wait; 33 | 34 | void ws2812_init(void); 35 | void ws2812_next(void); 36 | void ws2812_next_sleep(void); /* suspend to LPM3 until the next animation fram can be drawn */ 37 | void ws2812_run(void); 38 | void ws2812_stop(void); 39 | 40 | #endif // WS2812_H 41 | -------------------------------------------------------------------------------- /src/tiny2812/Makefile: -------------------------------------------------------------------------------- 1 | 2 | # change these to the right values 3 | 4 | MCU = attiny85 # as known by avr-gcc 5 | PARTNO = t85 # as known by avrdude 6 | PROGRAMMER = usbtiny 7 | 8 | 9 | TARGET = example_ani.hex 10 | ELFTARGET = example_ani.elf 11 | COMMON = gamma_map.c tiny2812.c 12 | 13 | AVRDUDE = avrdude -v -c $(PROGRAMMER) -p$(PARTNO) 14 | 15 | .PHONY: clean 16 | 17 | all: $(TARGET) $(ELFTARGET) 18 | 19 | 20 | %.hex: %.elf 21 | avr-objcopy -j .text -j .data -O ihex $< $@ 22 | 23 | %.elf: %.c $(COMMON) 24 | avr-gcc -mmcu=$(MCU) -O -o $@ $^ -Wall 25 | 26 | %.o: %.S 27 | avr-gcc -mmcu=$(MCU) -c -o $@ $< 28 | 29 | %.o: %.c 30 | avr-gcc -O -mmcu=$(MCU) -c -o $@ $< -Wall 31 | 32 | flash: $(TARGET) 33 | avrdude -v -c usbtiny -pt85 -U flash:w:$(TARGET) 34 | 35 | fuses: 36 | avrdude -v -c usbtiny -pt85 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m 37 | 38 | clean: 39 | -rm $(TARGET) $(ELFTARGET) 40 | -------------------------------------------------------------------------------- /src/tiny2812/README.md: -------------------------------------------------------------------------------- 1 | 2 | tiny2812 3 | ======== 4 | 5 | Drive a small number of WS2811/WS2812/WS2812b/SK6812 LEDs with 6 | on-the-fly temporal dithering and gamma correction using an AVR 7 | (like the attiny85) running at 8MHz or 16MHz, perfect for tiny 8 | wearables. 9 | 10 | A timer triggered interrupt handler bitbangs frames while keeping 11 | track of temporal dithering remainders. The time in between 12 | interrupts can be spent generating new frames. 13 | 14 | More than *9 x number_of_leds* bytes of RAM are needed due to 15 | double buffers and temporal dithering bookkeeping. 16 | 17 | The code (without the animation generation code) takes up about 18 | 1K of flash memory including the gamma correction table. 19 | 20 | API 21 | === 22 | 23 | ```C 24 | 25 | extern uint8_t *frame; /* buffer to paint on */ 26 | 27 | /* Initializes buffers and timer */ 28 | void init(void); 29 | 30 | /* Endless loop, calling next_frame() & suspending to save energy */ 31 | void run(void); 32 | 33 | /* to be implemented by animation creator */ 34 | void next_frame(void); 35 | 36 | ``` 37 | 38 | Gamma\_map.py 39 | ============= 40 | 41 | Generate the gamma correction map used by the bitbang code. 42 | 43 | Example: 44 | 45 | ```sh 46 | python gamma_map.py 0x3f00 0x18 2.5 47 | ``` 48 | 49 | This generates a gamma map with a max brightness of 0x3f (63), 50 | no temporal dithering with a period < 0x18/0x100 to prevent flickering, 51 | and a gamma of 2.5. 52 | 53 | MEASURE\_VCC / inv\_vcc 54 | ======================= 55 | 56 | The code also periodically measures the bandgap voltage compared to the 57 | supply voltage. This may be used to shut down the power supply to the 58 | LEDs when a LiPo/LiIon battery is drained. However, this bandgap voltage 59 | is not calibrated out-of-factory and can vary a lot between individual 60 | chips. 61 | 62 | ```C 63 | #ifdef MEASURE_VCC 64 | extern volatile uint16_t inv_vcc; /* uncalibrated inverted bandgap voltage measurement inv_vcc = 1024*bandgap/vcc */ 65 | #endif 66 | ``` 67 | 68 | -------------------------------------------------------------------------------- /src/tiny2812/ani_test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Erik Bosman 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without restriction, 7 | * including without limitation the rights to use, copy, modify, 8 | * merge, publish, distribute, sublicense, and/or sell copies of the 9 | * Software, and to permit persons to whom the Software is furnished to 10 | * do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * (http://opensource.org/licenses/mit-license.html) 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | 32 | #include "tiny2812.h" 33 | 34 | 35 | const uint8_t wave[256] PROGMEM = 36 | { 37 | 0, 0, 0, 1, 2, 3, 5, 7, 9, 12, 15, 18, 21, 25, 28, 33, 37, 41, 46, 51, 56, 61, 67, 72, 78, 84, 90, 96, 102, 108, 115, 121, 127, 133, 139, 146, 152, 158, 164, 170, 176, 182, 187, 193, 198, 203, 208, 213, 217, 221, 226, 229, 233, 236, 239, 242, 245, 247, 249, 251, 252, 253, 254, 254, 255, 254, 254, 253, 252, 251, 249, 247, 245, 242, 239, 236, 233, 229, 226, 221, 217, 213, 208, 203, 198, 193, 187, 182, 176, 170, 164, 158, 152, 146, 139, 133, 127, 121, 115, 108, 102, 96, 90, 84, 78, 72, 67, 61, 56, 51, 46, 41, 37, 33, 28, 25, 21, 18, 15, 12, 9, 7, 5, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 38 | }; 39 | 40 | 41 | static int8_t r,g,b; 42 | 43 | 44 | void next_frame(void) 45 | { 46 | uint8_t i, j, c; 47 | 48 | j=0; 49 | r+=3; g+=3; b+=3; 50 | for (i=0; i<25; i++) 51 | { 52 | c = g&0x7f; 53 | frame[j++] = pgm_read_byte_near(wave+c); 54 | c = r&0x7f; 55 | frame[j++] = pgm_read_byte_near(wave+c); 56 | c = b&0x7f; 57 | frame[j++] = pgm_read_byte_near(wave+c); 58 | } 59 | } 60 | 61 | void main(void) 62 | { 63 | r=0,g=0x55,b=0xaa; 64 | _delay_loop_2(MS_TIMEOUT); /* 1 ms, seems to prevent timer from not working sometimes... brownout(?, seems unlikely) time clock init(?) */ 65 | init(); 66 | run(); 67 | } 68 | 69 | -------------------------------------------------------------------------------- /src/tiny2812/example_ani.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/src/tiny2812/example_ani.elf -------------------------------------------------------------------------------- /src/tiny2812/example_vcc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Erik Bosman 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without restriction, 7 | * including without limitation the rights to use, copy, modify, 8 | * merge, publish, distribute, sublicense, and/or sell copies of the 9 | * Software, and to permit persons to whom the Software is furnished to 10 | * do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | * 24 | * (http://opensource.org/licenses/mit-license.html) 25 | */ 26 | 27 | #include 28 | #include 29 | 30 | #include "tiny2812.h" 31 | 32 | static int8_t c,ix; 33 | 34 | void next_frame(void) 35 | { 36 | uint8_t i,j; 37 | for (i=0, j=0; i<16; i++, j+=3) 38 | { 39 | if (inv_vcc & (1< 3 | 4 | const uint8_t gamma_map[512] PROGMEM = 5 | { 6 | /* low bytes (temp dithering remainders) */ 7 | 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1a,0x1c,0x1e,0x20,0x23,0x25,0x27,0x2a,0x2c,0x2f,0x32,0x35,0x38,0x3b,0x3e,0x41,0x44,0x48,0x4b,0x4f,0x52,0x56,0x5a,0x5e,0x62,0x67,0x6b,0x6f,0x74,0x79,0x7d,0x82,0x87,0x8d,0x92,0x97,0x9d,0xa2,0xa8,0xae,0xb4,0xba,0xc0,0xc6,0xcd,0xd3,0xda,0xe1,0xe8,0xe8,0x0,0x0,0x0,0x0,0x18,0x1c,0x24,0x2c,0x34,0x3c,0x45,0x4d,0x56,0x5f,0x68,0x71,0x7b,0x84,0x8e,0x97,0xa1,0xab,0xb5,0xc0,0xca,0xd5,0xe0,0xe8,0x0,0x0,0x0,0x18,0x23,0x2f,0x3b,0x47,0x53,0x5f,0x6c,0x79,0x86,0x93,0xa0,0xad,0xba,0xc8,0xd6,0xe4,0xe8,0x0,0x18,0x1d,0x2c,0x3b,0x4a,0x59,0x69,0x78,0x88,0x98,0xa8,0xb8,0xc8,0xd9,0xe8,0x0,0x0,0x1d,0x2e,0x40,0x52,0x64,0x76,0x88,0x9a,0xad,0xc0,0xd3,0xe6,0x0,0x18,0x20,0x34,0x48,0x5d,0x71,0x86,0x9a,0xaf,0xc4,0xda,0xe8,0x0,0x1b,0x31,0x47,0x5d,0x74,0x8b,0xa2,0xb9,0xd0,0xe8,0x0,0x18,0x30,0x48,0x61,0x79,0x92,0xab,0xc4,0xde,0x0,0x18,0x2b,0x46,0x60,0x7b,0x96,0xb1,0xcc,0xe7,0x0,0x1f,0x3b,0x57,0x74,0x90,0xad,0xca,0xe7,0x0,0x22,0x40,0x5e,0x7d,0x9b,0xba,0xd9,0x0,0x18,0x37,0x56,0x76,0x96,0xb7,0xd7,0x0,0x19,0x3a,0x5c,0x7d,0x9f,0xc1,0xe3,0x0,0x29,0x4c,0x6f,0x92,0xb6,0xd9,0x0,0x22,0x46,0x6b,0x90,0xb5,0xda,0x0, 8 | /* high bytes */ 9 | 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x1,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x2,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x5,0x5,0x5,0x5,0x5,0x5,0x5,0x5,0x5,0x5,0x5,0x5,0x5,0x6,0x6,0x6,0x6,0x6,0x6,0x6,0x6,0x6,0x6,0x6,0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x7,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x9,0x9,0x9,0x9,0x9,0x9,0x9,0x9,0x9,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xa,0xb,0xb,0xb,0xb,0xb,0xb,0xb,0xb,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xe,0xe,0xe,0xe,0xe,0xe,0xe,0xf, 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /src/tiny2812/gamma_map.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef GAMMA_MAP_H 3 | #define GAMMA_MAP_H 4 | 5 | #include 6 | 7 | extern const uint8_t gamma_map[512] PROGMEM; 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /src/tiny2812/gamma_map.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python2 2 | # 3 | # Copyright (c) 2017 Erik Bosman 4 | # 5 | # Permission is hereby granted, free of charge, to any person 6 | # obtaining a copy of this software and associated documentation 7 | # files (the "Software"), to deal in the Software without restriction, 8 | # including without limitation the rights to use, copy, modify, 9 | # merge, publish, distribute, sublicense, and/or sell copies of the 10 | # Software, and to permit persons to whom the Software is furnished to 11 | # do so, subject to the following conditions: 12 | # 13 | # The above copyright notice and this permission notice shall be 14 | # included in all copies or substantial portions of the Software. 15 | # 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | # SOFTWARE. 24 | # 25 | # (http://opensource.org/licenses/mit-license.html) 26 | # 27 | 28 | import sys 29 | 30 | max_val=0x0f00 31 | cut_off = 0x18 32 | gamma=2.5 33 | 34 | if len(sys.argv) >= 2: 35 | max_val = min(0xff00, int(sys.argv[1],0)) 36 | 37 | if len(sys.argv) >= 3: 38 | cutoff = min(0x7f, int(sys.argv[2],0)) 39 | 40 | if len(sys.argv) >= 4: 41 | gamma = float(sys.argv[3]) 42 | 43 | print ("/* this file was auto-generated by gamma_map.py (max_val={}, cut_off={}, gamma={}) */".format(hex(max_val), hex(cut_off), gamma)) 44 | print ("#include ") 45 | 46 | factor = max_val / (255.**gamma) 47 | gamma16 = [ int(x**gamma * factor) for x in range(256) ] 48 | l, h = [0]*256, [0]*256 49 | 50 | for i,v in enumerate(gamma16): 51 | lo, hi = v&0xff, v>>8 52 | if lo <= cut_off/2: 53 | lo = 0 54 | elif lo < cut_off: 55 | lo = cut_off 56 | elif lo > 256-cut_off/2: 57 | lo, hi = 0, min(hi+1, max_val>>8) 58 | elif lo > 256-cut_off: 59 | lo = 256-cut_off 60 | l[i], h[i] = lo, hi 61 | 62 | print (""" 63 | const uint8_t gamma_map[512] PROGMEM = 64 | { 65 | /* low bytes (temp dithering remainders) */ 66 | """+','.join(hex(x) for x in l)+""", 67 | /* high bytes */ 68 | """+','.join(hex(x) for x in h)+""", 69 | }; 70 | """) 71 | 72 | -------------------------------------------------------------------------------- /src/tiny2812/testfire/calcpos.py: -------------------------------------------------------------------------------- 1 | import cmath 2 | 3 | #miniball 4 | positions = [ 5 | [0.689152, 0.689152, -0.223919], 6 | 7 | [0.380954, 0.924594, 0.000000], 8 | 9 | [0.117721, 0.924594, 0.362309], 10 | 11 | [0.000000, 0.689152, 0.724617], 12 | [0.072756, 0.308198, 0.948536], 13 | [-0.308198, 0.072756, 0.948536], 14 | [-0.616396, 0.308198, 0.724617], 15 | [-0.425919, 0.689152, 0.586227], 16 | 17 | [-0.308198, 0.924594, 0.223919], 18 | 19 | [-0.689152, 0.689152, 0.223919], 20 | [-0.879629, 0.308198, 0.362309], 21 | [-0.997350, 0.072756, -0.000000], 22 | [-0.879629, 0.308198, -0.362309], 23 | [-0.689152, 0.689152, -0.223919], 24 | 25 | [-0.308198, 0.924594, -0.223919], 26 | 27 | [-0.425919, 0.689152, -0.586227], 28 | [-0.616396, 0.308198, -0.724617], 29 | [-0.308198, 0.072756, -0.948536], 30 | [0.072756, 0.308198, -0.948536], 31 | [0.000000, 0.689152, -0.724617], 32 | 33 | [0.117721, 0.924594, -0.362309], 34 | 35 | [0.425919, 0.689152, -0.586227], 36 | [0.498675, 0.308198, -0.810146], 37 | [0.806873, 0.072756, -0.586227], 38 | [0.924594, 0.308198, -0.223919], 39 | 40 | [0.924594, 0.308198, 0.223919], 41 | [0.806873, 0.072756, 0.586227], 42 | [0.498675, 0.308198, 0.810146], 43 | [0.425919, 0.689152, 0.586227], 44 | [0.689152, 0.689152, 0.223919], 45 | ] 46 | 47 | def d2(a, b): 48 | ax, ay = a 49 | bx, by = b 50 | dx, dy = ax-bx, ay-by 51 | return dx*dx + dy*dy 52 | 53 | # 'pull in' corners 54 | def grid_to_circle_projection(dim): 55 | proj = [None] * 64 56 | dim = int(dim) 57 | for y in range(dim): 58 | dy = y*2-(dim-1) 59 | for x in range(dim): 60 | dx = x*2-(dim-1) 61 | i = x + y * dim 62 | if dx == 0 and dy == 0: 63 | lx, ly = 1, 1 64 | elif abs(dy) < abs(dx): 65 | lx, ly = float(dim), float(dy)/dx*dim 66 | else: 67 | lx, ly = float(dx)/dy*dim, float(dim) 68 | r = 1/(lx*lx + ly*ly)**.5 69 | nx, ny = dx*r, dy*r 70 | proj[i] = (nx,ny) 71 | 72 | return proj 73 | 74 | def rotate( x, y, angle): 75 | z = (x + y*1j)*cmath.rect(1, angle) 76 | return (z.real, z.imag) 77 | 78 | def flatten(coords, angle=0): 79 | return [ rotate(x, z, angle) for (x, y, z) in positions ] 80 | 81 | def map_to_nearest(from_, to): 82 | x = [None] * len(from_) 83 | m = [None] * len(from_) 84 | 85 | for ia, a in enumerate(from_): 86 | for ib, b in enumerate(to): 87 | d = d2(a,b) 88 | if x[ia] == None or x[ia] > d: 89 | x[ia] = d 90 | m[ia] = ib 91 | 92 | return m 93 | 94 | def mapping(angle = 0, dim=8): 95 | return map_to_nearest(flatten(positions, angle), grid_to_circle_projection(dim)) 96 | 97 | if __name__ == '__main__': 98 | print (mapping()) 99 | -------------------------------------------------------------------------------- /src/tiny2812/testfire/colortab.py: -------------------------------------------------------------------------------- 1 | 2 | def color(x): 3 | r,g,b = (x**1*3, x**1.5*3., x**2) 4 | if r > 1.: 5 | r = 1. 6 | if g > 1.: 7 | g = 1. 8 | if b > 1.: 9 | b = 1. 10 | if (r, g, b) == (1., 1., 1.): 11 | r,g,b = 0.,0.,0. 12 | return hex(int(g*255))+','+hex(int(r*255))+','+hex(int(b*255))+',' 13 | 14 | print(', '.join( [color(x/64.) for x in xrange(64) ] + ['0,0,0']*(256-64))) 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/tiny2812/testfire/fire.py: -------------------------------------------------------------------------------- 1 | import sys, os 2 | 3 | import pygame 4 | 5 | import sync 6 | import calcpos 7 | 8 | black = (0, 0, 0) 9 | 10 | class VirtualScreen(object): 11 | 12 | def recalc(self, w, h ): 13 | self.pos = [ ( int((1+x*.9)*w/2), int((1+y*.9)*h/2) ) for (x,y) in self.positions ] 14 | 15 | def __init__(self, positions, windowsize=(500, 500)): 16 | pygame.init() 17 | self.screen = pygame.display.set_mode(windowsize, pygame.RESIZABLE | pygame.DOUBLEBUF) 18 | self.screen.fill(black) 19 | self.positions = positions 20 | self.recalc(float(windowsize[0]), float(windowsize[1])) 21 | self.r = float(windowsize[0]) / 10 22 | 23 | def draw_led(self, surf, x, y, r, color): 24 | midcolor = tuple( int(((x/255.)**.6) * 127.5) for x in color ) 25 | ledcolor = tuple( min(255, int(((x/255.)**.6) * 765)) for x in color ) 26 | for dim, bcolor in (.5, midcolor), (.25, ledcolor): 27 | pygame.draw.circle(surf, bcolor, (x, y), int(r*dim)) 28 | 29 | def draw(self): 30 | surf = pygame.display.get_surface() 31 | for i, (x, y) in enumerate(self.pos): 32 | self.draw_led(surf, x, y, self.r, tuple(x for x in self.buf[i*3:i*3+3])) 33 | 34 | def check_events(self): 35 | for event in pygame.event.get(): 36 | if event.type in (pygame.QUIT,): 37 | sys.exit(0) 38 | if event.type in (pygame.VIDEORESIZE,): 39 | self.screen = pygame.display.set_mode((event.w, event.h), 40 | pygame.RESIZABLE | pygame.DOUBLEBUF) 41 | self.r = float(event.w) / 10 42 | self.recalc(event.w, event.h) 43 | 44 | def load_data(self, data): 45 | self.buf = data 46 | 47 | def push_data(self, data): 48 | self.load_data(data) 49 | self.push() 50 | 51 | def push(self): 52 | self.check_events() 53 | self.draw() 54 | pygame.display.flip() 55 | self.screen.fill(black) 56 | 57 | 58 | class Fire: 59 | 60 | def color(self, x): 61 | r,g,b = (x**1*3, x**1.5*4., x**2) 62 | if r > 1.: 63 | r = 1. 64 | if g > 1.: 65 | g = 1. 66 | if b > 1.: 67 | b = 1. 68 | if (r, g, b) == (1., 1., 1.): 69 | r,g,b = 0.,0.,0. 70 | return bytes ( (int(r*255), int(g*255), int(b*255)) ) 71 | 72 | def __init__(self, w, h): 73 | self.img = [ [ 0 ] * w for y in range(h+1) ] 74 | self.w, self.h = w, h 75 | self.mapping = [ int((x/64.)**1.7 / 12.7 * 64.) for x in range(255) ] + [ 63 ] 76 | #self.mapping = [ int((x/64.)**1.7 / 7.7 * 64.) for x in range(255) ] + [ 128 ] 77 | self.colortab = [ self.color(x/64.) for x in range(64) ] + [b'\0\0\0']*(256-64) 78 | self.it = 0 79 | self.map = [30, 29, 44, 51, 60, 58, 56, 50, 42, 33, 40, 24, 16, 25, 18, 10, 0, 2, 4, 11, 20, 13, 6, 15, 31, 39, 55, 62, 53, 38] 80 | 81 | # /* https://www.avrfreaks.net/forum/tiny-fast-prng */ 82 | #uint8_t prng(void) { 83 | #static uint8_t s=0xaa,a=0; 84 | # 85 | # s^=s<<3; 86 | # s^=s>>5; 87 | # s^=a++>>2; 88 | # return s; 89 | #} 90 | self.s = 0xaa 91 | self.a = 0 92 | def prng(self): 93 | self.s ^= self.s <<3 94 | self.s ^= self.s >>5 95 | self.a += 1 96 | self.s ^= self.a >> 2 97 | return self.s 98 | 99 | def next(self): 100 | w, h = self.w, self.h 101 | 102 | self.it += 1 103 | if self.it % 8 == 0: 104 | r = self.prng() 105 | for x in range(w): 106 | self.img[h][x] = 44 * (r&1) 107 | r >>= 1 108 | 109 | for y in range(h): 110 | for x in range(w): 111 | s = 0 112 | for dx in (-1, 0, 1): 113 | if 0 <= x+dx < w: 114 | s += self.img[y+1][(x+dx)%w] 115 | self.img[y][x] = (self.img[y][x]>>1) + (self.img[y][x]>>2) + self.mapping[min(s,255)] 116 | #self.img[y][x] = (self.img[y][x]>>1) + self.mapping[min(s,255)] 117 | 118 | img = [ self.img[y][x] for y in range(self.h) for x in range(self.w) ] 119 | return b''.join( self.colortab[ img[ix] ] for ix in self.map ) 120 | 121 | 122 | if __name__ == '__main__': 123 | 124 | pos = calcpos.flatten(calcpos.positions) 125 | 126 | s = VirtualScreen(windowsize=(500, 500), positions=pos) 127 | a = Fire(8, 8) 128 | 129 | fps = 25. 130 | metronome = sync.Metronome(fps) 131 | metronome.start() 132 | 133 | while True: 134 | s.push_data(a.next()) 135 | metronome.sync() 136 | -------------------------------------------------------------------------------- /src/tiny2812/testfire/sync.py: -------------------------------------------------------------------------------- 1 | import time 2 | 3 | class Metronome(object): 4 | def __init__(self, fps): 5 | self.delay = 1./fps 6 | 7 | def start(self): 8 | self.last = time.time() 9 | 10 | def sync(self): 11 | now = time.time() 12 | if self.delay > now-self.last: 13 | time.sleep(self.delay - (now-self.last)) 14 | self.last = max(now, self.last+self.delay) 15 | 16 | -------------------------------------------------------------------------------- /src/tiny2812/tiny2812.h: -------------------------------------------------------------------------------- 1 | #ifndef TINY2812_H 2 | #define TINY2812_H 3 | 4 | #include 5 | 6 | #ifndef F_CPU 7 | #define F_CPU 8000000UL 8 | #endif 9 | 10 | #if F_CPU == 8000000 11 | #define MS_TIMEOUT (2000) 12 | #elif F_CPU == 16000000 13 | #define MS_TIMEOUT (4000) 14 | #endif 15 | 16 | /* measure VCC by default */ 17 | #ifndef NO_MEASURE_VCC 18 | #define MEASURE_VCC 19 | #endif 20 | 21 | #define OUTPORT PORTB 22 | #define OUTPIN 4 23 | #define LED_POWER_MOSFET_PIN 3 24 | 25 | #define N_LEDS (30) 26 | #define N_BYTES (3*N_LEDS) 27 | 28 | #define TEMP_DIFF_FRAMES 16 29 | 30 | #ifdef MEASURE_VCC 31 | extern volatile uint16_t inv_vcc; /* uncalibrated inverted bandgap voltage measurement inv_vcc = 1024*bandgap/vcc */ 32 | #endif 33 | 34 | extern uint8_t *frame; /* buffer to paint on */ 35 | 36 | /* Initializes buffers and timer */ 37 | void init(void); 38 | 39 | /* Endless loop, calling next_frame() & suspending to save energy */ 40 | void run(void); 41 | 42 | /* to be implemented by animation creator */ 43 | void next_frame(void); 44 | 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /uball_pcb/footprints.pretty/3mm_hole.kicad_mod: -------------------------------------------------------------------------------- 1 | (module 3mm_hole (layer F.Cu) (tedit 5895D0B5) 2 | (fp_text reference REF** (at 0 -3.81) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value "3mm hole" (at -0.635 3.81) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (pad "" thru_hole circle (at 0 0) (size 3 3) (drill 3) (layers *.Cu *.Mask)) 9 | ) 10 | -------------------------------------------------------------------------------- /uball_pcb/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name footprints)(type KiCad)(uri "$(KIPRJMOD)/footprints.pretty")(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /uball_pcb/gerbrename.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rename s'/(.*?)-Edge.Cuts\..*/$1.GKO/' gerb/* 4 | rename s'/(.*?)-.*\.(...)$/$1.\U$2/' gerb/* 5 | rename s'/(.*?).drl/$1.TXT/' gerb/* 6 | 7 | -------------------------------------------------------------------------------- /uball_pcb/uball.pro: -------------------------------------------------------------------------------- 1 | update=Sat 04 Feb 2017 01:23:09 PM CET 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [eeschema] 27 | version=1 28 | LibDir= 29 | [eeschema/libraries] 30 | LibName1=power 31 | LibName2=device 32 | LibName3=transistors 33 | LibName4=conn 34 | LibName5=linear 35 | LibName6=regul 36 | LibName7=74xx 37 | LibName8=cmos4000 38 | LibName9=adc-dac 39 | LibName10=memory 40 | LibName11=xilinx 41 | LibName12=microcontrollers 42 | LibName13=dsp 43 | LibName14=microchip 44 | LibName15=analog_switches 45 | LibName16=motorola 46 | LibName17=texas 47 | LibName18=intel 48 | LibName19=audio 49 | LibName20=interface 50 | LibName21=digital-audio 51 | LibName22=philips 52 | LibName23=display 53 | LibName24=cypress 54 | LibName25=siliconi 55 | LibName26=opto 56 | LibName27=atmel 57 | LibName28=contrib 58 | LibName29=valves 59 | [general] 60 | version=1 61 | -------------------------------------------------------------------------------- /uball_pcb/uball.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 2 2 | -------------------------------------------------------------------------------- /uball_pcb/uball.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brainsmoke/miniball/1558c9a8df693618fcc1f0aa521587d6a25c3366/uball_pcb/uball.zip -------------------------------------------------------------------------------- /uball_pcb/uball/uball.GKO: -------------------------------------------------------------------------------- 1 | G04 #@! TF.FileFunction,Profile,NP* 2 | %FSLAX46Y46*% 3 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 4 | G04 Created by KiCad (PCBNEW 4.0.5+dfsg1-4) date Mon Jul 17 17:59:51 2017* 5 | %MOMM*% 6 | %LPD*% 7 | G01* 8 | G04 APERTURE LIST* 9 | %ADD10C,0.100000*% 10 | %ADD11C,0.150000*% 11 | G04 APERTURE END LIST* 12 | D10* 13 | D11* 14 | X100000000Y0D02* 15 | X0Y0D01* 16 | X100000000Y-100000000D02* 17 | X100000000Y0D01* 18 | X0Y-100000000D02* 19 | X100000000Y-100000000D01* 20 | X0Y0D02* 21 | X0Y-100000000D01* 22 | M02* 23 | --------------------------------------------------------------------------------