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

samdino_programming

parent 841fa44f
No related branches found
No related tags found
No related merge requests found
Pipeline #201464 passed
Showing with 61 additions and 47 deletions
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<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> <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>
<h1><a id="bom"></a>BOM and Schematic</h1> <h1><a id="bom"></a>BOM and Schematic for Adrianino</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>
...@@ -313,25 +313,25 @@ ...@@ -313,25 +313,25 @@
<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> <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> <ul><li><b>1.</b> 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> <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> <ul><li><b>2.</b> 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> <li><b>3. Open terminal.</b> 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> <p><img src="images/week08/week08.14.jpg" width="80%"; max-width="700" /></p>
<ul><li>4. I connect the USB-FTDI. <ul><li><b>4.</b> I connect the USB-FTDI.
<li>5. I run <b><i>dmesg -w</i></b> <li><b>5.</b> 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> <li><b>6.</b> 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> <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> <ul><li><b>7.</b> 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> <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> <ul><li><b>8.</b> 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> <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> <ul><li><b>9.</b> 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> <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> <ul><li><b>10.</b> 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> <p><img src="images/adrianino/a_05.jpg" width="60%"; max-width="700" /></p>
<ul><li>11. Go into the "pyupdi" folder. <ul><li><b>11.</b> 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> <li><b>12.</b> 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 PA1 (8 in Arduino) where the LED is integrated. 😍 </p> <p>In this short video you can see the process of loading the programming and the operation of a Blink on pin PA1 (8 in Arduino) where the LED is integrated. 😍 </p>
......
File added
File added
docs/images/samdino/s_07.jpg

302 KiB

docs/images/samdino/s_08.jpg

247 KiB

docs/images/samdino/s_09.jpg

258 KiB

docs/images/samdino/s_10.jpg

243 KiB

docs/images/samdino/s_11.jpg

233 KiB

docs/images/samdino/s_12.jpg

91.2 KiB

docs/images/samdino/s_13.jpg

308 KiB

docs/images/samdino/s_14.jpg

131 KiB

docs/images/samdino/s_15.jpg

111 KiB

docs/images/samdino/s_16.jpg

53.6 KiB

docs/images/samdino/s_17.jpg

240 KiB

docs/images/samdino/s_18.jpg

168 KiB

...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
</ul> </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> <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>
<a href=""><b></b></a>
<h1><a id="freedap"></a>SAMD11C Free Dap Programmer.</h1> <h1><a id="freedap"></a>SAMD11C Free Dap Programmer.</h1>
...@@ -158,51 +158,65 @@ ...@@ -158,51 +158,65 @@
<p><img src="images/samdino/s_03.jpg" width="60%"; max-width="700" /></p> <p><img src="images/samdino/s_03.jpg" width="60%"; max-width="700" /></p>
<p>Here you can see the boards already milled. IMPORTANT: remember to remove the excess copper around the USB, you could produce a short circuit. The other image with the materials prepared.</p> <p>Here you can see the boards already milled. IMPORTANT: remember to remove the excess copper around the USB, you could produce a short circuit. The other image with the BOM prepared.</p>
<span class="image main"><img src="images/samdino/s_04.jpg" alt="" /></span> <span class="image main"><img src="images/samdino/s_04.jpg" alt="" /></span>
<p>Once all the components have been soldered, I have created a <a href="assignments/samdino/carcasa_samd.stl"><b>3D case</b></a> to make a better connection of the USB and I have also painted the red color for VCC and the white color for GND on the 1.27 mm SMD connectors. So when connecting flat cables there is no confusion.</p>
<p><img src="images/samdino/s_07.jpg" width="60%"; max-width="700" /></p>
<h1><a id="programming"></a>Programming</h1> <h1><a id="programming"></a>Programming</h1>
<h2>Windows + Arduino</h2> <h2>Create a SAMD11C Free Dap Programmer. (Windows)</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 PA1 (8 in Arduino) where the LED is integrated. 😍 </p>
<p>As I mentioned in the previous step, one of the advantages of this microcontroller is that we can turn it into a <b>programmer.</b> For this we need <a href="https://www.microchip.com/DevelopmentTools/ProductDetails/ATATMEL-ICE"><b>Atmel-ICE</b></a> or <a href="https://store.particle.io/products/particle-debugger"><b>Particle</b></a> programmer. In my case I use the Particle.</p>
<p><video controls width="100%"; max-width="800"><source src="images/adrianino/blink.mp4" type="video/mp4"></video></p>
<p><img src="images/samdino/s_08.jpg" width="60%"; max-width="700" /></p>
<p>We will connect the flat cables in the following way, from the Particle to the 10-4 converter, then with the 4-wire flat cable (in my case, 6-wire) to the future programmer.</p>
<span class="image main"><img src="images/samdino/s_09.jpg" alt="" /></span>
<p><b>IMPORTANT:</b> We will connect the Particle or the programmer to the computer and our Free Dap Programmer to an external power supply (that is not the same computer).</p>
<ul><li><b>1.</b> We will download the <a href="https://github.com/ataradov/edbg"><b>EDBG,</b></a> in my case I download the <a href="https://dl.bintray.com/ataradov/edbg/master/"><b>B74 version. The version is important when executing the installation.</b></a></li></ul>
<p><img src="images/samdino/s_10.jpg" width="80%"; max-width="700" /></p>
<ul><li><b>2.</b> Then on the <b>Fab Academy</b> page (Embedded Programming) we will find the Free Dap bootloader that we will also <a href="http://academy.cba.mit.edu/classes/embedded_programming/SWD/free_dap_d11c_mini.bin"><b>download.</b></a> </li></ul>
<p><img src="images/samdino/s_11.jpg" width="80%"; max-width="700" /></p>
<ul><li><b>3. Open terminal.</b> We execute inside the EDBG folder <b><i>edbg-b74-WINDOWS-7029fc4.exe -bpv -t samd11 -f free_dap_d11c_mini.bin </i></b> The LED of our programmer should light up and appear on our screen like the following capture.</ul>
<p><img src="images/samdino/s_12.jpg" width="80%"; max-width="700" /></p>
<p>With this programming we get a programmer, now we can program other SAMD11C and have our own programmer or for the Fab Lab. This would be the connection, remember to feed the programmer to the computer and the future programmer to an external power source. Then we repeat the previous steps and program it.</p>
<p><img src="images/samdino/s_13.jpg" width="80%"; max-width="700" /></p>
<h2>SAM11C with Arduino</h2>
<p>Once we have the SAMD11C as a Free Dap programmer, we can change the bootloader so that we can program the SAMD11C through the Arduino IDE. For this we will follow the following steps. You can find more information on the <a href="https://github.com/mattairtech/ArduinoCore-samd"><b>Mattairtech Git Hub.</b></a></p>
<ul><li><b>1.</b> We will <a href="https://github.com/mattairtech/ArduinoCore-samd/blob/master/bootloaders/zero/binaries/sam_ba_Generic_D11C14A_SAMD11C14A.bin"><b>download</b></a> the sam_ba_Generic_D11C14A bootloader.</li>
<li><b>2. Open terminal.</b> We execute inside the EDBG folder <b><i>edbg-b74-WINDOWS-7029fc4.exe -bpv -e -t samd11 -f sam_ba_Generic_D11C14A_SAMD11C14A.bin </i></b> Appear on our screen like the following capture.</ul>
<p><img src="images/samdino/s_14.jpg" width="80%"; max-width="700" /></p>
<ul><li><b>3.</b> We open the Arduino program.
<li><b>4.</b> In Preferences, we will add the URL of the additional cards that you can find <a href="https://www.mattairtech.com/software/arduino/package_MattairTech_index.json"><b>here.</b></a> We need the <a href="https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls"><b>MattairTech LLC.</b></a></ul>
<p><img src="images/samdino/s_15.jpg" width="50%"; max-width="700" /></p>
<ul><li><b>5.</b> The next step is to download Generic SAMD11C in the boards manager.</ul>
<p><img src="images/samdino/s_16.jpg" width="50%"; max-width="700" /></p>
<ul><li><b>6.</b> We configure the Arduino IDE for the SAMD11C. The SAMD11C will appear in the COM port, in my case in COM 8.</ul>
<p><img src="images/samdino/s_17.jpg" width="80%"; max-width="700" /></p>
<ul><li><b>7.</b> Now load the Blink program so that the LED on pin 14 blinks. When we upload it, all this information appears in the notifications section.</ul>
<p><img src="images/samdino/s_18.jpg" width="80%"; max-width="700" /></p>
<p>In this short video you can see the operation of a Blink on pin PA14 (14 in Arduino) where the LED is integrated. 😍 </p>
<p><video controls width="100%"; max-width="800"><source src="images/samdino/blink1.mp4" type="video/mp4"></video></p>
<h1><a id="bom"></a>BOM and Schematic</h1> <h1><a id="bom"></a>BOM and Schematic for Samdino</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>
...@@ -319,7 +333,7 @@ ...@@ -319,7 +333,7 @@
<td>2,10 €</td> <td>2,10 €</td>
</tr> </tr>
<tr> <tr>
<td><a href="https://www.digikey.es/product-detail/es/sullins-connector-solutions/GRPB022VWQS-RC/S9012E-02-ND/1786411"> Connector Header SMD 4POS 1.27MMr</a></td> <td><a href="https://www.digikey.es/product-detail/es/sullins-connector-solutions/GRPB022VWQS-RC/S9012E-02-ND/1786411"> Connector Header SMD 4POS 1.27mm</a></td>
<td>Digikey</td> <td>Digikey</td>
<td>1</td> <td>1</td>
<td>0,39 €/unit</td> <td>0,39 €/unit</td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment