For my Fab Academy class I have to create a board with a microcontroller, a button and a LED. I will use Eagle to create it.
Step 1: ATtiny 1614
I will use the ATtiny 1614, so I will use the reference of the echo Hello Board ATtiny 1614 from Neil Gershenfeld. I will also design the board with a cool shape, I want to make a train machine. I’m looking for the pinning of ATtiny 1614 because I’m going to need it to know where the pins are.
Step 2: Eagle Schematic Design
I download the version of Eagle 9.5.2 and the libraries. I create a new project where I can have a schematic and a board. Looking at the library, I find that the ATtiny 412 and the ATtiny1614 are missing. ???? They are the same encapsulation as the ATtiny 44 and 45 that I make my own component. Through the ATtiny44 and the ATtiny1614 pinout I was creating my own component.
When I have all the components in place and with their corresponding values, I start using Labels. They are much easier to use than wires. Because in the end you have many wires and it is difficult to identify them and you are in danger of creating points of union. So once I have all the labels placed, this is the result of the circuit (I finally added two more LEDs to make the board more beautiful ????) on pins PB0 and PB1.
Step 3: Eagle Board Design
Once I have the scheme, I go on to create the PCB. To do this, click on the icon next to the printer called Board. Automatically all the components that I am going to use are loaded and small yellow lines that are the tracks of the tracks appear. Before starting to join components, I look at which layer I am, the TOP and red (if I made a through hole plate, I would have to place myself in the blue BOTTOM layer). Nuria told us that before starting to join the components we must also mark the design rules (DRC), that is, the values of the width of the track and the size of the mill. I put the following values at 16mil.
Once I have the design rules, I begin to orient the components, more or less as I wanted them in the drawing and to make the plate smaller. When placing the components I realize that the button will cost me to attach it to the corresponding pin. So I change it in the scheme, from pin PA3 to PA4.
Once I have all the components placed and the tracks together, I have to export the file in .PNG. But first we have to be alone with the tracks, so as I said before we are in the TOP layer, the red layer. Well, you have to turn off all the layers and just turn on the TOP layer. This is found in the Layer Settings option. Once we have only the layer of the tracks we go on to export the design. To do this, the following menu appears in the File -> Export -> Image menu. We have to put the file as Monochrome, 1000 DPI resolution and the area of the Window.
I realize that even from Eagle I can draw the contour to my liking. So I open Eagle again; with the line button, in a line width of 0.8mm (thickness of the mill for the outside) and on the TOP layer I draw the train machine.
Step 4: GIMP for the PNG Traces and Interior
I export the .PNG again with the interior tracks and the train outline. I open GIMP and start copying the image to work in different layers. One layer will be the inner traces with letters and my logo (white the tracks and the rest black), and another layer the outer edge (black the cut line and the rest white). With GIMP we can erase the Path that I don’t use for the UPDI connector.
Well I already have the two .PNG the traces and the outside line. I think that I have not correctly verified the position of the UPDI connector and the GND. So the next morning, before going to work I open Eagle, and I realize that it was wrong, I have to reverse the position of the connector.
Once the UPDI connector problem is solved, I export the .PNG again and edit it with GIMP to get the trace and interior file. Here are the links of the .PNG and the Eagle files.
Step 5: MODS.
To start using Mods, I use the following tutorials:
From terminal I open Mods, I connect the Modela to the computer using the original black DB25 cable. In Mods I open the Roland MDX-20 PCB program.
Step 6: Roland Modela MDX-20
I use the Roland Model MDX-20A and Fran’s Mods CE again. I import the .PNG of the traces and use the mill 1/64 at a speed of 1 mm / s. The X = 25 and Y = 1.
To cut the board, change to mill 1/32, at a speed of 1 mm / s.
Step 7: Components and Tin Soldering
Once I have the board milled, I pick up the components of the Fab Lab León inventory. And with patience, good light and the computer to follow the scheme and the position of the components start soldering.
1- ATtiny 1416
1- Capacitor 1uF
5- Resistor 1k
1- Resistor 470 Ohmios.
8- Connector Pin
3- Yellow LED´s
2- Red LED´s.
All in SMD 1206.
Step 8: Programming With Arduino.
To program the board I need to create a program in Arduino, that when I press the button I create a sequence of lights. The first thing I have to do is configure the pins of the inputs and outputs. I want the sequence of lights to be pressed when the button is pressed, the state of that button is 0. Using an If / else conditional I do the sequence.
1. I open the Hello_train_button_led program in Arduino. I select the ATtiny 1614 and 20Mhz internal Crystal plate. I check it, compile it and save it (save it in .hex and .ino).
2. I copy the Hello_train_button_led.ino.hex file into the pyupdi folder.
3. I run dmesg -w
4. I use the USB-FT230XS-FTD. Connect and disconet the ftdi cable and take note of the “port name” ttyUSB0
5. I connect the boards as follows.USB-Serial-FT230X + Serial-UPDI.FT230X + hello_train + USB-FTDI (this just for power and ground).
6. Go into the “pyupdi” folder.
7. Program the board using python -> run sudo python3 pyupdi.py -d tiny1614 -c /dev/ttyUSB0 -b 19200 -f Hello_train_button_led.ino.hex -v
Now it works, here is a small video of the loading process and the operation when I press the button on the board. ???? ???? ???? ????
Source: Hello Train! ATtiny 1614