Skip to content

6. Electronics design

Weekly Summary

  • Using KiCad
  • Design my own board of ATtiny1614
  • Try echo programming on your board

Assignments

  • group assignment
  • use the test equipment in your lab to observe the operation of a microcontroller circuit board
  • individual assignment
  • redraw an echo hello-world board,
  • add (at least) a button and LED (with current-limiting resistor)
  • check the design rules, make it, and test that it can communicate

Kamakura Group Assignment Week06

Individual Assignment

KiCad

Save the 1614 board image from here

Go to KiCad website.

Download it for Windows PC from OSDN.

Open it and install

Get the Fab Library from here

Moved to file in Documents > KiCad > 6.0 > Libraries (I created this folder) > Fab (I renamed)

Open KiCad and Preferences > Manage Symbol Libraries.

“Add empty row to table” in Global libraries.

Press Folder icon in Library Path and select “fab.kicad_sym” file > Press OK

Preferences > Manage Footprint Libraries.

Press folder icon in “Project Specific Libraries”.

I added in Global Libraries first and showed up warring of “cannnot find the footprint” .

Make sure to add the folder in “Project Specific Libraries”.

Select “fab.pretty” folder > Press OK

Press “Create new blank project”

Open Schematic file

“Add a symbol” (A)

Select the parts > Press OK

You can connect the parts with Green Pluss icon as photo;

Click both circles to connect.

“Add a net label” (L)

Add a Label > Press OK

Select the square

The Label can connect with same label without green line.

Press Shot cut key (V)

Edit Value.

You can see the different Value.

“Add a no-connection flag” (Q)

Select the circles that you don’t use.

Press this icon to address all parts that has question mark.

Connected all parts.

Press “Perform electrical roles check”

Press “Run ERC”

You can see 0 Errors and Warnings if it’s correct.

Press “Run footprint assignment tool”

You can check your footprint > Press OK

Press “Open PCB in board editor”

Press “Update PCB with changes made to schematic”.

Press “Edit board setup including layers, design rules and various default”

Select “Net Classes”

Add thickness line (0.50mm on Track Width) as Vcc and GND.

Change the “Net Class” from Default to “Vcc/ GND” on VCC and GND > Press OK

Select “Route tracks” (X)

I wasn’t able to connect all. So my instructor suggested me to use 0 Ohm.

Back to schematic and add 0 Ohm

And reconnect on PCB in board editor.

Change the layer to “User.1” and select “Draw a graphic polygon” (ctrl + shift + P)

Draw outline as interior.

File > Export > SVG…

Move to Illustrator

Move to Illustrator

Open svg file on illustrator. It has some vector issue. (You can see all black)

Right click > “Ungroup” (command + shift + G)

You can see the lines!!

Trim nicely and add some designs.

Save as PNG as traces and interior. (800dpi)

Go to mods and get the rml files.

Shaving the board on RMS-20.

But it got stuck in a few part…

Back to Illustrator and add another 0 Ohm.

Also change the line wideness to Thick line : 0.4mm, Thin line : 0.25

It saved nicely

Pick up parts and stuffing

Soldering as board design

Also I needed the hello.serial-UPDI.3 board.

I got the ping files from here

Just hello.serial-UPDI board is also okay.

Try to program.

Connecting USB on PC > Breakout Board > hello.serial-UPDI.3 board > >UPDI on ATtiney1614 >FTDI on ATtiney1614 > USB-D11C-serial (from week4) > USB on PC

Program from here

Right on

//Fab Academy 2020 - Fab Lab León
//RGB LED
//Adrianino
//ATtiny1614 - ATtiny1624

  const byte COLOR_BLACK = 0b000;
  const byte COLOR_BLUE = 0b100;
  const byte COLOR_RED = 0b010;
  const byte COLOR_GREEN = 0b001;
  const byte COLOR_MAGENTA = 0b101;
  const byte COLOR_CYAN = 0b011;
  const byte COLOR_YELLOW = 0b110;
  const byte COLOR_WHITE = 0b111;

  const byte PIN_LED_R = 0;
  const byte PIN_LED_G = 2;
  const byte PIN_LED_B = 1;

  void setup() {

    pinMode(PIN_LED_R, OUTPUT);
    pinMode(PIN_LED_G, OUTPUT);
    pinMode(PIN_LED_B, OUTPUT);
    displayColor(COLOR_BLACK);
  }

  void loop() {

    displayColor(COLOR_RED);
    delay(1000);

    displayColor(COLOR_GREEN);
    delay(1000);

    displayColor(COLOR_BLUE);
    delay(1000);

    displayColor(COLOR_MAGENTA);
    delay(1000);

    displayColor(COLOR_CYAN);
    delay(1000);

    displayColor(COLOR_YELLOW);
    delay(1000);

    displayColor(COLOR_WHITE);
    delay(1000);

    displayColor(COLOR_BLACK);
    delay(1000);

  }

  void displayColor(byte color) {

    digitalWrite(PIN_LED_R, !bitRead(color, 0));
    digitalWrite(PIN_LED_G, !bitRead(color, 2));
    digitalWrite(PIN_LED_B, !bitRead(color, 1));
  }

Hello echo

//
// hello.t1614.echo.ino
//
// tiny1614 echo hello-world
//    115200 baud
//
// Neil Gershenfeld 12/22/19
//
// This work may be reproduced, modified, distributed,
// performed, and displayed for any purpose, but must
// acknowledge this project. Copyright is retained and
// must be preserved. The work is provided as is; no
// warranty is provided, and users accept all liability.
//

#define max_buffer 25

static int index = 0;
static char chr;
static char buffer[max_buffer] = {0};

void setup() {
   Serial.begin(115200);
   }

void loop() {
   if (Serial.available() > 0) {
      chr = Serial.read();
      Serial.print("hello.t1614.echo: you typed \"");
      buffer[index++] = chr;
      if (index == (max_buffer-1))
         index = 0;
      Serial.print(buffer);
      Serial.println("\"");
      }
}

After Upload, just leave Bread board in FTDI

Open serial board and change to “No line ending” and “115200 baud”

Type “Hello” and “Send”

It answered!!!!!


What I learned

When you design your own board, you can understand what is where clearly.

Also you can design the board on illustrator to make looking nice!!


Appendix


Last update: May 1, 2022