Task 7

Electronics design

In this week, I was given a task to have a group assignment and an individual assignment. The group assignment was to use the test equipment in your lab to observe the operation of a microcontroller circuit board, and the individual assignment was to redraw the echo hello-world board), add (at least) a button and LED (with current-limiting resistor), check the design rules, make it, and test it

Individual Task : Redraw the echo hello-world board

For this week, I was required to redraw the echo hello-world board and add atleast a button and an LED. I decided to utilize Antti Mäntyniemi Schematic design for this purpose. I decided to use Eagle from Autodesk.

Getting Started with Eagle

At first, I download the Eagle Software from the Autodest Website. I downloaded the fbr.lbr file which was the required FAB LAB library for Eagle Software. To Add the Library, Paste the fbr.lbr in Eg: (c:\\My Documents\EAGLE\libraries). The fbr.lbr will appear in the Libraries in Eagle. Go to Options-->Directories-->Add the Library path for Libraries and Projects.

Fig.1 - Adding Directory Path for Libraries and Projects
Fig.2 - Setting the Library to Use

Schematic Design

Fig.3 - Making a new Schematic.
Fig.4 - Schematic Window

    I collected all components to get from the Library, The necessary components are:
  • 1x ATTiny44-ssu (fab> ATTINY44)
  • 1x Resonator (fab)
  • 1x AVRISP SMD (fab>AVRISP)
  • 1x FTDI SMD Header (fab)
  • 1x 10 nF CAP-US1206FAB (fab--CAP_US)
  • 1x 1 uF CAP-US1206FAB (fab--CAP_US)
  • 1x Omron switch B3SN-3112P (fab)
  • 1x LED FAB1206 (fab)
  • 1x 499 ohm RES-US1206FAB (fab-->RES_US)
  • 2x 49.9k ohm RES-US1206FAB (fab-->RES_US)
  • 1x 10k ohm RES-US1206FAB (fab-->RES_US)

I selected the components one by one and placed it in the Schematic Window roughly. Then I used the route tool to connect all the components in place.

Fig.5 - To add components/ parts
Fig.6 - Select the parts to be added in schematic from Library
Fig.7 - Parts placed but unconnected.
Fig.8 - Route, Move, Rotate and Mirror parts
Fig.9 - Schematic after routing added VCC and GND
Fig.10 - Schematic after giving the values to the resitors and the capacitors
Our Instructer, Antti suggested to simplify the Schematic diagram by using VCC and GND Symbols, instead of using long traces which makes the schematic more confusing. Thereby I updated the schematic diagramm, The updated diagram is shown below:
Fig.11 - Final (Updated) Schematic after giving the values to the resitors and the capacitors

Layout Design

After completing the Schematic, we will move from Schematic to Layout using the SCH-->BRD Button.

Fig.12 - From Schematic to Layout Transition Button
Fig.13 - Layout Representation of Components

Below DRC Settings need to be ensured depending on the Mil Bit we are using for milling the PCB Layout.

Fig.14 - DRC Settigs :: Clearance
Fig.15 - DRC Settigs :: Sizes
Fig.16 - DRC Settigs :: Supply

Utilize the Mirror, Move, Rotate and Traces tool to make connections in the Layout.

Fig.17 - Components connected in Layout using Traces
    After Connecting the components, the next idea to make the ground plane which shall be a copper plane surrounding the below components and the traces. To make the Ground Plane follow these steps:
  • Draw a polygon around your board (Using Draw-->Polygon) with the name GND
  • Utilize (Tool--> ratsnest) to make a uniform plane around it which will connect all the GND with that plane

Fig.18 - Final Layout with the GND PLane

Our Layout design is ready, we need to check for ERC and DRC Errors

Fig.19 - ERC Error Check
Fig.20 - DRC Error Check

Layout Design Export

The next step is to export the layers in the png format

    For Traces:
  • Select on the Top Layer
  • Export Image with High Quality [Select : Monochorome, Resolution : 2400 dpi]
    For Outline:
  • Make a Milling layer outide the board
  • Uncheck all the layes and select the Milling layer
  • Export Image with High Quality [Select : Monochorome, Resolution : 2400 dpi]

Fig.21 - Traces : Layer Selection
Fig.22 - Traces : Export
Fig.23 - Outline : Layer Selection
Fig.24 - Outline : Export

PCB Mill and Solder

Next I Proceeded as in Task 05. I went to fabModules website to work on the traces and outline .png files, to include the milling machine specifications so that the board comes out right.

Fig.25 - Mods : Traces
Fig.26 - Mods : Outline
Fig.27 - PCB Milling
Fig.28 - Milling Done : Export

    The required components as used in the schematic as well are:
  • 1x ATTiny44
  • 1x Resonator (20 Mhz)
  • 1x AVRISP SMD (2x3 pin header)
  • 1x FTDI SMD Header (1x6 pin header)
  • 1x 10 nF
  • 1x 1 uF
  • 1x Omron switch B3SN-3112P (6mm)
  • 1x LED (RED)
  • 1x 499 ohm
  • 2x 49.9k ohm
  • 1x 10k ohm

Fig.29 - Side 1 after components soldered on PCB
Fig.30 - Side 2 after components soldered on PCB

