# 4. Electronics production

## nueval

- [nueval](https://nueval.fabacademy.org/#/login)
    - Login with fablabs.io
    - Student's checklist -> **Send Message to Instructor(in English)** -> Local evaluation
    - Progress -> Completed (Assignment done)
    - (Local eval) Completed x 2 -> Request to Global Evaluation
    - Global Evaluator will be assigned -> Global Evaluation starts
    - (Global eval) Completed all + Final Presentation -> Graduate!

----

## Preparation for next week
> **3D Scanning and Printing**  
> *group assignment:*  
> - test the design rules for your 3D printer(s)  
>   
> *individual assignment:*  
>  - design and 3D print an object (small, few cm3, limited by printer time)  
>  that could not be made subtractively  
>   - 3D scan an object (and optionally print it)  

### FAQ Define cannot be easily made subtractively
> Answer: Your model has undercuts), overhangs, nested parts, meshes etc.

Ref. [assesment](https://fabacademy.org/2022/nueval/3d_scanning_and_printing.html)

### Preparation
- idea or model for 3D printing
- idea or find object for 3D scan

----

## Group Assignment
> characterize the design rules for your in-house PCB production process  
> extra credit: send a PCB out to a board house  

### Group assignment:

[Assessment](https://fabacademy.org/2022/nueval/electronics_production.html)

> Characterize the design rules for your in-house PCB production process:  
> document feeds, speeds, plunge rate, depth of cut (traces and outline) and tooling.

- Feed Rate
    - the distance which the cutting tool during one spindle revolution [ipm]or[mpm]
    - Ref. [Difference Between Feed Rate and Cutting Speed in CNC Machining](https://www.rapiddirect.com/blog/difference-between-feed-rate-and-cutting-speed/)  

!!! note
    In Mods' **path to G-code** module, **cut speed (mm/s)** is used to calculate **F**(Feed rate) in G-code.  

    Example:  
    Mods **path to G-code** module  
        - cut speed 1(mm/s)    
    G-code .nc  
        - F60.0000(mm/min)

![](./images/week04/mods_feed_rate.png)


- characterize the design rules
    - Material
        - [FR1](https://www.yodobashi.com/product/100000001004769460/)
            - Flame Retardant
            - [About FR1](https://detail-infomation.com/circuit-board-fr-grade/)
        - Size: 100 x150 x1.6mm
        - Cu layer: 35um = 0.035mm
    - [endmill](http://academy.cba.mit.edu/classes/inventory/ElectronicsProduction.html)
        - shank diameter
            - 1/8" = 3.17 mm
        - traces
            - 1/64" = 0.396748 mm
                - 2FL
            - V-bit 0.2mm 30deg (alternative)
        - outline
            - 1/32"  = 0.79375 mm
                - 2FL
            - 0.7 mm (alternative)

- CAM and Machine

CAM       |Gcode sender|Machine                    |PC
--        |---         |--                         |
Fabmodules|(included)  |Roland MODELA MDX-15       |Linux in lab
Mods      |(included)  |Roland MODELA MDX-15       |Linux in lab
Mods      |gSender     |Sainsmart Genmitsu PROVerXL|Your PC  

- http://fabmodules.org/ -> 404
- [Mods](https://mods.cba.mit.edu/)


### ToDo
- Set up milling environment
    - [Tips: Genmitsu PROVerXL 4030](./tips/genmitsu_prover_xl_setup.md)

- mill
    - trace width [traces](http://academy.cba.mit.edu/classes/electronics_production/linetest.png),  [interior](http://academy.cba.mit.edu/classes/electronics_production/linetest.interior.png)  

![](http://academy.cba.mit.edu/classes/electronics_production/0156.jpg){width=400}

## Individual Assignment

> make an in-circuit programmer that includes a microcontroller:  
>  extra credit: customize the design  
>  mill and stuff the PCB  
>  test it to verify that it works  
>  extra credit: try other PCB processes  

### MCU

Family|MCU              |Interface |in-circuit programmer</br>(Assignment)
--    |---              |--        |---
original AVR|ATtiny44</br>ATmega328P|ISP |Fab ISP  
AVR   |AVR-1</br>3216   |UPDI      |USB-Serial board & Serial-UPDI board
ARM   |SAMD11C          |JTAG/SWD  |FreeDAP board
Xtensa|ESP8266</br>ESP32|Serial    |USB-Serial board

!!! Attention
    FA2022 Trend  
    SAMD11C -> USB-Serial board  
    To Programm SAMD11C, need another DAP programmer board  
    (Not FTDI chip)  

#### AVR-1

in-circuit programmer|Adapter board|Target Board
:--:|:---:|:--:
![](./images/week04/USB-FT230XS-UPDI.png){width=400}</br>USB-FT230XS-UPDI|    |![](./images/week04/hello.t3216.echo.png){width=500}</br>hello.t3216
![](./images/week04/USB-FT230XS-serial.png){width=400}</br>USB-FT230XS-serial|![](./images/week04/hello.serial-UPDI.png){width=250}</br>serial-UPDI  |  
![](./images/week04/hello.D11C.serial.5V.1.1.png){width=500}</br>hello.D11C.serial.5V.1.1|![](./images/week04/hello.serial-UPDI.3.png){width=250}</br>serial-UPDI.3|

#### ARM

in-circuit programmer|Adapter board| Target Board
:--:|:---:|:--:
![](./images/week04/hello.CMSIS-DAP.10.D11C.png){width=300}</br>hello.CMSIS-DAP.10.D11C||
![](./images/week04/hello.CMSIS-DAP.4.D11C.png){width=300}</br>hello.CMSIS-DAP.4.D11C|![](./images/week04/hello.SWD.10-4.png){width=200}</br>hello.SWD.10-4</br>![](./images/week04/hello.SWD.10-4.1.png){width=200}</br>hello.SWD.10-4.1|![](./images/week04/hello.D11C.echo.1.png){width=300}</br>hello.D11C.echo.1

#### Xtensa

in-circuit programmer|Adapter board|Target Board
:--:|:---:|:--:
![](./images/week04/USB-FT230XS-serial.png){width=300}</br>USB-FT230XS-serial</br>![](./images/week04/hello.D11C.serial.5V.1.1.png){width=300}</br>hello.D11C.serial.5V.1.1|   |![](./images/week04/hello.ESP32-WROOM.png){width=500}</br>hello.ESP32-WROOM

### Commercial
#### DAP

ICE|DAP board|
:--:|:--:
![](./images/week04/atatmel-ice.jpg)</br>[Atmel-ICE](http://www.digikey.com/product-detail/en/ATATMEL-ICE-BASIC/ATATMEL-ICE-BASIC-ND)|![](./images/week04/maxdap_pico.png){width=200}</br>[MAX32625PICO](https://www.mouser.com/ProductDetail/Maxim-Integrated/MAX32625PICO?qs=BZBei1rCqCCjQLuDZBm8oA%3D%3D)

#### Raspberry Pi & Seeeduino Xiao
Ref. [FA2022 Embedded Programming Environment](http://academany.fabcloud.io/fabacademy/2021/labs/kannai/site/instruction/tips/fa2022_embed_env/)

- [FA2022 USB-D11C-serial (Pi3 + OpenOCD)](http://academany.fabcloud.io/fabacademy/2021/labs/kannai/site/instruction/tips/fa2022_usbserial_pi3_openocd/)

- [FA2022 USB-D11C-serial (Pi4 + Ubuntu + edbg + Xiao)](http://academany.fabcloud.io/fabacademy/2021/labs/kannai/site/instruction/tips/FA2022%20usbserial_Pi4_edbg/)

- [FA2022 USB-D11C-serial (Ubuntu_Live_USB + edbg + Xiao)](http://academany.fabcloud.io/fabacademy/2021/labs/kannai/site/instruction/tips/FA2022_usbserial_Ubuntu_live_USB/)


Raspberry Pi4|Seeduino Xiao|
:--:|:--:
[![](./images/week04/pi4.png){width=300}](https://www.raspberrypi.com/products/raspberry-pi-4-model-b/)|[![](./images/week04/xiao.png){width=200}](https://wiki.seeedstudio.com/Seeeduino-XIAO/)



#### USB-Serial

Digikey|SwitchScience|Akizuki|
:--:|:--:|:--:
![](./images/week04/ftdi_cable.png){width=300}</br>[TTL-232R-5V](https://www.digikey.jp/product-detail/en/ftdi-future-technology-devices-international-ltd/TTL-232R-5V/768-1028-ND) | ![](./images/week04/ftdi_board.jpg){width=300}</br>[FTDI USE serial Rev.2](https://www.switch-science.com/catalog/2782/)|![](./images/week04/FT234X.jpg){width=300}</br>[FT234X module](https://akizukidenshi.com/catalog/g/gM-08461/){:target="_blank"}


!!! note
    Mkdocs tips  

    Open Link target in new page  
    ``[text](path/to/link){:target="_blank"}``

    Image Size (width)    
    `![](path/to/image.jpg){width=300}`

    Click image to other link    
    ``[![](path/to/image.jpg)](path/to/link)``

### Todo
- Mill **in-circuit programmer** and **Adapter board** for AVR-1

in-circuit programmer</br>(This week)|Adapter board</br>(This week)|Target Board</br> (week06/Pre-session)
:--:|:---:|:--:
![](./images/week04/hello.D11C.serial.5V.1.1.png){width=500}</br>hello.D11C.serial.5V.1.1|![](./images/week04/hello.serial-UPDI.3.png){width=250}</br>serial-UPDI.3|![](./images/week04/hello.t3216.echo.png){width=500}</br>hello.t3216

- Solder components

- Set up programming environment
    - Raspberry Pi4
        - Install Ubuntu
          - Wifi Setting (lab's and your_house's)
          - SSH
              - no displey
              - no keyboard and mouse
          - install edbg
    - Seeeduino Xiao
        - Arduino IDE
            - Board manager
            - DAPLink sketch
- Burn Bootloader
    - your PC ---(WiFi, SSH)---> Pi4---(USB)---> Xiao---(jumper wiers)---> hello.D11C.serial.5V.1.1_board

- Program 3216 board
    - your PC ---(USB)---> D11C.serial--->UPDI_Adapter--->3216_board
    - Arduino IDE
        - Board manager
        - Example Sketch (Blink)