Week7 : Electronics Design

Group

Group assignmet is here Our lab has Tester, Stabilized power supply, Oscilloscope.

Individual

Redraw echo hello-world board - rough flow

I used Eagle to draw circuit board.The following is a rough flow.
  • Step4: Make brdfile. brdfile is a file that places parts and connects circuits.
    brdfile that I made is here
  • Step5: Export png image of circuit.
    png data is here
  • Step6: Export png image of interior.
    png data is here

Needed parts

  1. ATTiny 44 microcontroller (1 piece)
  2. Capacitor 1uF (1 piece)
  3. Resistor 10K ohm (2 piece)
  4. Resistor 1K ohm (1 piece)
  5. 6 pin header (1 piece)
  6. 6 pin header for FTDI (1 piece)
  7. Resonator 20MHZ(1 piece)
  8. LED (1 piece)
  9. Button swith (1 piece)

Points of Process

Step2: Library

  • Download fab.lbr
  • Make Library Directory
  • Move fab.lbr to the directory that made above
  • [Options]->[Directories]

  • [Libraries]->[Browse] select directory that made above

  • |
    V

  • fab.lbr will be shown.

  • I put HelloKamakura.lbr to the same directory

Step3: Sch file

  • How to make sch file
  • [file]->[project]->name new project(I named FabAcademy2018Week07).

    right click project that was made->[new]->[Schematic]. New schfile will be made.

  • add
  • If we input "add" command to the command box, we can select part form library.


  • put the parts to the shematec file
  • If we click somewhere, the part will be put.(If we want to rotate parts, rightclick.)

  • name
  • Next, It is better to name the parts.Input "name" command to the command box.

  • net, name label
  • "net" command -> "name" commnad -> "label" command are used when parts connect.


  • circuit
  • By using commands above, we can make circuit diagram !The part surrounded by the red frame is the LED and button added to echo hello-world board.

  • ERC
  • "erc" command is Electrical Rule Check
    There weren't no Errors. (Warnings are not error, you can approve it.)

Step4: brd file

  • How to make brd file
  • Click this icon. That's all !

  • put the parts
  • Put the parts to the brd file.
  • ratsnest
  • After placeing the parts, "ratsnest" command makes connection simply.
  • connect
  • Connectig each parts manualy by using "route" command.
  • DRC(Design Rule)
  • "drc" command is Design Rule Check. Clearance should be set 0.4mm.

  • interior(another layer)
  • After DRC, draw the interior by using "polygon" command on the 48(Document) layer.

Step5,6: Exprot to png format

  • [File]->[Export]->[Image]

  • Monochrome & Resolution
  • Check the Monochrome and Resolution is 1600. I will describe it more detail in Problem-Section.

Step7: Check

First, I connected the echo hello-world board to hello ISP.

Program file was downloaded from here
And execute following command.
$ make -f hello.ftdi.44.echo.c.make

$ sudo make -f hello.ftdi.44.echo.c.make program-usbtiny-fuses

$ sudo make -f hello.ftdi.44.echo.c.make program-usbtiny

If we use Mac, python has already be installed. But, serial port library is needed. Python serial port library is pyserial, it can be installed with following command. If you have not install pip, install pip first.
$ pip install pyserial
Get serial port information with following command
$ ls /dev | grep usb

or

$ ls /dev/tty.*

Using first command, and get following serial port information.
cu.usbserial-AI02RJUC

tty.usbserial-AI02RJUC
If you use second command, you will get following information.
/dev/tty.usbserial-AI02RJUC
After getting serial port information, run the term.py as following. The part of "/dev/tty.usbserial-AI02RJUC" depends of your enviroment(serial port information).
$ python term.py /dev/tty.usbserial-AI02RJUC 115200
Several problems occurred, but eventually check program(term.py) worked well. Problems and how to fix it will be described Problem part.

Problem

Problem & How to fix

  • Step5,6 Resolution
  • 【Problem of export resolution and size】
    I saved png file in 800dpi resolution with Eagle at first. But mods recongnize this file as twice as large as the actual size.

    I tried to save png file in 1600dpi. Then mods recongnized png file as actural size.

  • Step7 Python version
  • My python is version 3.6.1. But term.py is for Python2. So, when I executed, the following error occurred.
    widget_text.insert(INSERT,'\n')

    TabError: inconsistent use of tabs and spaces in indentation
    The above error often occurs when the code written in Python 2 executed in Python 3.
    File "term.py", line 19, in <module>

    from Tkinter import *

    ModuleNotFoundError: No module named 'Tkinter'
    In Python3, "Tkinter" is written as "tkinter".

    To deal with the above error, I changed term.py without understanding well, but because it did not go well. Then I built an environment that can switch between Python 2 and Python 3 with anaconda.
    $ pyenv versions

    system

    2.7.14

    * 3.6.1 (set by /Users/DaisukeDoyo/.pyenv/version)
    * is the current Python version. * was marked at Python3, so I have to change to Python2 as following command.
    $ pyenv global 2.7.14
    Then it works well.

Files (all file-->zip)

All files can be downloaded form here