Programming : Group Assignment (Jobin's Board)

For programming, I utilized the ATTiny programmer that I made in Task 05. I went to fabModules. An ISP cable was connected to the programmer to the new board and ftdi cable (5V) to connect the new board to the computer. Below files are required to download:

  • c code
  • make file
  • Fig.31 - Connecting Board to Computer
    Fig.32 - Connecting Board to Computer

    I utilized GIT bash for the programming. I opened the the folder where I had stored my code and makefiles. As a Group Project we used the Jobin. While connecting the new board with an ISP cable make sure that the ground pins are matched. Then connect the new board to the computer with the FTDI cable and the red light will be turned on in the programmer

    1. Command to make a .hex file for flashing in git bash.

    make -f hello.ftdi.44.echo.c.make
    Fig.33 - Programming using Gitbash
    2. Then run the make fuses command
    make -f hello.ftdi.44.echo.c.make program-usbtiny-fuses
    Fig.34 - make fuses
    3. Finally we did the flashing of the developed microcontroller with the command:
    make -f hello.ftdi.44.echo.c.make program-usbtiny
    Fig.35 - flashing

    The group work for this week was to observe the operation of a microcontroller circuit board using an oscilloscope. For this case, First We connected the ground plate of the board to the oscilloscope with black wire and the signal probe to serial input (4th in this case) pin. We used putty software to transmit data. To do that we need to check which COMport is connected to the programmer by going to control panel>Device manager. After checking the COMport we open the putty and go to the serial menu. Then changed the COMport accordingly and put the baud rate as 115200 and pressed Ok.

    Fig.36 - Connecting to Oscilloscope
    Fig.37 - Checking COM port
    Fig.38 - Putty Configuritation

    After giving some input on the terminal, unfortunately, putty window hanged and was slow displaying the signal. Our local instructor Antti helped to rectify the problem by finding that the IC ground was not connected properly. After soldering it to the nearest ground it started to work fine.

    Fig.39 - Show Display
    Fig.40 - After Connecting to Ground

    After pressing a command eg. 'U' in the terminal on the oscilloscope view, we could see that pulse width was approximately 8,65us, which was close to the inversed baud rate of the terminal, 115200. Moreover, from the oscilloscope, we could count the bits

    Fig.41 - After connecting the ground
    Fig.42 - View from oscilloscope
    Fig.43 - Frequncy and pulse width

    Inorder to translate the bits seen in the oscoloscope to characters, The ASCII Table shall be utilized. As we can see in the below pictures as we press "U" the corresponding binary bits for U = 1010101. which can be seen below

    Fig.44 - ASCII Table
    Fig.45 - 101010 (Binary)- Corresponding Character "U"

    Programming : Individual Assignment (My Board)

    I was facing two problems, due to which I was not able to program my boards earlier. The two problems were:

  • Circuit Problem: As I was checking my board after soldering, there was short cicuit under the resonator which I came to know later during checking the vcc and grpund connections. I desoldered and resoldered the resonator.
  • Fig.46 - Circuit Problem Identification
  • Programming Issues: When I cleared all the short circuit occurring in my board, I connect my board the usbtiny and powered it up. I opened GIT bash in the folder where hello.ftdi.44.echo.c and hello.ftdi.44.echo.c.make were located.
  • Fig.47 - Connecting Board and Programmer to the Computer
    Fig.48 - Openin GIT Bash in the directory
    When I used the command "make -f hello.ftdi.44.echo.c.make", I encountered the error below. I discussed it with Jobin and he helped me to figure out the problem. I found out that the problem was in the definition of the path destination in the Environmental variables (My Computer --> Control Panel) that we have to give the correct desination of the .exe files for avrdude and gnu make. I correct the destination.
    Fig.49 - Error occurred during command "make -f hello.ftdi.44.echo.c.make"
    The Bold & Underlined below is the Correction of Path Destination in the Environment variables:
  • Variable Name: Path
  • Variable Value: %USERPROFILE%\AppData\Local\Temp;C:\Program Files (x86)\PuTTY\;C:\Program Files\avr8-gnu-toolchain-win32_x86\bin;C:\Program Files (x86)\GnuWin32\bin\;C:\Program Files\avrdude;C:\Program Files\MATLAB\R2018b\runtime\win64;C:\Program Files\MATLAB\R2018b\bin;C:\Users\yshafiul18\AppData\Local\Programs\Python\Python37
  • Fig.50 - My Computer --> Control Panel --> Environmental Variable (Modification)
    After doing these corrections, when I used the command "make -f hello.ftdi.44.echo.c.make" , the .hex and .out file was created. After all it was a success. After this I made fuses and did the flashing.'
    Fig.51 - hello.ftdi.44.echo.c.hex and hello.ftdi.44.echo.out creation using command "make -f hello.ftdi.44.echo.c.make"
    Fig.52 - Making fuses
    Fig.53 - Flashing
    Next step is to test the Board. Remove my programmer and left the hello world board attached to USB port.Checking which COM port it was attached. It was a success, Putty working by type multiple letters “Y”,“A”,“S”,“I”,“R” in the keyboard which is shown in Putty.
    Fig.54 - Putty Configuritation
    Fig.55 - Putty Communication


    Resources Utilized

      I utilized these resources for this task:
    • Eagle
    • git, as version control tool
    • putty software

    Files