Skip to content
Snippets Groups Projects
Commit 3afde471 authored by Adrián Torres's avatar Adrián Torres
Browse files

programming_adrianino

parent 0d0a08bf
Branches
No related tags found
No related merge requests found
Pipeline #184629 passed
......@@ -49,33 +49,79 @@
<!-- Main -->
<div id="main">
<div class="inner">
<h1>Adrianino</h1>
<h2>08/09/2020</h2>
<div class="inner">
<span class="image main"><img src="images/adrianino/a_01.jpg" alt="" /></span>
<h2>Index</h2>
<ul><li><a href="#introduction"><b>Introduction.</b></a></li>
<li><a href="#features"><b>Features.</b></a></li>
<li><a href="#datasheet"><b>Datasheet.</b></a></li>
<li><a href="#bom"><b>BOM and Schematic.</b></a></li>
<li><a href="#board"><b>Board design.</b></a></li>
<li><a href="#updi"><b>UPDI + VCC module.</b></a></li>
<li><a href="#programming"><b>Programming.</b></a></li>
<li><a href="#files"><b>Files.</b></a></li>
</ul>
<h1><a id="introduction"></a>Introduction</h1>
<p>Although I have already finished my Fab Academy, I am still researching. Speaking with my instructors Nuria and Pablo, I told them that I wanted to continue working on the <a href="https://gitlab.fabcloud.org/pub/helloworld/index"><b>Hello World project,</b></a> but I was not satisfied with making a board for each sensor or actuator.</p>
<p>The following project was born with the idea that electronics is very easy to learn and modular at the same time. Although I have already finished my Fab Academy, I am still researching. Speaking with my instructors Nuria and Pablo, I told them that I wanted to continue working on the <a href="https://gitlab.fabcloud.org/pub/helloworld/index"><b>Hello World project,</b></a> but I was not satisfied with making a board for each sensor or actuator.</p>
<p>So I decided to make a board with the ATtiny1614, where I could use the maximum pins for the inputs or outputs; that had external power; I2C connection. The idea is that a student can test as many sensors as possible, become familiar with electronics and programming little by little. And the <b>Adrianino</b> was born.</p>
<p>So I decided to make a board with the ATtiny1614, where I could use the maximum pins for the inputs or outputs; that had external power; I2C connection. The idea is that a student can test as many sensors as possible, become familiar with electronics and programming little by little. And the <b>Adrianino</b> was born.</p>
<p>Furthermore, I wanted to go one step further and place a VCC pin next to the UPDI programming pins, which I will explain later on how it works.</p>
<p><img src="images/week06/week06.37.jpg" width="80%"; max-width="700" /></p>
<h1><a id="features"></a>Features</h1>
<ul><li> This board has FTDI and <b>UPDI + VCC</b> connection to program it without the need for external power (or the FTDI).
<li> It contains a voltage regulator to power the board with a <b>power supply</b> (9V battery).
<li> It has another 9V power connection to for example power a DC motor driver.
<li> Then there are 4 outputs or inputs with VCC and GND on each side to be able to connect different inputs or outputs.
<li> On the left there is an <b>I2C</b> connection to connect an LCD, OLED or a sensor that uses this communication.
<li> There are 3 outputs or inputs at the bottom and with a GND pinout.
<li> There is an LED and an integrated button, which will help us to test that the microcontroller works with a simple program.
<li> Through the FTDI connection we can read the data from the different sensors through the Serial.
</ul>
<h1><a id="datasheet"></a>Datasheet</h1>
<h2>ATtiny1614</h2>
<p>As we have looked at the graph, there are more microcontrollers within the tinyAVR-1series family. Another ATtiny I use is the 1614. I combine the Datasheet image with the one from the <a href="https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/ATtiny_x14.md"><b>SpenceKonde website</b></a> on the ATtiny1614.</p>
<ul><li><b>14 pin</b> package.
<li>Two internal clocks 16 and <b>20 MHz.</b>
<li>16 KB Flash Memory.
<li>256 B EEPROM.
<li>2 KB SRAM.
<li>Maximum voltage: 6V; minimum voltage -0.5 V. </ul>
<p>Furthermore, I wanted to go one step further and place a VCC pin next to the UPDI programming pins, which I will explain later on how it works.</p>
<p>After looking at the basic features, you will find the pinning of the microcontroller.</p>
<p><img src="images/week06/week06.37.jpg" width="80%"; max-width="700" /></p>
<span class="image main"><img src="images/week08/week08.04.jpg" alt="" /></span>
<h2>Features</h2>
<ul><li> This board has FTDI and <b>UPDI + VCC</b> connection to program it without the need for external power (or the FTDI).
<li> It contains a voltage regulator to power the board with a <b>power supply</b> (9V battery).
<li> It has another 9V power connection to for example power a DC motor driver.
<li> Then there are 4 outputs or inputs with VCC and GND on each side to be able to connect different inputs or outputs.
<li> On the left there is an <b>I2C</b> connection to connect an LCD, OLED or a sensor that uses this communication.
<li> There are 3 outputs or inputs at the bottom and with a GND pinout.
<li> There is an LED and an integrated button, which will help us to test that the microcontroller works with a simple program.
<li> Through the FTDI connection we can read the data from the different sensors through the Serial.
<ul><li><b>VDD:</b> Supply voltage.
<li><b>GND:</b> Ground.
<li><b>Digital pins:</b> Port A: PA0, PA1, PA2, PA3, PA4, PA5, PA6, PA7. Port B: PB0, PB1, PB2, PB3.
<li><b>Analog pins:</b> PA1, PA2, PA3, PA4, PA5, PA6, PA7. Port B: PB0, PB1.
<li><b>UPDI Programming pin:</b> PA0 (physical pin number 10).
<li><b>External Clock Pin:</b> PA3. </ul>
<p>All I/O pins can be configured with <b>internal pullup resistance.</b></p>
<p>Within the communications section there are different types and their pins are different. It is clear that the different communication protocols cannot all be used at the same time, because they have pins in common.</p>
<ul><li><b>USART - Universal Synchronous and Asynchronous Receiver and
Transmitter: </b> It has the <b>RX</b> (PB2 or PA2) and the <b>TX</b> (PB3 or PA1).
<li><b>SPI - Serial Peripheral Interface:</b> It has only <b>MOSI</b> (PA1), <b>MISO</b> (PA2), <b>SCK</b> (PA3), <b>SS</b> (PA4) .
<li><b>TWI - Two Wire Interface (I2C):</b> It has <b>SDA</b> (PB1 or PA1) and <b>SCL</b> (PB0 or PA2).
</ul>
<p>Another important thing that the datasheet is telling us is that you have to keep in mind which kind of input component you are using, digital or analog: for instance, if you are using a temperature sensor (analog component) you have to connect it to an ACD (analog to digital converter) port otherwise the microcontroller isn't able to transform the information that is receiving from the sensor to a digital data.</p>
<h2>BOM and Schematic</h2>
<h1><a id="bom"></a>BOM and Schematic</h1>
<p>This is the schematic where you can see all the components.</p>
<p>This is the schematic where you can see all the components.</p>
<p><img src="images/week06/week06.38.jpg" width="80%"; max-width="700" /></p>
......@@ -200,15 +246,15 @@
</tr>
</table>
<h2>Board design</h2>
<p>In the files section you can download the Eagle files and the PNG's. Here is a sample of the PNG's, traces and cutting lines.</p>
<h1><a id="board"></a>Board design</h1>
<p>Here you can download the Eagle files and the PNG's. Here is a sample of the PNG's, traces and cutting lines.</p>
<ul><li><a href="assignments/week06/Adrianino_Hello_1614.zip"><b>Adrianino Schematic + Board</b></a>
<li><a href="assignments/week06/Adrianino_v2_traces.png"><b>Adrianino Traces</b></a>
<li><a href="assignments/week06/Adrianino_v2_interior.png"><b>Adrianino Interior</b></a></ul>
<span class="image main"><img src="images/week06/week06.39.jpg" alt="" /></span>
<h2>Programming</h2>
<p>The new generation of ATtiny's are programmed through <b>UPDI</b>, for more information on the process you can follow my documentation of the week <a href="week08.html"><b>Embedded Programming.</b></a></p>
<h1>UPDI + VCC module</h1>
<h1><a id="updi"></a>UPDI + VCC module</h1>
<p>At the time of programming, until now I used the Hello USB-serial.FT230X + Hello serial-UPDI.FT230X and also the power supply of the board with an FTDI (which later helps us to read through the Serial).</p>
<p>With this adapter we have the Serial + UPDI + VCC adding a higher pin, without the need to use another FTDI to power the board.</p>
......@@ -219,7 +265,10 @@
<p><img src="images/week06/week06.41.jpg" width="30%"; max-width="700" /></p>
<p>In the Files section you will find the PNG's and the Eagle file to download them.</p>
<p>Here you will find the PNG's and the Eagle file to download them.</p>
<ul><li><a href="assignments/week06/New_UPDI.zip"><b>UPDI + Vcc Schematic + Board</b></a>
<li><a href="assignments/week06/New_UPDI_traces.png"><b>UPDI + Vcc traces</b></a>
<li><a href="assignments/week06/New_UPDI_interior.png"><b>UPDI + Vcc Interior</b></a></ul>
<p><img src="images/week06/week06.42.jpg" width="70%"; max-width="700" /></p>
......@@ -228,14 +277,43 @@
<p><img src="images/week06/week06.43.jpg" width="70%"; max-width="700" /></p>
<p>In the following video you can see the programming process of the Adrianino and an LCD.</p>
<p><iframe src="https://player.vimeo.com/video/457496735" width="100%" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe></p>
<h1><a id="programming"></a>Programming</h1>
<h2>Linux + Arduino + PyUPDI</h2>
<p>I follow the <a href="https://gitlab.fabcloud.org/academany/fabacademy/2020/bootcamp/spicy/blob/master/Program1614.md"><b>tutorial</b></a> that Pablo taught me that they used in the <b>Bootcamp in India</b> that <b>Santi</b> from <b>Fab Lab BCN</b> created.</p>
<ul><li>1. For this I install Arduino. Within Arduino, in the preferences tab we will add the URL to load the Arduino IDE with other cards or microcontrollers. <a href="https://github.com/SpenceKonde/megaTinyCore"><b> Spence Konde tutorial</b></a></li></ul>
<p><img src="images/week08/week08.06.jpg" width="80%"; max-width="700" /></p>
<ul><li>2. I download <a href="https://github.com/mraardvark/pyupdi"><b>"pyupdi".</b></a>
<li>3. Open terminal. Install dependeces: <b><i>pip3 install intelhex pylint pyserial</i></b> </ul>
<p><img src="images/week08/week08.14.jpg" width="80%"; max-width="700" /></p>
<ul><li>4. I connect the USB-FTDI.
<li>5. I run <b><i>dmesg -w</i></b>
<li>6. Connect and disconet the ftdi cable and take note of the "port name" where:</ul>
<p><img src="images/week04/week04.40.jpg" width="80%"; max-width="700" /></p>
<ul><li>7. I configure the Arduino IDE for the ATtiny 1614; I configure the clock to 20MHz, the TX and RX ports and in my case the communication port with the <b>/dev/ttyUSB0</b> microcontroller.</ul>
<p><img src="images/adrianino/a_02.jpg" width="80%"; max-width="700" /></p>
<ul><li>8. Only the code is <b>compiled.</b> In the Arduino IDE dialog box, we will see where the temporary files are located.</ul>
<p><img src="images/adrianino/a_03.jpg" width="80%"; max-width="700" /></p>
<ul><li>9. We look for the <b>.hex file</b> which is the one we need, it is in a temporary folder. Once located, we copy it and paste it in the <b>pyupdi folder.</b> </ul>
<p><img src="images/adrianino/a_04.jpg" width="80%"; max-width="700" /></p>
<ul><li>10. I connect it as follows.<b> USB-Serial-FT230X + UPDI-VCC.</b></ul>
<p><img src="images/adrianino/a_05.jpg" width="60%"; max-width="700" /></p>
<ul><li>11. Go into the "pyupdi" folder.
<li>12. Program the board using python -> run <b><i>sudo python3 pyupdi.py -d tiny1614 -c /dev/ttyUSB0 -b 115200 -f Blink.ino.hex -v</i></b></ul>
<p>In this short video you can see the process of loading the programming and the operation of a Blink on pin 8 where the LED is integrated. 😍 </p>
<iframe src="https://player.vimeo.com/video/458308005" width="100%" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>
<h2>Conclusions</h2>
<h1>Conclusions</h1>
<p>With this evolution, we managed to program through UPDI without the need for external power from another FTDI.</p>
<h1>Files</h1>
<h1><a id="files"></a>Files</h1>
<p>Find below the files that I made for this project.</p>
<ul><li><a href="assignments/week06/Adrianino_Hello_1614.zip"><b>Adrianino Schematic + Board</b></a>
......
docs/images/adrianino/a_01.jpg

24.7 KiB

docs/images/adrianino/a_02.jpg

165 KiB

docs/images/adrianino/a_03.jpg

159 KiB

docs/images/adrianino/a_04.jpg

184 KiB

docs/images/adrianino/a_05.jpg

286 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment