<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4024029024828703140</id><updated>2024-09-16T04:55:38.719+02:00</updated><category term="robot MSP430 moteurs"/><title type='text'>430 mania</title><subtitle type='html'>projets ludiques en électronique basés sur le microcontrôleur MSP430.&#xa;tutoriels sur la programmation du MSP430.&#xa;tutoriels sur la création de montages électroniques.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://430mania.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://430mania.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Eric</name><uri>http://www.blogger.com/profile/15386377255133398663</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4024029024828703140.post-3416626505873946915</id><published>2012-01-08T20:31:00.003+01:00</published><updated>2012-01-09T11:40:39.383+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="robot MSP430 moteurs"/><title type='text'>mon projet de robot autonome</title><content type='html'>En avant première, voici une photo de mon robot autonome à base de MSP430.&lt;br /&gt;
&lt;br /&gt;
Le robot possède :&lt;br /&gt;
- 2 moteurs à courant continu pour se déplacer,&lt;br /&gt;
- 1 capteur de distance,&lt;br /&gt;
- et bien sûr, un launchpad MSP430,&lt;br /&gt;
- un peu de mécanique (roues, fixations...).&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH75pwziBdY179L9Bebb9hsm7M6aq03YICj90CJp5LccIL517ZekQloST8wzhBPPFWYWxPVYgVygAzPvUESapwPpOXz3bfgAfyxcrOkVyPVgwvmVO6qdwbPoXHNl1qpoC8nVeqbKE2HfRA/s1600/robot1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH75pwziBdY179L9Bebb9hsm7M6aq03YICj90CJp5LccIL517ZekQloST8wzhBPPFWYWxPVYgVygAzPvUESapwPpOXz3bfgAfyxcrOkVyPVgwvmVO6qdwbPoXHNl1qpoC8nVeqbKE2HfRA/s400/robot1.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Pour le moment, le robot se déplace dans une pièce en évitant les obstacles. Je rajouterai de nouvelles fonctions par la suite.&lt;br /&gt;
&lt;br /&gt;
Détail de la réalisation dans les&amp;nbsp;prochains&amp;nbsp;articles...&lt;br /&gt;
&lt;br /&gt;
A bientôt !</content><link rel='replies' type='application/atom+xml' href='http://430mania.blogspot.com/feeds/3416626505873946915/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://430mania.blogspot.com/2012/01/mon-projet-de-robot-autonome.html#comment-form' title='1 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/3416626505873946915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/3416626505873946915'/><link rel='alternate' type='text/html' href='http://430mania.blogspot.com/2012/01/mon-projet-de-robot-autonome.html' title='mon projet de robot autonome'/><author><name>Eric</name><uri>http://www.blogger.com/profile/15386377255133398663</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH75pwziBdY179L9Bebb9hsm7M6aq03YICj90CJp5LccIL517ZekQloST8wzhBPPFWYWxPVYgVygAzPvUESapwPpOXz3bfgAfyxcrOkVyPVgwvmVO6qdwbPoXHNl1qpoC8nVeqbKE2HfRA/s72-c/robot1.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4024029024828703140.post-5638563709980102217</id><published>2011-11-08T13:57:00.003+01:00</published><updated>2011-11-09T10:22:17.792+01:00</updated><title type='text'>Les opérateurs logiques en C</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr6OV9LYqcWt4Dnh61wz1gR3_4sUe2HMtdGRUkH5plXUhx_1aFmAEQgk8bwKq-a5Pk0KoBYXTbiikJGoOTvkvqqODUrROW2WTPwwjz5haREOfCrh_zsgPe4eUd4C6ztUvdsbHc9TKp3mod/s1600/logic2.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;191&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr6OV9LYqcWt4Dnh61wz1gR3_4sUe2HMtdGRUkH5plXUhx_1aFmAEQgk8bwKq-a5Pk0KoBYXTbiikJGoOTvkvqqODUrROW2WTPwwjz5haREOfCrh_zsgPe4eUd4C6ztUvdsbHc9TKp3mod/s400/logic2.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Pour finir notre explication sur notre premier programme, il faut parler des opérateurs logiques en C.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Ils permettent de faire des opérations sur des valeurs booléennes ou sur les bits d&#39;une variable. Une variable booléenne peut prendre 2 valeurs 0 (faux) ou 1 (vrai).&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Il existe 4 opérateurs logiques principaux pour traiter des valeurs booléennes :&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- le OU (OR en anglais) : A OR B est vrai si A ou B est vrai,&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- le ET (AND en anglais) : A AND B est vrai si A et B sont vrais,&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- le OU exclusif (XOR en anglais) : A XOR B est vrai si uniquement A ou uniquement B est vrai (mais pas les 2 en même temps),&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- la NEGATION (NOT en anglais) : NOT A est vrai si A est faux.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Le tableau suivant regroupe ces informations :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; bgcolor=&quot;#DDDDDD&quot; border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;2&quot;&gt;NOT&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;3&quot;&gt;AND&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;3&quot;&gt;OR&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;3&quot;&gt;XOR&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;1&quot;&gt;Input&lt;br /&gt;
A&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;Output&lt;br /&gt;
Z&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;1&quot;&gt;Input&lt;br /&gt;
A&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;1&quot;&gt;Input&lt;br /&gt;
B&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;Output&lt;br /&gt;
Z&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;1&quot;&gt;Input&lt;br /&gt;
A&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;1&quot;&gt;Input&lt;br /&gt;
B&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;Output&lt;br /&gt;
Z&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;1&quot;&gt;Input&lt;br /&gt;
A&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot; colspan=&quot;1&quot;&gt;Input&lt;br /&gt;
B&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;Output&lt;br /&gt;
Z&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;1&lt;/th&gt;   &lt;th bgcolor=&quot;#C0C0C0&quot;&gt;0&lt;/th&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
En C, on utilise les signes suivant pour les opérateurs :&lt;br /&gt;
- le &#39;!&#39; (point d&#39;exclamation) pour le NOT,&lt;br /&gt;
- le &#39;&amp;amp;&#39; (et commercial) pour le AND,&lt;br /&gt;
- le &#39;|&#39; (barre verticale) pour le OR,&lt;br /&gt;
- le &#39;^&#39; (accent circonflexe) pour le XOR.&lt;br /&gt;
&lt;br /&gt;
par exemple, la ligne suivante :&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;b&gt;z = a | b;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
signifie que la vaiable z prend la valeur de a OU b (si a ou b sont vrai, alors z sera vrai).&lt;br /&gt;
&lt;br /&gt;
Tous ces opérateurs agissent aussi sur les bits d&#39;une variable. Par exemple dans le programme suivant :&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;b&gt;a = 0x48;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;b&gt;b = 0x11;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;b&gt;z = a | b;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
la valeur de z prend comme nouvelle valeur 0x48 | 0x11 = 0b01001000 | 0b00010001 = 0b01011001, c&#39;est à dire la valeur &lt;i style=&quot;color: blue;&quot;&gt;&lt;b&gt;0x59&lt;/b&gt;&lt;/i&gt; en hexadécimal.&lt;br /&gt;
&lt;br /&gt;
A présent, revenons à notre premier programme (voir posts précédents). Le corps du programme était le suivant :&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: lime;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;// test de P1.3 (boutton poussoir)&lt;/span&gt;&lt;/i&gt;&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;if ((P1IN &amp;amp; 0x08)==0)&lt;/i&gt;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;{&lt;/i&gt;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;i style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: lime;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;// activation de la LED sur P1.0&lt;/span&gt;&lt;/i&gt;&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;P1OUT = 0x01;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;/i&gt;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;else&lt;/i&gt;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;{&lt;/i&gt;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;i style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: lime;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;// activation de la LED sur P1.6&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;P1OUT = 0x40;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;l&#39;instruction &quot;if&quot; en C permet de tester une condition. Ici si (P1IN &amp;amp; 0x08) est égal à 0 , c&#39;est à dire si le bit numéro 3 de P1IN est égal à 0, alors la condition est vraie.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;Au passage on remarque que pour le test d&#39;égalité en C, on utilise une syntaxe &quot;==&quot; avec 2 signes &quot;=&quot;. Cela permet au compilateur de faire la différence avec l&#39;opérateur d&#39;affectation de valeur qui lui n&#39;utilise qu&#39;un seul signe égale (comme dans a = 0x48).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;Donc pour résumer, si le bit 3 de P1IN est nul (c&#39;est à dire si le bouton poussoir est enfoncé), alors on&amp;nbsp;allume&amp;nbsp;la LED sur P1.0. Sinon on allume la LED sur P1.6.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://430mania.blogspot.com/feeds/5638563709980102217/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://430mania.blogspot.com/2011/11/les-operateurs-logiques-en-c.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/5638563709980102217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/5638563709980102217'/><link rel='alternate' type='text/html' href='http://430mania.blogspot.com/2011/11/les-operateurs-logiques-en-c.html' title='Les opérateurs logiques en C'/><author><name>Eric</name><uri>http://www.blogger.com/profile/15386377255133398663</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr6OV9LYqcWt4Dnh61wz1gR3_4sUe2HMtdGRUkH5plXUhx_1aFmAEQgk8bwKq-a5Pk0KoBYXTbiikJGoOTvkvqqODUrROW2WTPwwjz5haREOfCrh_zsgPe4eUd4C6ztUvdsbHc9TKp3mod/s72-c/logic2.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4024029024828703140.post-392765230312066424</id><published>2011-11-02T12:12:00.016+01:00</published><updated>2011-11-04T11:35:04.343+01:00</updated><title type='text'>Les ports d&#39;entrée-sortie du MSP430</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Pour expliquer notre premier programme, nous allons tout d&#39;abord rentrer dans l&#39;architecture du MSP430G2231 et parler des ports d&#39;entrée-sortie.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Comme vous l&#39;avez sans doute remarqué, le MSP430G2231 possède 16 pattes. Pour trouver la fonction électrique de chacune de ces pattes, il faut consulter un document qui s&#39;appelle le &quot;datasheet&quot; du MSP430G2231. Chez Texas Instruments, un datasheet est un document qui décrit et qui donne toutes les caractéristiques d&#39;un circuit. Vous pouvez trouver le datasheet du MSP430G2231 au format PDF ici : &lt;a href=&quot;http://www.ti.com/lit/ds/symlink/msp430g2231.pdf&quot;&gt;http://www.ti.com/lit/ds/symlink/msp430g2231.pdf&lt;/a&gt;&amp;nbsp;.&lt;/div&gt;&lt;br /&gt;
Au début du document, vous trouverez la description des pattes du circuit :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4-twee1gTNqCNnv9QJjHN1zw4nR3mDUSYoveI4YpyqP2l5QpOmRC4BVW-UUbItInjlKHNNR4q0Iob_vcCn1t_cg2BQCFyi006TORMZAbDHl-A-FW6vx0hl_u1GKD3jc-MuDgNoNCbiNd9/s1600/MSP430G2231_pinout.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4-twee1gTNqCNnv9QJjHN1zw4nR3mDUSYoveI4YpyqP2l5QpOmRC4BVW-UUbItInjlKHNNR4q0Iob_vcCn1t_cg2BQCFyi006TORMZAbDHl-A-FW6vx0hl_u1GKD3jc-MuDgNoNCbiNd9/s400/MSP430G2231_pinout.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;La patte 1 est utilisée pour l&#39;alimentation. Elle doit être relié à une source de tension d&#39;environ 3 volts (entre 2 volts et 3.6 volts pour être précis). En général, on utilise du 3.3 volts. Sur le Launchpad elle est&amp;nbsp;déjà&amp;nbsp;reliée au 3.3 volts.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;La patte 14 doit être reliée à la masse (0 volts) ou à la broche &#39;-&#39; d&#39;une pile. Sur le Launchpad elle est déjà reliée à la masse.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Les pattes 2 à 9 sont utilisées (entre autre) par le port d&#39;entrée-sortie P1. Ce port d&#39;entrée-sortie possède 8 connections nommées P1.0 à P1.7.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Les pattes 12 et 13 sont utilisées (entre autre) par le port d&#39;entrée-sortie P2 (P2.6 et P2.7).&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;On voit aussi que certaines pattes ont plusieurs&amp;nbsp;fonctionnalités. Par exemple la patte 12 peut être soit P2.7, soit XOUT (utilisé par un oscillateur externe). Par défaut, à la mise sous tension, ce sont les fonctionnalités des ports d&#39;entrées-sorties qui sont active. Si on veut utiliser une autre fonctionnalité, il faudra écrire une instruction dans le programme pour&amp;nbsp;cela.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;Voici un schéma fonctionnel de notre circuit (également tiré du datasheet) :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEZXzq3B2g_pesDzUs9Cs5neN8wFcXg8eSR4eoLBwZV7KBRrWpE9Rsy2kAwZ8AHdbhgKl7bnxERtVHhcxlbtGC7OQFtEX7FC8ZOqMhMAmFdg36ykFn8Vf7ot5lR6YyuFzt8HgYO8v5lU9p/s1600/MSP430G2231_functional.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;292&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEZXzq3B2g_pesDzUs9Cs5neN8wFcXg8eSR4eoLBwZV7KBRrWpE9Rsy2kAwZ8AHdbhgKl7bnxERtVHhcxlbtGC7OQFtEX7FC8ZOqMhMAmFdg36ykFn8Vf7ot5lR6YyuFzt8HgYO8v5lU9p/s400/MSP430G2231_functional.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;On retrouve nos 2 pattes d&#39;alimentation (DVCC; DVSS) et nos 2 ports d&#39;entrées-sortie (P1.x et P2.x). On voit également les périphériques internes du microcontrôleur (nous les détaillerons dans un autre post).&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;C&#39;est bien beau tout ça, mais revenons à nos moutons : c&#39;est quoi donc une patte d&#39;entrée-sortie ?&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;C&#39;est une patte du microcontrôleur qu&#39;on peut définir soit :&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;- &lt;u&gt;&lt;b style=&quot;color: #38761d;&quot;&gt;en entrée&lt;/b&gt;&lt;/u&gt; : dans ce cas, on peut lire la valeur logique appliqué sur cette tension. Par exemple, si on applique 3 volts sur cette patte, le programme pourra lire la valeur de cette entrée à un &#39;1&#39; logique. Par contre si on met cette entrée à la masse, on lira un &#39;0&#39; logique. Cela permet par exemple de détecter l&#39;appui sur un bouton poussoir.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;- &lt;u style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;en sortie&lt;/b&gt;&lt;/u&gt; : dans ce cas, le programme peut contrôler la valeur logique sur cette patte. Le programme peut écrire un &#39;1&#39; - on aura alors environ 3 volts sur cette patte. Il peut écrire un &#39;0&#39; - cette pate sera à un potentiel proche de la masse.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Un port d&#39;entrée sortie regroupe plusieurs de ces pattes (par exmple le port P1 regroupe 8 signaux P1.0 à P1.7).&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Mais comment peut-on commander les ports d&#39;entrée sortie ?&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Pour cela on utilise ce qu&#39;on appelle des registres du micro. Les registres sont des cases mémoires qui sont reliées aux périphériques du micro. Il y a plusieurs centaines de registres dans un MSP430. Il y en a pour les ports d&#39;entrée-sortie, mais aussi pour d&#39;autres périphériques comme les timers, l&#39;UART, les horloges (nous parlerons de ces&amp;nbsp;périphériques&amp;nbsp;un autre jour).&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Aujourd&#39;hui, on va s&#39;intéressé à 3 registres du port P1. Leur petits noms sont P1DIR, P1IN et P1OUT.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;P1DIR&lt;/span&gt;&lt;/b&gt;&lt;/i&gt; sert à définir la direction des pattes du ports P1 : en entrée ou en sortie. P1DIR est stocké sur 1 octets, c&#39;est à dire sur 8 bits. Chaque bit correspond à une patte (bit 0 pour P1.0, but 1 pour P1.1, etc...). Par définition, un bit ne peut prendre que 2 valeurs 0 ou 1. Les bits à 0 placent la patte correspondante en entrée. Les bits à 1 placent les pattes correspondantes en sortie.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjnGtkBgHgWfEc1LAPNduOhHaDUHCqP8Vr9fvNoMIJOqUHLdhj-CQzQ0yHeVysr5KN6v2fi8vxggzFgN33MKtXjCmJnf59EzhyphenhyphenpEMmUNCkQXfoC2tjPYNqI7uJETjMFyJ4yvACcIEthHyJ/s1600/P1DIR.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;174&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjnGtkBgHgWfEc1LAPNduOhHaDUHCqP8Vr9fvNoMIJOqUHLdhj-CQzQ0yHeVysr5KN6v2fi8vxggzFgN33MKtXjCmJnf59EzhyphenhyphenpEMmUNCkQXfoC2tjPYNqI7uJETjMFyJ4yvACcIEthHyJ/s320/P1DIR.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Sur l&#39;image ci-dessus, on voit les 8 bits de P1DIR. Dans cet exemple, on constate que P1.0 et P1.6 sont en sortie. Les autres ports sont en entrée. (sur le Launchpad, les ports P1.0 et P1.6 sont utilisés pour commander les 2 LEDs).&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;i style=&quot;color: blue;&quot;&gt;&lt;b&gt;P1OUT&lt;/b&gt;&lt;/i&gt; sert à définir la valeur effective sur les pattes de sorties. P1OUT contient également 8 bits (ça&amp;nbsp;on s&#39;en doutait !). Un bit à &#39;1&#39; applique une tension proche de VCC ( ici 3.3 volts) sur la patte correspondante. Un bit à &#39;0&#39; applique une tension proche de GND (0 volts) sur la patte correpondante.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX8AeGURAcUouJmmlpOXE20cwMStbViEe3wyKgOIQlp3T_Eng6W3J_4tdgPBY9ZgRtdYyE4cG5NWNnaiOQmj6r1Jz5ZMpebhtQFMjXhyphenhyphenRh3oIgZ90qilEH3XFg0kH32SlrEaNX0E9BQHY6/s1600/P1OUT.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;183&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX8AeGURAcUouJmmlpOXE20cwMStbViEe3wyKgOIQlp3T_Eng6W3J_4tdgPBY9ZgRtdYyE4cG5NWNnaiOQmj6r1Jz5ZMpebhtQFMjXhyphenhyphenRh3oIgZ90qilEH3XFg0kH32SlrEaNX0E9BQHY6/s320/P1OUT.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;P1IN&lt;/span&gt;&lt;/b&gt;&lt;/i&gt; permet de lire les valeurs logiques appliquées sur les pattes (qu&#39;elles soient en entrée ou en sortie).&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6oIxzvdXa-fNKXuD0SpzZMyPpOw864-tXoZTpkzNq6JW_v7zowyIIR0OEXvDgSUK15fs9PXsWRQyQxPBCsPI7VUd7ML3yOiJL1_RPOIyC60fVKniIKceSCroVpFUiB9WKIoQ928mRoj2o/s1600/P1IN.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6oIxzvdXa-fNKXuD0SpzZMyPpOw864-tXoZTpkzNq6JW_v7zowyIIR0OEXvDgSUK15fs9PXsWRQyQxPBCsPI7VUd7ML3yOiJL1_RPOIyC60fVKniIKceSCroVpFUiB9WKIoQ928mRoj2o/s320/P1IN.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Maintenant nous allons nous amuser à modifier ces registres grâce au debugger de Code Composer Studio.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Pour cela,&amp;nbsp;déramez&amp;nbsp;Code Composer en utilisant le même workspace que dans le post précédent. Vous devriez tomber sur une fenêtre similaire à la suivante :&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEif_FQcaAzscDxa_mzMqLRYrUzTDU5TnDySDam0lorFmXky8_3B8A6F-5RHA9AdZq9F5iyZTARcVTx6v3SGlr4tKyWQ5pOESgExX0E1RQ4OqsJhGMS5EW7icgYt5jwqt7rQhWes1Bej0dvH/s1600/CCS20.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEif_FQcaAzscDxa_mzMqLRYrUzTDU5TnDySDam0lorFmXky8_3B8A6F-5RHA9AdZq9F5iyZTARcVTx6v3SGlr4tKyWQ5pOESgExX0E1RQ4OqsJhGMS5EW7icgYt5jwqt7rQhWes1Bej0dvH/s400/CCS20.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;On retrouve le&amp;nbsp;programme&amp;nbsp;que nous avions créé dans le post précédent. Si vous n&#39;êtes pas&amp;nbsp;dans&amp;nbsp;cette&amp;nbsp;configuration, suivez les étapes décrites dans le post précédent.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;On peut vérifier les propriétés du projet en faisant Project-&amp;gt;Properties :&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsf9AKGalkN_OZfuvhgpi4Hjz-M6g7ZaBFNc6iAQayIOObwt8HjHZYKoai8EO3q_sipNrdPEn8JbO6OEqUzN-LXo7JUvi-futx8u-XgTFbYhltllv1KYVtqXC-XDhyphenhyphenxN_1MlulWnTTMot3/s1600/CCS21.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;260&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsf9AKGalkN_OZfuvhgpi4Hjz-M6g7ZaBFNc6iAQayIOObwt8HjHZYKoai8EO3q_sipNrdPEn8JbO6OEqUzN-LXo7JUvi-futx8u-XgTFbYhltllv1KYVtqXC-XDhyphenhyphenxN_1MlulWnTTMot3/s400/CCS21.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;En&amp;nbsp;choisissant&amp;nbsp;l&#39;option &quot;CCS Build&quot;, on peut vérifier que le processeur ciblé est bien un MSP430G2231.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Maintenant passons en mode Debug. Pour cela, cliquez sur le petit insecte vert (je l&#39;ai entouré en rouge sur &amp;nbsp;la copie d&#39;écran de l&#39;interface). Bien sûr à ce stade, le Launcpad doit être branché sur un port USB du PC pour que le Debuger puisse communiquer avec lui.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9ATmwORo7YrUkURKutKMO8cs19LRZSy4gFqXzL1tZ6VwXq8QZLNOG3aoJ-bcs0Jy3z0QxtsFwsc4tD0pTy1N0AzqgTeo2So80sagLUxF47Tj2M1KAhdscP95BGDlDx4UsQU48lOmrYqSl/s1600/CCS22.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9ATmwORo7YrUkURKutKMO8cs19LRZSy4gFqXzL1tZ6VwXq8QZLNOG3aoJ-bcs0Jy3z0QxtsFwsc4tD0pTy1N0AzqgTeo2So80sagLUxF47Tj2M1KAhdscP95BGDlDx4UsQU48lOmrYqSl/s400/CCS22.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Maintenant nous allons visualiser quelques registres du MSP430 grâce au Debuger. Pour cela : View-&amp;gt;Registers&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Maintenant, choisissez Port_1_2. En effet nous voulons visualiser les registres liés aux ports d&#39;entrée-sortie :&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbtk34aSeDX7JaOKmMnqkSM6bUn3B9aZ1ZEV4Fpt5CJ3-fYa-m_zv9irETfsWafMcw2pMHwH0xZeA1ePB0XUMtslB2iVtx-9ajEWa_zhPr9vMRjUOxgJPkYPo59sYYY1w3Q-mZQ_3wl8FG/s1600/CCS23.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbtk34aSeDX7JaOKmMnqkSM6bUn3B9aZ1ZEV4Fpt5CJ3-fYa-m_zv9irETfsWafMcw2pMHwH0xZeA1ePB0XUMtslB2iVtx-9ajEWa_zhPr9vMRjUOxgJPkYPo59sYYY1w3Q-mZQ_3wl8FG/s400/CCS23.png&quot; width=&quot;387&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Oh miracle ! Voici les fameux registres P1IN P1OUT et P1DIR dont nous avons parlé ! &amp;nbsp;:)&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;On va pouvoir faire joujou. Grâce au débugger on peut directement modifier la valeur de ces registres dans le MSP430.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Commençons&amp;nbsp;par mettre P1.0 et P1.6 en sortie. Pour cela, on modifie P1DIR :&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC2pBeUk3FpIm_epmidErQWHJnlKG17Altre4PevbCz9IEX_1giESBCLNd6H0I-md0JGbe1Ty1zPKpSK_bgZGMb3bwmaFsV21K8OQR2XgtKrlqYY_c5iMmogX0Jh9NoCoxRX-TXgZIMGoo/s1600/CCS24.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC2pBeUk3FpIm_epmidErQWHJnlKG17Altre4PevbCz9IEX_1giESBCLNd6H0I-md0JGbe1Ty1zPKpSK_bgZGMb3bwmaFsV21K8OQR2XgtKrlqYY_c5iMmogX0Jh9NoCoxRX-TXgZIMGoo/s400/CCS24.JPG&quot; width=&quot;397&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Vous vous rappelez sans doute que P1.0 et P1.6 sont reliés aux 2 LEDs du Launchpad. Maintenant on peut commander ces LEDs grâce à P1OUT. On va les allumer en mettant P1OUT.P0 et P1OUT.P6 à &#39;1&#39; :&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdi7PC00tS-zSlHjAUfPLL0YfdBKdjRSXvF9p040rlGgzKShPEHAuNXjRrTPc4AWNGLu6vi11fvzLRISIF3CyA30E72s8Fx1RY-fJ5jwvAcjbRRZcXCFGe5Y3vK4kyqG3vDT70JJyMTzMy/s1600/CCS25.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdi7PC00tS-zSlHjAUfPLL0YfdBKdjRSXvF9p040rlGgzKShPEHAuNXjRrTPc4AWNGLu6vi11fvzLRISIF3CyA30E72s8Fx1RY-fJ5jwvAcjbRRZcXCFGe5Y3vK4kyqG3vDT70JJyMTzMy/s400/CCS25.JPG&quot; width=&quot;386&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Oh magie ! Comme c&#39;est beau ! Notre Launchpad s&#39;illumine :&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUDAftgBqKrAH5SRndZ_fyjUScBaY4ojcwuQJAUfBxU5xxPehZis6QF4V1oIpE1Gi3Bb7r4QRJC8wvPeikJYIpacjHHY_LOxQxz9evuiLiiFc7XRHRlFBIi4laBSLmY6Isqr8sg7hHbzEn/s1600/Launchpad.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUDAftgBqKrAH5SRndZ_fyjUScBaY4ojcwuQJAUfBxU5xxPehZis6QF4V1oIpE1Gi3Bb7r4QRJC8wvPeikJYIpacjHHY_LOxQxz9evuiLiiFc7XRHRlFBIi4laBSLmY6Isqr8sg7hHbzEn/s400/Launchpad.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;De la même manière vous avez aussi accès à P1IN pour lire les valeurs en entrée (bien que cet affichage ne soit pas 100% dynamique pour les entrées).&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Vous remarquez qu&#39;on a changé les valeurs des registres un bit après l&#39;autre. Dans la vue sur les registres, on peut aussi changer la valeur globale d&#39;un registre (donc plusieurs bits à la fois). Par exemple on aurait pu directement modifier P1DIR en lui donnant la valeur 0x41.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Mais c&#39;est quoi ce 0x ? Le 0x signifie que la valeur est&amp;nbsp;affichée&amp;nbsp;en hexadécimal.... Je vous vois faire une&amp;nbsp;drôle&amp;nbsp;de tête ! Je vais devoir expliquer ce qu&#39;est la représentation hexadécimale qui est beaucoup utilisé pour la programmation des registres.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;b&gt;&lt;i&gt;Compter en&amp;nbsp;hexadécimal&amp;nbsp;:&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Dans la vie de tout les jours on utilise la représentation décimale (base 10) pour compter. Cela veut dire qu&#39;on utilise 10 caractères de base pour compter qui sont 0, 1, 2, 3, 4, 5, 6, 7, 8 et 9.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;La représentation hexadécimale (base 16) utilise 16 caractère pour compter : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Pour vous donner une idée des différences, voici un tableau de conversion décimal vers hexadécimal :&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3mCET3Dn6AUnnEyzF4l7RkIrJXOV9P5aEC-BUrG4CvMyT1psJpz4LG4kG-77EWP4iNc4DDVlFxUAsBGUptHnT9oYuA8UfgLyJ3jNfGNkv273VqOzlRny1CU7eqs3kfVpzjffgKmwHxkCH/s1600/hexa.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3mCET3Dn6AUnnEyzF4l7RkIrJXOV9P5aEC-BUrG4CvMyT1psJpz4LG4kG-77EWP4iNc4DDVlFxUAsBGUptHnT9oYuA8UfgLyJ3jNfGNkv273VqOzlRny1CU7eqs3kfVpzjffgKmwHxkCH/s400/hexa.gif&quot; width=&quot;321&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Par exemple 46 en décimal, c&#39;est 0x2E en hexa. En effet 46 = &lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;2&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;*16 + &lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;15&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;. Ce qui donne &#39;2&#39; et &#39;E&#39; (15) =&amp;gt; 0x2E.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Da,s la programmation en C&amp;nbsp;embarqué, on utilisé souvent cette notation. Un des avantages de cette notation est de pouvoir écrire 8 bits sur 2 caractères. En effet avec 8 bits, on peut compter de 0 à 255, ce qui en&amp;nbsp;hexadécimal&amp;nbsp;fait de 0x00 à 0xFF. Notre tableau contient également les équivalence entre hexa et bianire. On remarque que :&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;0b00000000 = 0x00&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;0b00000001 = 0x01&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;0b00000010 = 0x02&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;0b00000100 = 0x04&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;0b00001000 = 0x08&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;0b00001111 = 0x0F&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;0b00010000 = 0x10&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;0b00100001 = 0x20&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;0b01000010 = 0x40&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;0b10000100 = 0x80&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;0b11111111 = 0xFF&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Pour revenie à P1DIR, on a mis les bits 0 et 6 à 1, ce qui donne :&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;0b01000001 = 0x41&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;On retrouve la valeur 0x41 affichée dans notre fenêtre de Debug.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Essayez dès à présent de vous habituer à utiliser la représentation binaire. Vous verrez, cela deviendra vite un automatisme pour vous, et vous en comprendrez les avantages.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Bien sûr ce que nous avons fait&amp;nbsp;grâce&amp;nbsp;au debugger, nous pouvons aussi le faire par le biais d&#39;un programme en C. Reprenons donc notre premier programme pour l&#39;expliquer.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://430mania.blogspot.com/feeds/392765230312066424/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://430mania.blogspot.com/2011/11/les-ports-dentree-sortie-du-msp430.html#comment-form' title='1 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/392765230312066424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/392765230312066424'/><link rel='alternate' type='text/html' href='http://430mania.blogspot.com/2011/11/les-ports-dentree-sortie-du-msp430.html' title='Les ports d&#39;entrée-sortie du MSP430'/><author><name>Eric</name><uri>http://www.blogger.com/profile/15386377255133398663</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4-twee1gTNqCNnv9QJjHN1zw4nR3mDUSYoveI4YpyqP2l5QpOmRC4BVW-UUbItInjlKHNNR4q0Iob_vcCn1t_cg2BQCFyi006TORMZAbDHl-A-FW6vx0hl_u1GKD3jc-MuDgNoNCbiNd9/s72-c/MSP430G2231_pinout.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4024029024828703140.post-2001719574774855746</id><published>2011-11-01T08:48:00.003+01:00</published><updated>2011-11-01T10:00:50.348+01:00</updated><title type='text'>Premier programme</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Ca y est ! Le Launchpad a été livré à la maison. On va pouvoir créer notre premier programme.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Commençons&amp;nbsp;par brancher le Launpad au PC avec le&amp;nbsp;câble&amp;nbsp;USB fourni.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Lorsque le branchement est effectué, une LED verte s&#39;allume et le Launchpad est reconnu pas le PC comme un périphérique USB composite. En effet, la connection USB permet non seulement de faire de l&#39;émulation, mais aussi de créer une interface type port COM vers la liaison série du microcontrôleur. Pour résumer, cela veut dire que dans nos porgrammes, on pourra utiliser le port USB pour afficher des données, ou recevoir des ordres de l&#39;utilisateur. Nous verrons celà dans un tutoriel dédié.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Maintenant que le Launchpad est branché, on peut démarrer un IDE.&amp;nbsp;Commençons&amp;nbsp;donc par lancer Code Composer Studio.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Le programme vous demandera de spécifier un répertoire de travail appelé &quot;workspace&quot;. C&#39;est dans ce répertoire que seront stoqués tous vos projets, vos fichiers, vos programmes.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Ensuite une fenêtre de bienvenue &quot;welcome&quot; apparaît. Vous pouvez la fermer. Vous devez alors obtenir cette interface :&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYUT8rDWIHuNt6Ym9KIzUxf5PJnyrLx4N3lcwXXK8emmTdN4nkr-52y13ke9ZswoljN4_Hh1YLrj7OpaSfvHd2rctcFhpmmyhnV5o7Xgg9FX84OXyCnBAM45yIwl9xvupwRQvWvx_4ByQt/s1600/CCS2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYUT8rDWIHuNt6Ym9KIzUxf5PJnyrLx4N3lcwXXK8emmTdN4nkr-52y13ke9ZswoljN4_Hh1YLrj7OpaSfvHd2rctcFhpmmyhnV5o7Xgg9FX84OXyCnBAM45yIwl9xvupwRQvWvx_4ByQt/s400/CCS2.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;A présent, créons&amp;nbsp;notre&amp;nbsp;premier projet. Pour&amp;nbsp;cela, faire File-&amp;gt;New-&amp;gt;CCS Project.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPD7F-5pmke6aV_eRsAbzjTbVtHqfT5JfAjvOsmIe9XzkwOS59YlvtmaAddqqNBO8k3U8rnlzdJFL7EqiIQWuAf7Moc1jr66PSS59JNU1FVacsU6XwzYo-XxzJoSVGDBe1erOVtvnwv-GR/s1600/CCS3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPD7F-5pmke6aV_eRsAbzjTbVtHqfT5JfAjvOsmIe9XzkwOS59YlvtmaAddqqNBO8k3U8rnlzdJFL7EqiIQWuAf7Moc1jr66PSS59JNU1FVacsU6XwzYo-XxzJoSVGDBe1erOVtvnwv-GR/s320/CCS3.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
appelons notre projet &quot;tutoriel1&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj0jNblrrcQpMDwbNu1wsF0Kkf2CBTHYwjwEp4VVodsCuN_EYqyXv_88_6B-rogrnXur7MTx7xuMsRA9Oo1hdsP2AAMyB3V-2XbQnpPvtA7YyWE6Ftmsy9iFp8Sen4N9ooI6YTugJ1fo79/s1600/CCS4.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj0jNblrrcQpMDwbNu1wsF0Kkf2CBTHYwjwEp4VVodsCuN_EYqyXv_88_6B-rogrnXur7MTx7xuMsRA9Oo1hdsP2AAMyB3V-2XbQnpPvtA7YyWE6Ftmsy9iFp8Sen4N9ooI6YTugJ1fo79/s320/CCS4.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Le type du projet est MSP430 puisque c&#39;est notre processeur cible.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0K6BFiJOhEs1cMZqR3F18w1NRP6dwDN7y-W1Tp4IntDhiqFTnYnG-coD_24bGmDhFb7jA-QZFK2Y1iSUciv5Z5pRq_k2AvOpfnk2na6-JrWLgfdug2Ei4ThT0z45wmDQQyWxaYjDphT0/s1600/CCS5.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk0K6BFiJOhEs1cMZqR3F18w1NRP6dwDN7y-W1Tp4IntDhiqFTnYnG-coD_24bGmDhFb7jA-QZFK2Y1iSUciv5Z5pRq_k2AvOpfnk2na6-JrWLgfdug2Ei4ThT0z45wmDQQyWxaYjDphT0/s320/CCS5.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVvv-uBgispabau_fitFZQw5cWvdSfL3z6QW7Yahg7HjD97BBctNlkOBc6pHMUjHQYy_hyRlk1gDPWhjGrR0IBlcTVZv49IKcL1k66OJCIQTn6cXMtD6C031G2xlloOZC8k1QVh_oP2S6G/s1600/CCS4b.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;252&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVvv-uBgispabau_fitFZQw5cWvdSfL3z6QW7Yahg7HjD97BBctNlkOBc6pHMUjHQYy_hyRlk1gDPWhjGrR0IBlcTVZv49IKcL1k66OJCIQTn6cXMtD6C031G2xlloOZC8k1QVh_oP2S6G/s320/CCS4b.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Ici, il faut choisir le microcontrôleur que nous voulons utiliser pour notre projet. CCS propose toutes les types de MSP430&amp;nbsp;existants. Nous choisissons le MSP430G2231, car c&#39;est le nom du microcontrôleur qui est placé sur le Launchpad. Vous pouvez d&#39;ailleurs le vérifier en lisant la référence imprimée sur la puce à 16 pattes.&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaeV3vLrErlp6wyZG6UqfAT1mfpDZsLWFvPWaJl1asTpLtjEWprWvc0CTfLQqn_CeBdXUIQs2b2OrhdfDG20aE49RwnOYOOqTJ7qW3ryyARTkbYgYHYyrQpY06-2f_BsUq49HGcN9klApR/s1600/CCS7.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;239&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaeV3vLrErlp6wyZG6UqfAT1mfpDZsLWFvPWaJl1asTpLtjEWprWvc0CTfLQqn_CeBdXUIQs2b2OrhdfDG20aE49RwnOYOOqTJ7qW3ryyARTkbYgYHYyrQpY06-2f_BsUq49HGcN9klApR/s320/CCS7.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Voilà, nous avons créé un projet pour le MSP430G2231. Mais à ce stade le projet est vide. Il ne contient aucun programme. Nous allons donc créer un fichier C qui va contenir du code. Pour cela, on va faire File-&amp;gt;New-&amp;gt;Source File.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Appelons ce fichier &quot;main.c&quot;. Ce fichier contiendra la fonction main() qui est la fonction appelée après le&amp;nbsp;démarrage&amp;nbsp;du microcontrôleur.&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl3k0ltQ0S-fL_X825FvW3nY4qw98Vp28sdAhkv276-_T1-ATTFNORDgWoAFpvucEHpDLHJZU8IMdAxMDK61918MkQ90gOIEfVgnoxOpf_2dz-nc4wQysCRijjmP8B6XlWdj5fPD_voYqi/s1600/CCS11.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl3k0ltQ0S-fL_X825FvW3nY4qw98Vp28sdAhkv276-_T1-ATTFNORDgWoAFpvucEHpDLHJZU8IMdAxMDK61918MkQ90gOIEfVgnoxOpf_2dz-nc4wQysCRijjmP8B6XlWdj5fPD_voYqi/s400/CCS11.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Plaçons&amp;nbsp;nous dans l&#39;onglet main.c, et ajoutons le code suivant :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;#include &amp;lt;msp430.h&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;void main(void)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;{&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: lime;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// activation des ports P1.0 et P1.6 en sortie&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: lime;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// pour controller les 2 LEDs&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;P1DIR = 0x41;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt; &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;while (1)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: lime;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;// test de P1.3 (boutton poussoir)&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;if ((P1IN &amp;amp; 0x08)==0)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;{&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: lime;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;// activation de la LED sur P1.0&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;P1OUT = 0x01;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;else&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;{&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: lime;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;// activation de la LED sur P1.6&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;P1OUT = 0x40;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;}&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
Vous pouvez simplement copier-coller le texte du programme vers CCS.&lt;br /&gt;
Que fait ce programme ? Lorsque le bouton poussoir est appuyé, il&amp;nbsp;allume&amp;nbsp;la LED rouge sinon, il allume la LED verte. Nous expliquerons les détails du code dans le post suivant.&lt;br /&gt;
&lt;br /&gt;
A présent compilons ce programme. Il faut faire Project-&amp;gt;Build Project&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC_uBfBXrCY7pmfjeIb63W8YLZvWYbZMn6s9MGusMDgIjGPhmuV9qWNQ6M-F0pWWt1oHzq2GSW8kWmkPzAXOe21cszKMVL8CP_bpWpkqDkmQMNmzg2y85R1DKRqJiCQsggpZf1yvO6kPpB/s1600/CCS12.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC_uBfBXrCY7pmfjeIb63W8YLZvWYbZMn6s9MGusMDgIjGPhmuV9qWNQ6M-F0pWWt1oHzq2GSW8kWmkPzAXOe21cszKMVL8CP_bpWpkqDkmQMNmzg2y85R1DKRqJiCQsggpZf1yvO6kPpB/s400/CCS12.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
En bas de votre fenêtre de code, il y a 2 onglets : &lt;br /&gt;
1) Console : cet onglet affiche ce qui se passe lors de votre compilation&lt;br /&gt;
2) Problems : cet onglet affiche les éventuelles erreurs ou les avertissements obtenus lors de la compilation.&lt;br /&gt;
&lt;br /&gt;
Si l&#39;onglet &quot;problems&quot; ne contient pas d&#39;erreurs, tout c&#39;est bien passé. Sinon, vérifiez votre code pour voir si il n&#39;y a pas d&#39;erreur de syntaxe, et corrigez les éventuelles erreurs.&lt;br /&gt;
&lt;br /&gt;
Maintenant, nous allons charger le programme vers le microcontrôleur. Pour cela, faites Target-&amp;gt;Debug Launch (vous pouvez aussi cliquer sur le petit insecte vert, c&#39;est pareil). Vous passez alors en mode &quot;Debug&quot; :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzl9fJJFTXaoT7LJOPlkYVtpsX1VeMh1s1HY_0Wr5rFEjHo3VLVByXCA19N2JPrkNaQFRzptv_ov8mUUzzYwuEOIpzZVEFh_dBPTRpxR1b6Uiw_zMA5rehiVwqaA4tI0O3vqowgS5WCdR0/s1600/CCS13.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzl9fJJFTXaoT7LJOPlkYVtpsX1VeMh1s1HY_0Wr5rFEjHo3VLVByXCA19N2JPrkNaQFRzptv_ov8mUUzzYwuEOIpzZVEFh_dBPTRpxR1b6Uiw_zMA5rehiVwqaA4tI0O3vqowgS5WCdR0/s400/CCS13.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Il ne vous reste plus qu&#39;à faire Target-&amp;gt;Run, et votre programme démarre sur le Launchpad.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Appuyez sur le bouton (P1.3) et vous verrez la LED rouge s&#39;allumer (cela prouve que le programme tourne). Quand vous&amp;nbsp;relâchez&amp;nbsp;le&amp;nbsp;bouton&amp;nbsp;la LED rouge s&#39;éteint et la LED verte se&amp;nbsp;rallume.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Voilà, vous avez&amp;nbsp;exécuté&amp;nbsp;votre premier programme sur le MSP430 du Launchpad.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Dans le prochain post, j&#39;expliquerai en détail ce programme, et je parlerai des ports d&#39;entrée-sortie du MSP430.&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://430mania.blogspot.com/feeds/2001719574774855746/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://430mania.blogspot.com/2011/11/premier-programme.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/2001719574774855746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/2001719574774855746'/><link rel='alternate' type='text/html' href='http://430mania.blogspot.com/2011/11/premier-programme.html' title='Premier programme'/><author><name>Eric</name><uri>http://www.blogger.com/profile/15386377255133398663</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYUT8rDWIHuNt6Ym9KIzUxf5PJnyrLx4N3lcwXXK8emmTdN4nkr-52y13ke9ZswoljN4_Hh1YLrj7OpaSfvHd2rctcFhpmmyhnV5o7Xgg9FX84OXyCnBAM45yIwl9xvupwRQvWvx_4ByQt/s72-c/CCS2.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4024029024828703140.post-9023750742381490593</id><published>2011-10-25T16:48:00.017+02:00</published><updated>2011-10-27T17:27:06.885+02:00</updated><title type='text'>Installation des environnements de développment C pour MSP430</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;En attendant la livraison de notre Launchpad MSP430,&amp;nbsp;intéressons-nous aux compilateurs C.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Le rôle du compilateur C est de transformer des fichiers codés en langages C vers un fichier binaire en code machine. Ce code machine est le langage de base du microcontrôleur.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;En réalité, c&#39;est un peu plus compliqué que cela, car un compilateur C génère du code assembleur (c&#39;est un langage de très bas niveau). Ensuite le code &quot;assembleur&quot; est transformé en code &quot;objet&quot;. Pour finir, les fichiers &quot;objets&quot; passent par le &quot;linker&quot; qui va les lier en un fichier binaire. C&#39;est ensuite ce fichier binaire que nous pourrons télécharger dans la mémoire programme (non volatile) du microcontrôleur.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Aujourd&#39;hui, le compilateur C et le linker sont souvent intégrés dans un environnement de développement (appelé aussi IDE en anglais).&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Pour le MSP430, les 2 principaux IDE du marché sont :&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- Code Composer Studio : c&#39;est l&#39;outil fourni par TEXAS INSTRUMENT. Il est basé sur l&#39;éditeur Eclipse pour ceux qui connaissent. La version gratuite de Code Composer permet de générer des fichiers binaires de taille maximale de 16 Koctets (ce qui est&amp;nbsp;suffisant&amp;nbsp;pour pas mal d&#39;applications&amp;nbsp;sympathiques).&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- IAR Embedded Workbench : cet IDE proposé par la société IAR offre de meilleures performances en terme de compilation (le code généré prend souvent moins de place dans la mémoire et est plus rapide en temps&amp;nbsp;d’exécution). La version gratuite de IAR permet de générer des fichiers binaires jusqu&#39;à 4 Koctets.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Passons à l&#39;installation de ces 2 IDE.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;u&gt;&lt;b&gt;&lt;i&gt;1) Installation de Code Composer Studio&lt;/i&gt;&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
Pour trouver cet IDE, allons sur le lien suivant :&lt;br /&gt;
&lt;a href=&quot;http://processors.wiki.ti.com/index.php/Download_CCS&quot;&gt;http://processors.wiki.ti.com/index.php/Download_CCS&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
En bas de la page, il y a un bouton pour télécharger la version gratuite (voir copie d&#39;écran ci-dessous) :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8dPryc0Cm2nNJH-latJwTV1DLrhDIA1wBq965AmweEJYoSwadfI85E7ffh7c-vZ9xT0sXPPkF1y5hnB_UjU-EEkc2hY-isnqOy6yhm8dWGhtqsffptWQ1XNkAwOfeAzaFR83xTmoPvq39/s1600/CodeComposerDownload.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;271&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8dPryc0Cm2nNJH-latJwTV1DLrhDIA1wBq965AmweEJYoSwadfI85E7ffh7c-vZ9xT0sXPPkF1y5hnB_UjU-EEkc2hY-isnqOy6yhm8dWGhtqsffptWQ1XNkAwOfeAzaFR83xTmoPvq39/s400/CodeComposerDownload.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
Ensuite TEXAS INSTRUMENT vous demandera de vous connecter avec votre compte TI (le même que vous avez créé pour commander le LaunchPad). Si vous n&#39;en possédez pas encore, vous pouvez en créer un.&lt;br /&gt;
Ensuite TI vous pose quelques question sur l&#39;usage que vous allez faire de leur produit. Il faut remplir un formulaire qui ressemble à ça :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl24sHQA5B7KfwBoC-u5BHLzvaRuTiwGrWhwyRLdaXmnFmBD8vV4XCnn0km7rYVuk2cyA5RhxXtnqzoJlnFcyXBYf9loV17f86AygkapyYyTEvjBWnighcVISW7KmFrOjeOYHmURhfqOMQ/s1600/TIapproval.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;338&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl24sHQA5B7KfwBoC-u5BHLzvaRuTiwGrWhwyRLdaXmnFmBD8vV4XCnn0km7rYVuk2cyA5RhxXtnqzoJlnFcyXBYf9loV17f86AygkapyYyTEvjBWnighcVISW7KmFrOjeOYHmURhfqOMQ/s400/TIapproval.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Pour certains champs que vous ne pouvez pas remplir faute d&#39;information, vous pouvez les compléter par la mention &quot;N/A&quot; (not applicaple).&lt;br /&gt;
Ensuite il faut cliquer sur le bouton &quot;Submit&quot; tout en bas de la page.&lt;br /&gt;
Une nouvelle page doit apparaître avec un bouton &quot;Download&quot;. Cliquez donc sur &quot;Download&quot; pour&amp;nbsp;démarrer&amp;nbsp;le téléchargement.&lt;br /&gt;
Cela peut prendre un peu de temps car le fichier d&#39;installation fait plus de 300 Moctets.&lt;br /&gt;
Voilà ! Il ne reste plus qu&#39;à décompresser le fichier (avec WinZip par exemple), et à lancer &quot;setup_CCS_MC_Core.exe&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;u&gt;&lt;b&gt;&lt;i&gt;2) Installation de IAR Embedded Workbench&lt;/i&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
Pour télécharger l&#39;IDE gratuit de IAR, il faut se rendre à l&#39;adresse suivante :&amp;nbsp;&lt;a href=&quot;http://supp.iar.com/Download/SW/?item=EW430-KS4&quot;&gt;http://supp.iar.com/Download/SW/?item=EW430-KS4&lt;/a&gt;&lt;br /&gt;
En bas de la page, il faut cliquer sur &quot;Continue&quot;.&lt;br /&gt;
Un formulaire apparaît alors. Il faut donner vos coordonnées puis répondre à quelques questions.&lt;br /&gt;
Ensuite, en bas de page, cliquez sur &quot;Submit Registration&quot;.&lt;br /&gt;
IAR vous envoie alors un email de contenant un lien de confirmation d&#39;inscription.&lt;br /&gt;
Sur ce lien, vous pouvez alors télécharger l&#39;IDE :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzcVwVHydPzOP31ao5OHaaGTJ4XsBWZet6TRTL3b4MR1l9wpfrLHGWzq5QSqvJmDy-dkYGg0fv8Pw3tCQwgzKssFoNPnPcS4J5bdIHWnndK2F-sCUzPulAVrvb6-JQexC9SLVpfox3VMFc/s1600/IARdownload.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzcVwVHydPzOP31ao5OHaaGTJ4XsBWZet6TRTL3b4MR1l9wpfrLHGWzq5QSqvJmDy-dkYGg0fv8Pw3tCQwgzKssFoNPnPcS4J5bdIHWnndK2F-sCUzPulAVrvb6-JQexC9SLVpfox3VMFc/s640/IARdownload.jpg&quot; width=&quot;481&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Cette page contient également un numéro de licence et une clef de licence que vous devrez copier/coller lors de l&#39;installation.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://430mania.blogspot.com/feeds/9023750742381490593/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://430mania.blogspot.com/2011/10/installation-des-environnement-de.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/9023750742381490593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/9023750742381490593'/><link rel='alternate' type='text/html' href='http://430mania.blogspot.com/2011/10/installation-des-environnement-de.html' title='Installation des environnements de développment C pour MSP430'/><author><name>Eric</name><uri>http://www.blogger.com/profile/15386377255133398663</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8dPryc0Cm2nNJH-latJwTV1DLrhDIA1wBq965AmweEJYoSwadfI85E7ffh7c-vZ9xT0sXPPkF1y5hnB_UjU-EEkc2hY-isnqOy6yhm8dWGhtqsffptWQ1XNkAwOfeAzaFR83xTmoPvq39/s72-c/CodeComposerDownload.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4024029024828703140.post-6762712399729758031</id><published>2011-10-24T15:27:00.003+02:00</published><updated>2011-10-25T11:42:53.492+02:00</updated><title type='text'>Allons-y ! Mise en place des outils de développement !</title><content type='html'>Bon ça y est, on va enfin commencer à créer son petit labo de développement.&lt;br /&gt;
&lt;br /&gt;
Pour cela nous aurons besoin d&#39;un kit de développement pour MSP430 le moins cher possible.&lt;br /&gt;
&lt;br /&gt;
Ca tombe bien, car Texas Instrument propose son MSP430 Launchpad pour moins de 4 euros !&lt;br /&gt;
A quoi sert le Launchpad ? Il permet de programmer et d&#39;émuler certains microcontrôleurs de la famille MSP430. Nous expliquerons plus tards ce que sont ces 2 opérations. En gros, le Launchpad permet&amp;nbsp;d’exécuter&amp;nbsp;et de tester des programmes.&lt;br /&gt;
&lt;br /&gt;
Voici une photo du Launchpad :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmk-SHlPLDfg7mzt1g1arRtdj6b8SoRMZ3J67_tFh4pxmCckJXGlNkxVCoYR5GbR2Pcpd5n_TtgPj0Qxi8n_FOgJvQUPfYC0nXX8a4yWptqc5PVz0i9gAsh9M4Je5afpiPYvSN5gPVehci/s1600/MSP-EXP30G2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmk-SHlPLDfg7mzt1g1arRtdj6b8SoRMZ3J67_tFh4pxmCckJXGlNkxVCoYR5GbR2Pcpd5n_TtgPj0Qxi8n_FOgJvQUPfYC0nXX8a4yWptqc5PVz0i9gAsh9M4Je5afpiPYvSN5gPVehci/s320/MSP-EXP30G2.jpg&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;On peur voir au centre le microcontrôleur posé sur son support. En bas, il y a 2 diodes luminescentes qu&#39;on peut utiliser pour afficher des informations. Il y a également 2 boutons poussoir pour&amp;nbsp;interagir&amp;nbsp;avec l&#39;utilisateur.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;En haut de la carte, il y a un port USB qui permet de programmer et de &quot;débugger&quot; le MSP430.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Enfin, à droite et à gauche des points de&amp;nbsp;connections&amp;nbsp;permettent de relier le MSP430 à d&#39;autres périphériques externes.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Le grands avantage du Launchpad est sont prix : $4.30 !&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;C&#39;est très facile de l&#39;acheter sur le site de TEXAS INSTRUMENT. En plus, les frais de port sont offerts !&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Pour l&#39;acheter, c&#39;est ici :&amp;nbsp;&lt;a href=&quot;https://estore.ti.com/MSP-EXP430G2-MSP430-LaunchPad-Value-Line-Development-kit-P2031.aspx&quot;&gt;https://estore.ti.com/MSP-EXP430G2-MSP430-LaunchPad-Value-Line-Development-kit-P2031.aspx&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6gadzvJwTF4nV3b_3-HctrkXM30VpUPUdQCDPkuOjaMCWJQL8EMm5AIiCNRDAXO5mRGKvpufM57aWcfwuTn3Fudq8pnu8yeJy5k5v1OHT5TQgT1iH9Y_dIVEL1VzwMC7RvHJnUSfz4Gq-/s1600/launchpad_buy.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6gadzvJwTF4nV3b_3-HctrkXM30VpUPUdQCDPkuOjaMCWJQL8EMm5AIiCNRDAXO5mRGKvpufM57aWcfwuTn3Fudq8pnu8yeJy5k5v1OHT5TQgT1iH9Y_dIVEL1VzwMC7RvHJnUSfz4Gq-/s320/launchpad_buy.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Il faut clicker sur &quot;Add to Cart&quot;, puis sur &quot;Checkout Now&quot;.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Ensuite, il faudra créer un compte TI si c&#39;est votre premier achat.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Il faut compter entre 48 et 72 heures pour la livraison.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;OK, c&#39;est bien beau me direz-vous. On a une carte électronique avec un MSP430, mais comment peut programmer l&#39;engin ?&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Eh bien pour celà, on a besoin d&#39;un &quot;compilateur&quot;. Un compilateur est un logiciel qui traduit un langage informatique en code machine compréhensible par le microcontrôleur.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Nous utiliserons un compilateur C, puisque nos programme seront écrit en langage C.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Et là, bonne surprise, il existe des compilateurs gratuits de très bonne qualité pour le MSP430 !&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Bref pour $4.30 (launchapd) + $0.0 (compilateur) nous avons un&amp;nbsp;environnement&amp;nbsp;de&amp;nbsp;développement&amp;nbsp;complet pour le MSP430.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Dans mon prochain post, je parlerai des compilateurs et je vous aiderai à installer le votre.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://430mania.blogspot.com/feeds/6762712399729758031/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://430mania.blogspot.com/2011/10/allons-y-mise-en-place-des-outils-de.html#comment-form' title='3 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/6762712399729758031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/6762712399729758031'/><link rel='alternate' type='text/html' href='http://430mania.blogspot.com/2011/10/allons-y-mise-en-place-des-outils-de.html' title='Allons-y ! Mise en place des outils de développement !'/><author><name>Eric</name><uri>http://www.blogger.com/profile/15386377255133398663</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmk-SHlPLDfg7mzt1g1arRtdj6b8SoRMZ3J67_tFh4pxmCckJXGlNkxVCoYR5GbR2Pcpd5n_TtgPj0Qxi8n_FOgJvQUPfYC0nXX8a4yWptqc5PVz0i9gAsh9M4Je5afpiPYvSN5gPVehci/s72-c/MSP-EXP30G2.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4024029024828703140.post-5824166542716322693</id><published>2011-10-24T08:05:00.002+02:00</published><updated>2011-10-24T15:18:45.565+02:00</updated><title type='text'>Premiers pas</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Mais au fait, c&#39;est quoi un microcontrôleur ?&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;C&#39;est très simple. Un microcontrôleur est une puce électronique qui intègre un microprocesseur, de la mémoire non volatile et des&amp;nbsp;périphériques d&#39;entrée-sortie.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Le microprocesseur peut effectuer de opérations, appelées aussi &quot;instructions&quot;. L&#39;ensemble des instructions forment un programme. Nous verrons par la suite comment écrire un programme.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Il y a 2 type de mémoires :&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- La mémoire volatile : lorsqu&#39;on coupe le courant, ses données sont perdues.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- La mémoire non volatile : ses données sont conservées même en l&#39;absence d&#39;alimentation électrique.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Un microcontrôleur possède ces 2 types de mémoire. Le microcontrôleur sur lequel nous allons travailler s&#39;appelle le MSP430. Il possède une mémoire RAM (volatile) et une mémoire FLASH (non volatile).&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Les périphériques d&#39;entrée-sortie permettent au microcontrôleur d&#39;interagir avec le monde physique. Les périphériques standards que l&#39;on retrouve sur le MSP430 sont :&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- des ports d&#39;entrée-sortie :&amp;nbsp;permettent&amp;nbsp;de commander une patte de la puce à un niveau logique (0 ou 3 volts par exemple),&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- des ports séries : permettent de communiquer avec d&#39;autres puces en leur envoyer des données,&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;- des timers : permettent de gérer des temporisations et des actions périodiques.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Il y a encore d&#39;autres périphériques. Nous les verrons au fur et à mesure.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Bon tout ça, c&#39;est des mots. Le mieux c&#39;est de passer à la pratique. Ce sera l&#39;objet de mon prochain post !&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://430mania.blogspot.com/feeds/5824166542716322693/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://430mania.blogspot.com/2011/10/premiers-pas.html#comment-form' title='0 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/5824166542716322693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/5824166542716322693'/><link rel='alternate' type='text/html' href='http://430mania.blogspot.com/2011/10/premiers-pas.html' title='Premiers pas'/><author><name>Eric</name><uri>http://www.blogger.com/profile/15386377255133398663</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4024029024828703140.post-3537220691017250881</id><published>2011-10-23T19:55:00.001+02:00</published><updated>2011-10-26T17:28:08.102+02:00</updated><title type='text'>Ca y est c&#39;est officiel. 430 mania vient d&#39;être créé !</title><content type='html'>Bonjour à tous et bienvenu sur mon blog.&lt;br /&gt;
Je m&#39;appelle Eric et je suis ingénieur en électronique.&lt;br /&gt;
Le but de mon blog est de présenter mes réalisations à base du microcontrôleur MSP430 de Texas Instrument. L&#39;objectif est de permettre à chacun de les refaire ou de les modifier pour s&#39;amuser et pour apprendre.&amp;nbsp;Je présenterai aussi des exemples de programmation embarquée en langage C.&lt;br /&gt;
En fait, c&#39;est un peu comme un blog sur la cuisine. Je publierai régulièrement des &quot;recettes&quot; d&#39;électronicien et vous pourez vous en inspirer. Evidemment ces &quot;recettes&quot; ne couterons jamais plus que quelques euros de composants.&lt;br /&gt;
Au programme ces prochaines semaines de l&#39;électronique ludique et un peu de robotique.&lt;br /&gt;
Alors à bientôt pour notre premier tutoriel ! &amp;nbsp;:)</content><link rel='replies' type='application/atom+xml' href='http://430mania.blogspot.com/feeds/3537220691017250881/comments/default' title='Publier les commentaires'/><link rel='replies' type='text/html' href='http://430mania.blogspot.com/2011/10/ca-y-est-cest-officiel-430-mania-vient.html#comment-form' title='1 commentaires'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/3537220691017250881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4024029024828703140/posts/default/3537220691017250881'/><link rel='alternate' type='text/html' href='http://430mania.blogspot.com/2011/10/ca-y-est-cest-officiel-430-mania-vient.html' title='Ca y est c&#39;est officiel. 430 mania vient d&#39;être créé !'/><author><name>Eric</name><uri>http://www.blogger.com/profile/15386377255133398663</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>