<?xml 
version="1.0" encoding="utf-8"?>
<rss version="2.0" 
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
>

<channel xml:lang="fr">
	<title>Le site de Steve</title>
	<link>http://s-muller.fr/SPIP/</link>
	<description>J'ai fait ce site pour partager mes diff&#195;&#169;rentes exp&#195;&#169;riences dans l'&#195;&#169;lectronique et les domaines connexes.</description>
	<language>fr</language>
	<generator>SPIP - www.spip.net</generator>




<item xml:lang="fr">
		<title>Configuration d'une imprimante multifonction DCP-9020CDW sous Gentoo GNU/Linux avec CUPS</title>
		<link>https://s-muller.fr/SPIP/spip.php?article19</link>
		<guid isPermaLink="true">https://s-muller.fr/SPIP/spip.php?article19</guid>
		<dc:date>2015-10-10T18:13:46Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Steve</dc:creator>



		<description>&lt;p&gt;Cette article d&#195;&#169;crit l'installation avec CUPS d'une imprimante multifonction Brother DCP-9020CDW sous Gentoo GNU/Linux.&lt;/p&gt;

-
&lt;a href="https://s-muller.fr/SPIP/spip.php?rubrique15" rel="directory"&gt;Administration syst&#195;&#168;me&lt;/a&gt;


		</description>


 <content:encoded>&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Pr&#195;&#169;-requis&lt;/h3&gt;
&lt;p&gt;Il faut que CUPS (net-print/cups) soit d&#195;&#169;j&#195; install&#195;&#169; ainsi que l'outil de gestion de paquets Red Hat (app-arch/rpm).&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Les fichiers pilote&lt;/h3&gt;
&lt;p&gt;Commen&#195;&#167;ons par t&#195;&#169;l&#195;&#169;charger les fichiers d'installation des pilotes suivants :&lt;br class='autobr' /&gt;
&lt;a href=&#034;http://www.brother.com/cgi-bin/agreement/agreement.cgi?dlfile=http://www.brother.com/pub/bsc/linux/dlf/dcp9020cdwlpr-1.1.2-1.i386.rpm&amp;lang=English_lpr&#034; class='spip_out' rel='external'&gt;Pilote LPR&lt;/a&gt;&lt;br class='autobr' /&gt;
&lt;a href=&#034;http://www.brother.com/cgi-bin/agreement/agreement.cgi?dlfile=http://www.brother.com/pub/bsc/linux/dlf/dcp9020cdwcupswrapper-1.1.2-1.i386.rpm&amp;lang=English_gpl&#034; class='spip_out' rel='external'&gt;Pilote encapsulation CUPS&lt;/a&gt;&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Installation des pilotes&lt;/h3&gt;
&lt;p&gt;Avant d'effectuer l'installation des deux paquets, il faut cr&#195;&#169;er le r&#195;&#169;pertoire /var/spool/lpd&lt;br class='autobr' /&gt;
&lt;code class='spip_code' dir='ltr'&gt;mkdir -p /var/spool/lpd&lt;/code&gt;&lt;br class='autobr' /&gt;
Puis l'installation des deux paquets peut-&#195;&#170;tre fait.&lt;/p&gt;
&lt;div style='text-align: left;' class='spip_code' dir='ltr'&gt;&lt;code&gt;rpm -ihv --nodeps dcp9020cdwlpr-1.1.2-1.i386.rpm&lt;br /&gt;
rpm -ihv --nodeps dcp9020cdwcupswrapper-1.1.2-1.i386.rpm&lt;/code&gt;&lt;/div&gt;&lt;h3 class=&#034;spip&#034;&gt;Le filtre&lt;/h3&gt;
&lt;p&gt;Il reste &#195; t&#195;&#169;l&#195;&#169;charger le filtre pour que CUPS puisse envoyer les donn&#195;&#169;es &#195; l'imprimante.&lt;/p&gt;
&lt;div style='text-align: left;' class='spip_code' dir='ltr'&gt;&lt;code&gt;wget -P /usr/libexec/cups/filter https://raw.githubusercontent.com/illwieckz/debian_copyist_brother/master/material/abstract/printers/generated_content/filter/brother_lpdwrapper_dcp9020cdw&lt;br /&gt;
chmod a+x /usr/libexec/cups/filter/brother_lpdwrapper_dcp9020cdw&lt;/code&gt;&lt;/div&gt;&lt;h3 class=&#034;spip&#034;&gt;Ajout de l'imprimante&lt;/h3&gt;
&lt;p&gt;Acc&#195;&#168;dons &#195; l'interface de CUPS (&lt;a href=&#034;http://127.0.0.1:631/&#034; class='spip_out' rel='external'&gt;http://127.0.0.1:631/&lt;/a&gt;).&lt;br class='autobr' /&gt;
&lt;span class='spip_document_30 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH228/cups_-_home-83b5c.png?1587815849' width='500' height='228' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
Choisissions le lien &lt;a href=&#034;http://127.0.0.1:631/admin&#034; class='spip_out' rel='external'&gt;Adding Printers and Classes&lt;/a&gt; dans la rubrique &lt;i&gt;CUPS for Administrators&lt;/i&gt;.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_29 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH228/cups_-_administration-4aa4b.png?1587815849' width='500' height='228' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
CUPS propose l'imprimante dans la rubrique &lt;i&gt;Discovered Network Printers&lt;/i&gt; que l'on s&#195;&#169;lectionne puis on clique sur &lt;i&gt;Continue&lt;/i&gt;.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_25 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH228/cups_-_add_printer-35f62.png?1587815849' width='500' height='228' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
Les options, par d&#195;&#169;faut, permettent d'utiliser l'imprimante et il suffit de cliquer sur &lt;i&gt;Continue&lt;/i&gt;.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_26 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH228/cups_-_add_printer_2-cb479.png?1587815849' width='500' height='228' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
Il faut s&#195;&#169;lectionner le mod&#195;&#168;le parmi la liste propos&#195;&#169;e et cliquer sur &lt;i&gt;Add Printer&lt;/i&gt;.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_27 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH228/cups_-_add_printer_3-c5fd6.png?1587815849' width='500' height='228' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
On clique sur &lt;i&gt;Query Printer for Default Options&lt;/i&gt; pour finaliser l'installation.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_28 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH228/cups_-_add_printer_4-6927e.png?1587815849' width='500' height='228' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Je me suis bas&#195;&#169; sur un article de Gentoo Wiki Archives&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb1' class='spip_note' rel='appendix' id='nh1'&gt;1&lt;/a&gt;]&lt;/span&gt; ainsi que des diff&#195;&#169;rents messages d'erreurs que j'ai rencontr&#195;&#169;.&lt;/p&gt;&lt;/div&gt;
		&lt;hr /&gt;
		&lt;div class='rss_notes'&gt;&lt;div id='nb1'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh1' class='spip_note' title='Notes 1' rev='appendix'&gt;1&lt;/a&gt;] &lt;/span&gt;&lt;a href=&#034;http://www.gentoo-wiki.info/HOWTO_Brother_Printer/Scanners&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;http://www.gentoo-wiki.info/HOWTO_Brother_Printer/Scanners&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>DynHost d'OVH avec une LiveBox Play d'Orange</title>
		<link>https://s-muller.fr/SPIP/spip.php?article17</link>
		<guid isPermaLink="true">https://s-muller.fr/SPIP/spip.php?article17</guid>
		<dc:date>2015-09-11T20:42:05Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Steve</dc:creator>



		<description>&lt;p&gt;Cette article d&#195;&#169;crit la mise en &#197;&#8220;uvre sur un CubieTruck.&lt;/p&gt;

-
&lt;a href="https://s-muller.fr/SPIP/spip.php?rubrique13" rel="directory"&gt;Domotique&lt;/a&gt;


		</description>


 <content:encoded>&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Je souhaitais rendre accessible un CubieTruck qui me sert pour Seafile (cloud priv&#195;&#169;) et pour une application de domotique. Mon choix s'est port&#195;&#169; sur OVH avec sa solution DynHost incluse dans l'offre Nom de domaine.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Configuration de DynHost&lt;/h3&gt;
&lt;p&gt;Il faut &#195;&#169;videmment se connecter &#195; son compte. On s&#195;&#169;lectionne ensuite le nom de domaine que l'on souhaite utiliser. Puis on choisit l'onglet &lt;i&gt;DynHost&lt;/i&gt;.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_18 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH256/page_1-07fc7.png?1587815849' width='500' height='256' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
L&#195; , sur la droite, on choisit &lt;i&gt;Ajouter un DynHost&lt;/i&gt;.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_19 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH256/page_2-a85d4.png?1587815849' width='500' height='256' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
Une bo&#195;&#174;te de dialogue appara&#195;&#174;t dans laquelle on indique le sous-domaine ainsi que l'adresse IP actuelle de sa Livebox Play.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_22 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH466/boite_dialogue_1-94e2f.png?1587815849' width='500' height='466' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
Maintenant, on va cr&#195;&#169;er un identifiant pour pouvoir mettre &#195; jour l'adresse IP de mani&#195;&#168;re automatique. Pour cela, on choisit &lt;i&gt;G&#195;&#169;rer les acc&#195;&#168;s&lt;/i&gt; sur la droite.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_20 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH256/page_3-d791c.png?1587815850' width='500' height='256' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
Toujours sur la droite, on s&#195;&#169;lectionne &lt;i&gt;Cr&#195;&#169;er un identifiant&lt;/i&gt;.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_21 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH256/page_4-b9fc5.png?1587815850' width='500' height='256' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
On saisit l'identifiant, le nom de sous-domaine ainsi que le mot de passe choisi.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_23 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH521/boite_dialogue_2-134b1.png?1587815850' width='500' height='521' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
C'est tout pour la partie DynHost. Un peu de patience est n&#195;&#169;cessaire avant que le sous-domaine soit accessible.&lt;br class='autobr' /&gt;
De plus, la page d'Adrin FURET&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb1' class='spip_note' rel='appendix' id='nh1'&gt;1&lt;/a&gt;]&lt;/span&gt; me f&#195; &#187;t d'un grand secours pour comprendre le service DynHost d'OVH.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Configuration de la Livebox Play&lt;/h3&gt;
&lt;p&gt;Ici, il faut aller dans la &lt;i&gt;configuration avanc&#195;&#169;e&lt;/i&gt; puis choisir &lt;i&gt;configuration r&#195;&#169;seau&lt;/i&gt; sur la gauche. Moi, j'ai choisi de diriger tous les flux vers mon pare-feu avec la fonction &lt;i&gt;DMZ&lt;/i&gt; de la Livebox Play.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_24 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH395/livebox_play-94408.png?1587815850' width='500' height='395' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;br class='autobr' /&gt;
Je n'ai rien fait de plus pour ce point-l&#195; .&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Le script de mise &#195; jour&lt;/h3&gt;
&lt;p&gt;Ce script est fortement inspir&#195;&#169; par celui de Zwindler&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb2' class='spip_note' rel='appendix' id='nh2'&gt;2&lt;/a&gt;]&lt;/span&gt;. J'y ai corrig&#195;&#169; quelques bourdes et, surtout, remplacer l'appel &#195; des services de type &#194;&#171; &lt;a href=&#034;http://ifconfig.me/ip&#194; &#187;&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;http://ifconfig.me/ip&#194;&#187;&lt;/a&gt; et &#194;&#171; &lt;a href=&#034;http://checkip.dyndns.com/&#194; &#187;&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;http://checkip.dyndns.com/&#194;&#187;&lt;/a&gt; par l'appel &#195; un json via curl&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb3' class='spip_note' rel='appendix' id='nh3'&gt;3&lt;/a&gt;]&lt;/span&gt;.&lt;br class='autobr' /&gt;
Il comporte aussi une condition qui limite la taille du fichier de consignation.&lt;br class='autobr' /&gt;
Je vous livre le r&#195;&#169;sultat ci-dessous :&lt;/p&gt;
&lt;div style='text-align: left;' class='spip_code' dir='ltr'&gt;&lt;code&gt;#! /bin/bash&lt;br /&gt;
# Mainly inspired by DynHost script given by OVH&lt;br /&gt;
# New version by zwindler (zwindler.fr/wordpress)&lt;br /&gt;
# Newer version stores the return code in the logfile (smuller@s-muller.fr)&lt;br /&gt;
#&lt;br /&gt;
# Initial version was doing nasty grep/cut on local ppp0 interface&lt;br /&gt;
#&lt;br /&gt;
# This coulnd't work in a NATed environnement like on ISP boxes&lt;br /&gt;
# on private networks.&lt;br /&gt;
#&lt;br /&gt;
# Also got rid of ipcheck.py thanks to mafiaman42&lt;br /&gt;
#&lt;br /&gt;
# This script uses curl to get the public IP, and then uses wget&lt;br /&gt;
# to update DynHost entry in OVH DNS&lt;br /&gt;
#&lt;br /&gt;
# Logfile: dynhost.log&lt;br /&gt;
#&lt;br /&gt;
# CHANGE: &#034;HOST&#034;, &#034;LOGIN&#034; and &#034;PASSWORD&#034; to reflect YOUR account variables&lt;br /&gt;
&lt;br /&gt;
HOST=&#034;sous-domaine&#034;&lt;br /&gt;
LOGIN=&#034;identifiant&#034;&lt;br /&gt;
PASSWORD=&#034;mot de passe&#034;&lt;br /&gt;
LOG_PATH=&#034;chemin pour le stockage des fichiers de journalisation&#034;&lt;br /&gt;
LIVEBOX=&#034;adresse IP de la Livebox Play&#034;&lt;br /&gt;
&lt;br /&gt;
echo ---------------------------------- &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt;
echo `date` &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt;
echo 'DynHost' &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt;
&lt;br /&gt;
TMPFILE=`tempfile`&lt;br /&gt;
&lt;br /&gt;
IP=`curl -s -X POST -H &#034;Content-Type: application/json&#034; -d '{&#034;parameters&#034;:{}}' http://$LIVEBOX/sysbus/NMC:getWANStatus | sed -e 's/.*&#034;IPAddress&#034;:&#034;\(.*\)&#034;,&#034;Remo.*/\1/g'`&lt;br /&gt;
IPv6=`curl -s -X POST -H &#034;Content-Type: application/json&#034; -d '{&#034;parameters&#034;:{}}' http://$LIVEBOX/sysbus/NMC:getWANStatus | sed -e 's/.*&#034;IPv6Address&#034;:&#034;\(.*\)&#034;,&#034;IPv6D.*/\1/g'`&lt;br /&gt;
OLDIP=`dig +short @$LIVEBOX $HOST`&lt;br /&gt;
&lt;br /&gt;
if [ $IP ]; then&lt;br /&gt; if [ $OLDIP != $IP ]; then&lt;br /&gt; echo -n 'Old IP: ' &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt; echo $OLDIP &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt; echo -n 'New IP: ' &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt; echo $IP &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt; echo 'Try to update!' &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt; wget -q -O $TMPFILE &#034;http://www.ovh.com/nic/update?system=dyndns&amp;hostname=$HOST&amp;myip=$IP&#034; --user=&#034;$LOGIN&#034; --password=&#034;$PASSWORD&#034; &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt; RESULT=`cat $TMPFILE`&lt;br /&gt; echo &#034;Result: $RESULT&#034; &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt; if [[ $RESULT =~ ^(good|nochg).* ]]; then&lt;br /&gt; echo ---------------------------------- &gt;&gt; $LOG_PATH/dynhost-changes.log&lt;br /&gt; echo `date` &gt;&gt; $LOG_PATH/dynhost-changes.log&lt;br /&gt; echo &#034;New IP : $IP&#034; &gt;&gt; $LOG_PATH/dynhost-changes.log&lt;br /&gt; fi&lt;br /&gt; rm $TMPFILE&lt;br /&gt; else&lt;br /&gt; echo &#034;IP $HOST $OLDIP is identical to WAN $IP! No update required.&#034; &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt; fi&lt;br /&gt;
else&lt;br /&gt; echo 'WAN IP not found. Exiting!' &gt;&gt; $LOG_PATH/dynhost.log&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Some implementations of 'wc' use tabulation as separator others use space.&lt;br /&gt;
NB_LINES=`wc -l $LOG_PATH/dynhost.log | cut -d&#034; &#034; -f1 | cut -f1`&lt;br /&gt;
if [ &#034;$NB_LINES&#034; -gt &#034;200&#034; ]; then&lt;br /&gt; tail -n100 $LOG_PATH/dynhost.log &gt;&gt; $TMPFILE&lt;br /&gt; mv $TMPFILE $LOG_PATH/dynhost.log&lt;br /&gt;
fi&lt;/code&gt;&lt;/div&gt;&lt;h3 class=&#034;spip&#034;&gt;crontab&lt;/h3&gt;
&lt;p&gt;J'ai simplement rajout&#195;&#169; la ligne ci-dessous au fichier &lt;i&gt;/etc/crontab&lt;/i&gt; afin de v&#195;&#169;rifier le changement d'adresse IP toutes les 5 minutes :&lt;/p&gt;
&lt;p&gt;&lt;code class='spip_code' dir='ltr'&gt; */5 * * * * root /chemin vers le script executable/dynhost&lt;/code&gt;&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;La mise en &#197;&#8220;uvre n'est pas bien compliqu&#195;&#169; mais la recherche de tous les &#195;&#169;l&#195;&#169;ments a &#195;&#169;t&#195;&#169; chronophage d'o&#195;&#185; cette synth&#195;&#168;se qui, je l'esp&#195;&#168;re, profitera au plus grand nombre. J'allais oublier, j'ai trouv&#195;&#169; les codes de retour du moteur DynDNS sur le site de Matthias PIERSCHEL&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb4' class='spip_note' rel='appendix' id='nh4'&gt;4&lt;/a&gt;]&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;
		&lt;hr /&gt;
		&lt;div class='rss_notes'&gt;&lt;div id='nb1'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh1' class='spip_note' title='Notes 1' rev='appendix'&gt;1&lt;/a&gt;] &lt;/span&gt;&lt;a href=&#034;http://adrienfuret.fr/2015/05/nas-synology-ddns-ovh/&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;http://adrienfuret.fr/2015/05/nas-synology-ddns-ovh/&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div id='nb2'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh2' class='spip_note' title='Notes 2' rev='appendix'&gt;2&lt;/a&gt;] &lt;/span&gt;&lt;a href=&#034;http://zwindler.fr/wordpress/2014/09/22/mise-a-jour-de-votre-dns-chez-ovh-avec-dynhost/&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;http://zwindler.fr/wordpress/2014/09/22/mise-a-jour-de-votre-dns-chez-ovh-avec-dynhost/&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div id='nb3'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh3' class='spip_note' title='Notes 3' rev='appendix'&gt;3&lt;/a&gt;] &lt;/span&gt;&lt;a href=&#034;http://communaute.orange.fr/t5/ma-connexion/Recup%C3%A9ration-de-l-IP-WAN-d-une-Livebox-Play-noire/td-p/226035&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;http://communaute.orange.fr/t5/ma-connexion/Recup%C3%A9ration-de-l-IP-WAN-d-une-Livebox-Play-noire/td-p/226035&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div id='nb4'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh4' class='spip_note' title='Notes 4' rev='appendix'&gt;4&lt;/a&gt;] &lt;/span&gt;&lt;a href=&#034;https://www.pierschel.com/en/software-blog/11-user-manuals/33-dyndny-returncodes-en?hitcount=0&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;https://www.pierschel.com/en/software-blog/11-user-manuals/33-dyndny-returncodes-en?hitcount=0&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>Filtre num&#195;&#169;rique du 1er ordre</title>
		<link>https://s-muller.fr/SPIP/spip.php?article10</link>
		<guid isPermaLink="true">https://s-muller.fr/SPIP/spip.php?article10</guid>
		<dc:date>2010-06-19T07:21:45Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Steve</dc:creator>



		<description>&lt;p&gt;Cette article contient la description VHDL d'un filtre num&#195;&#169;rique du premier ordre.&lt;/p&gt;

-
&lt;a href="https://s-muller.fr/SPIP/spip.php?rubrique6" rel="directory"&gt;FPGA&lt;/a&gt;


		</description>


 <content:encoded>&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;La description qui suit permet de filtrer des &#195;&#169;chantillons en temps r&#195;&#169;el. Le filtre est impl&#195;&#169;ment&#195;&#169; sous sa forme dit directe.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;La synth&#195;&#168;se du filtre (transform&#195;&#169;e bilin&#195;&#169;aire)&lt;/h3&gt;
&lt;p&gt;Commen&#195;&#167;ons par un peu de th&#195;&#169;orie afin de transformer un filtre continu vers un filtre discret.&lt;/p&gt;
&lt;p&gt;La forme g&#195;&#169;n&#195;&#169;rale du filtre dans le domaine de Laplace est :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L128xH45/4dac5c4cf4f8265997b2570b8b2ecad5-514d4.png?1621198535' style='vertical-align:middle;' width='128' height='45' alt=&#034; H(s) = \frac{a \cdot \omega_{0} + b \cdot s}{c \cdot \omega_{0} + d \cdot s} &#034; title=&#034; H(s) = \frac{a \cdot \omega_{0} + b \cdot s}{c \cdot \omega_{0} + d \cdot s} &#034; /&gt;&lt;/p&gt;
&lt;p&gt;En substituant &lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH10/03c7c0ace395d80182db07ae2c30f034-99007.png?1587815854' style='vertical-align:middle;' width='8' height='10' alt=&#034;s&#034; title=&#034;s&#034; /&gt; par &lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L80xH36/83b5b4e9956e3e5d98372141487f287c-d5651.png?1621198535' style='vertical-align:middle;' width='80' height='36' alt=&#034;\frac{2}{T_{e}} \cdot \frac{1-z^{-1}}{1 +z^{-1}}&#034; title=&#034;\frac{2}{T_{e}} \cdot \frac{1-z^{-1}}{1 +z^{-1}}&#034; /&gt; dans &lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L48xH23/f68021749ff69bf0b89869d4358ea300-47440.png?1587815854' style='vertical-align:middle;' width='48' height='23' alt=&#034;H(s)&#034; title=&#034;H(s)&#034; /&gt;, on obtient :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L248xH45/38dd81c86ff2ff15adb0454ee27de563-a2130.png?1621198535' style='vertical-align:middle;' width='248' height='45' alt=&#034; H(z) = {\frac{a \cdot \omega_{0} + b \cdot s}{c \cdot \omega_{0} + d \cdot s}}| s = \frac{2}{T_{e}} \cdot \frac{1-z^{-1}}{1+z^{-1}}&#034; title=&#034; H(z) = {\frac{a \cdot \omega_{0} + b \cdot s}{c \cdot \omega_{0} + d \cdot s}}| s = \frac{2}{T_{e}} \cdot \frac{1-z^{-1}}{1+z^{-1}}&#034; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L192xH67/d7f3fffdd0fd729797785ecd33babd02-d8e35.png?1621198535' style='vertical-align:middle;' width='192' height='67' alt=&#034; H(z) = {\frac{a \cdot \omega_{0} + b \cdot \frac{2}{T_{e}} \cdot \frac{1-z^{-1}}{1+z^{-1}}}{c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}} \cdot \frac{1-z^{-1}}{1+z^{-1}}}}&#034; title=&#034; H(z) = {\frac{a \cdot \omega_{0} + b \cdot \frac{2}{T_{e}} \cdot \frac{1-z^{-1}}{1+z^{-1}}}{c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}} \cdot \frac{1-z^{-1}}{1+z^{-1}}}}&#034; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L264xH65/88c9108859a95caf1a584f4e9165f76e-e11db.png?1587815855' style='vertical-align:middle;' width='264' height='65' alt=&#034; H(z) = {\frac{a \cdot \omega_{0} \cdot (1+z^{-1}) + b \cdot \frac{2}{T_{e}} \cdot (1-z^{-1})}{c \cdot \omega_{0} \cdot (1+z^{-1}) + d \cdot \frac{2}{T_{e}} \cdot (1-z^{-1})}}&#034; title=&#034; H(z) = {\frac{a \cdot \omega_{0} \cdot (1+z^{-1}) + b \cdot \frac{2}{T_{e}} \cdot (1-z^{-1})}{c \cdot \omega_{0} \cdot (1+z^{-1}) + d \cdot \frac{2}{T_{e}} \cdot (1-z^{-1})}}&#034; /&gt;&lt;/p&gt;
&lt;p&gt;On obtient :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L280xH65/c4d585cf8251b0d312e484d86adb283e-5db3a.png?1587815855' style='vertical-align:middle;' width='280' height='65' alt=&#034; H(z) = \frac{(a \cdot \omega_{0} + b \cdot \frac{2}{T_{e}}) + (a \cdot \omega_{0} - b \cdot \frac{2}{T_{e}})\cdot z^{-1}} {(c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}) + (c \cdot \omega_{0} - d \cdot \frac{2}{T_{e}})\cdot z^{-1}}&#034; title=&#034; H(z) = \frac{(a \cdot \omega_{0} + b \cdot \frac{2}{T_{e}}) + (a \cdot \omega_{0} - b \cdot \frac{2}{T_{e}})\cdot z^{-1}} {(c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}) + (c \cdot \omega_{0} - d \cdot \frac{2}{T_{e}})\cdot z^{-1}}&#034; /&gt;&lt;/p&gt;
&lt;p&gt;Posons &lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L112xH43/18f21f1dd1a650070aa223b0c711b110-32af0.png?1587815855' style='vertical-align:middle;' width='112' height='43' alt=&#034;H(z) = \frac{S(z)}{E(z)}&#034; title=&#034;H(z) = \frac{S(z)}{E(z)}&#034; /&gt; :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH25/9c3c231becd9a02594c9574485f97594-4602d.png?1587815855' style='vertical-align:middle;' width='500' height='25' alt=&#034;S(z) \cdot [(c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}) + (c \cdot \omega_{0} - d \cdot \frac{2}{T_{e}})\cdot z^{-1}] = E(z) \cdot [(a \cdot \omega_{0} + b \cdot \frac{2}{T_{e}}) + (a \cdot \omega_{0} - b \cdot \frac{2}{T_{e}})\cdot z^{-1}]&#034; title=&#034;S(z) \cdot [(c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}) + (c \cdot \omega_{0} - d \cdot \frac{2}{T_{e}})\cdot z^{-1}] = E(z) \cdot [(a \cdot \omega_{0} + b \cdot \frac{2}{T_{e}}) + (a \cdot \omega_{0} - b \cdot \frac{2}{T_{e}})\cdot z^{-1}]&#034; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L500xH25/bf84acff207e2fa23f5f79d14b78eba2-11224.png?1587815855' style='vertical-align:middle;' width='500' height='25' alt=&#034;s[k] \cdot (c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}) + s[k-1] \cdot (c \cdot \omega_{0} - d \cdot \frac{2}{T_{e}}) = e[k] \cdot (a \cdot \omega_{0} + b \cdot \frac{2}{T_{e}}) + e[k-1] \cdot (a \cdot \omega_{0} - b \cdot \frac{2}{T_{e}})&#034; title=&#034;s[k] \cdot (c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}) + s[k-1] \cdot (c \cdot \omega_{0} - d \cdot \frac{2}{T_{e}}) = e[k] \cdot (a \cdot \omega_{0} + b \cdot \frac{2}{T_{e}}) + e[k-1] \cdot (a \cdot \omega_{0} - b \cdot \frac{2}{T_{e}})&#034; /&gt;&lt;/p&gt;
&lt;p&gt;On obtient l'&#195;&#169;quation aux diff&#195;&#169;rences :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L480xH65/3e545dbbf704593893832c4e7dfbf937-93c14.png?1587815855' style='vertical-align:middle;' width='480' height='65' alt=&#034;s[k] = e[k] \cdot \frac{a \cdot \omega_{0} + b \cdot \frac{2}{T_{e}}}{c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}} + e[k-1] \cdot \frac{a \cdot \omega_{0} - b \cdot \frac{2}{T_{e}}}{c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}} - s[k-1] \cdot \frac{c \cdot \omega_{0} - d \cdot \frac{2}{T_{e}}}{c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}}&#034; title=&#034;s[k] = e[k] \cdot \frac{a \cdot \omega_{0} + b \cdot \frac{2}{T_{e}}}{c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}} + e[k-1] \cdot \frac{a \cdot \omega_{0} - b \cdot \frac{2}{T_{e}}}{c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}} - s[k-1] \cdot \frac{c \cdot \omega_{0} - d \cdot \frac{2}{T_{e}}}{c \cdot \omega_{0} + d \cdot \frac{2}{T_{e}}}&#034; /&gt;&lt;/p&gt;
&lt;p&gt;Et finalement, l'&#195;&#169;quation aux diff&#195;&#169;rences qui sera impl&#195;&#169;ment&#195;&#169;e dans la description VHDL :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L304xH23/157e2f8227b4f12fb2d801a83c971f8a-ddfc4.png?1587815855' style='vertical-align:middle;' width='304' height='23' alt=&#034;s[k] = \alpha \cdot e[k] + \beta \cdot e[k-1] - \gamma \cdot s[k-1]&#034; title=&#034;s[k] = \alpha \cdot e[k] + \beta \cdot e[k-1] - \gamma \cdot s[k-1]&#034; /&gt;&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;La description&lt;/h3&gt;
&lt;p&gt;L'impl&#195;&#169;mentation se base sur trois multiplieur s&#195;&#169;rie et un additionneur s&#195;&#169;rie.&lt;br class='autobr' /&gt;
La description se d&#195;&#169;compose en quatre parties :
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; le multiplieur s&#195;&#169;rie,
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; l'additionneur s&#195;&#169;rie,
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; le registre &#195; d&#195;&#169;calage de sortie et
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; le s&#195;&#169;quenceur.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Le multiplieur s&#195;&#169;rie&lt;/h3&gt;
&lt;p&gt;Le multiplieur est sous une forme s&#195;&#169;quenc&#195;&#169;e qui n&#195;&#169;cessite 37 coups d'horloge afin de produire le r&#195;&#169;sultat. Le signal 'start' d&#195;&#169;marre le processus de multiplication. Le bus 'selector' provient d'un compteur (qui est mutualis&#195;&#169; par plusieurs instances du multiplieur) et fournit un auxiliaire dans l'op&#195;&#169;ration de multiplication. 'a' et 'b' sont respectivement le multiplicande et le multiplicateur. Le produit se pr&#195;&#169;sente sous la forme d'un flux s&#195;&#169;rie, id&#195;&#169;al pour alimenter un additionneur s&#195;&#169;rie.&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='87' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity serialMultiplier is port ( clr : in std_logic; clk : in std_logic; start : in std_logic; a : in std_logic_vector(17 downto 0); b : in std_logic_vector(17 downto 0); selector : in std_logic_vector(5 downto 0); complete : out std_logic; r : out std_logic); end serialMultiplier; architecture Behavioral of serialMultiplier is signal internal : std_logic_vector(17 downto 0); signal intermediary : std_logic_vector(18 downto 0); signal bitResult : std_logic_vector(17 downto 0); signal multiplier : std_logic; begin process (clr, clk) begin if (clr = '1') then internal &lt;= (others =&gt; '0'); complete &lt;= '0'; r &lt;= '0'; elsif (rising_edge(clk)) then if (start = '0') then internal &lt;= (others =&gt; '0'); complete &lt;= '0'; r &lt;= '0'; elsif ((selector /= &#034;100100&#034;) and (selector /= &#034;100101&#034;))then internal &lt;= intermediary(18 downto 1); r &lt;= intermediary(0); elsif (selector = &#034;100100&#034;) then r &lt;= intermediary(0); complete &lt;= '1'; end if; end if; end process; bitResult &lt;= a when (multiplier = '1') else (others =&gt; '0'); multiplier &lt;= b(0) when (selector = &#034;000000&#034;) else b(1) when (selector = &#034;000001&#034;) else b(2) when (selector = &#034;000010&#034;) else b(3) when (selector = &#034;000011&#034;) else b(4) when (selector = &#034;000100&#034;) else b(5) when (selector = &#034;000101&#034;) else b(6) when (selector = &#034;000110&#034;) else b(7) when (selector = &#034;000111&#034;) else b(8) when (selector = &#034;001000&#034;) else b(9) when (selector = &#034;001001&#034;) else b(10) when (selector = &#034;001010&#034;) else b(11) when (selector = &#034;001011&#034;) else b(12) when (selector = &#034;001100&#034;) else b(13) when (selector = &#034;001101&#034;) else b(14) when (selector = &#034;001110&#034;) else b(15) when (selector = &#034;001111&#034;) else b(16) when (selector = &#034;010000&#034;) else b(17) when (selector = &#034;010001&#034;) else '0'; intermediary &lt;= ('0' &amp; internal) + ('0' &amp; bitResult); end Behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;L'additionneur s&#195;&#169;rie&lt;/h3&gt;
&lt;p&gt;L'additionneur s&#195;&#169;rie pr&#195;&#169;sent&#195;&#169; ici est bas&#195;&#169; sur un additionneur complet avec une r&#195;&#169;troaction des retenues. Il additionne trois termes correspondant aux produits des multiplieurs d&#195;&#169;crits ci-dessus. La somme se pr&#195;&#169;sente sous un flux s&#195;&#169;rie.&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='46' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity serialAdder is port ( clr : in STD_LOGIC; clk : in STD_LOGIC; sclr : in STD_LOGIC; ce : in STD_LOGIC; a : in STD_LOGIC; b : in STD_LOGIC; c : in STD_LOGIC; r : out STD_LOGIC); end serialAdder; architecture Behavioral of serialAdder is signal ea : std_logic_vector(2 downto 0); signal eb : std_logic_vector(2 downto 0); signal ec : std_logic_vector(2 downto 0); signal eci : std_logic_vector(2 downto 0); signal ci : std_logic_vector(1 downto 0); signal co : std_logic_vector(1 downto 0); signal temp : std_logic_vector(2 downto 0); begin ea &lt;= &#034;00&#034; &amp; a; eb &lt;= &#034;00&#034; &amp; b; ec &lt;= &#034;00&#034; &amp; c; eci &lt;= &#034;0&#034; &amp; ci; temp &lt;= ea + eb + ec + eci; r &lt;= temp(0); co &lt;= temp(2 downto 1); process (clr, clk) begin if (clr = '1') then ci &lt;= (others =&gt; '0'); elsif (rising_edge(clk)) then if (sclr = '1') then ci &lt;= (others =&gt; '0'); elsif (ce = '1') then ci &lt;= co; end if; end if; end process; end Behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;Le registre &#195; d&#195;&#169;calage de sortie&lt;/h3&gt;
&lt;textarea readonly='readonly' cols='40' rows='29' class='spip_cadre' dir='ltr'&gt;library ieee; use ieee.std_logic_1164.all; entity outputShifter is port ( clr : in std_logic; clk : in std_logic; shift : in std_logic; indata : in std_logic; outdata : out std_logic_vector(19 downto 0)); end outputShifter; architecture behavioral of outputShifter is signal internal : std_logic_vector(outdata'range); begin process (clr, clk) begin if (clr = '1') then internal &lt;= (others =&gt; '0'); elsif (rising_edge(clk)) then if (shift = '1') then internal &lt;= indata &amp; internal(19 downto 1); end if; end if; end process; outdata &lt;= internal; end behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;Le s&#195;&#169;quenceur du filtre&lt;/h3&gt;&lt;h3 class=&#034;spip&#034;&gt;Le filtre&lt;/h3&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>Round-robin pour FPGA</title>
		<link>https://s-muller.fr/SPIP/spip.php?article9</link>
		<guid isPermaLink="true">https://s-muller.fr/SPIP/spip.php?article9</guid>
		<dc:date>2009-11-22T17:07:00Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Steve</dc:creator>



		<description>&lt;p&gt;Cette article contient la description VHDL d'un ordonnanceur de type Round-robin.&lt;/p&gt;

-
&lt;a href="https://s-muller.fr/SPIP/spip.php?rubrique6" rel="directory"&gt;FPGA&lt;/a&gt;


		</description>


 <content:encoded>&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;La description qui suit permet de partager une ressource entre plusieurs processus dans une FPGA. Elle est bas&#195;&#169;e sur deux d&#195;&#169;caleurs &#195; barillet et une pseudo-bascule RSC par processus.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;La description&lt;/h3&gt;
&lt;p&gt;La description est param&#195;&#169;trable en nombre d'entr&#195;&#169;es donc de processus.&lt;/p&gt;
&lt;p&gt;Le premier d&#195;&#169;caleur permet la r&#195;&#169;organisation des candidats &#195; l'acc&#195;&#168;s de la ressource partag&#195;&#169;e en fonction du pr&#195;&#169;c&#195;&#169;dent &#195;&#169;lu. D&#195;&#168;s que le pr&#195;&#169;c&#195;&#169;dent &#195;&#169;lu lib&#195;&#168;re la ressource, elle sera affect&#195;&#169;e au prochain candidat. Cela permet d'&#195;&#169;viter une appropriation par un seul des candidats.&lt;/p&gt;
&lt;p&gt;Le second d&#195;&#169;caleur effectue l'op&#195;&#169;ration inverse du premier afin que chaque allocation soit &#195; associer &#195; la bonne requ&#195;&#170;te.&lt;/p&gt;
&lt;p&gt;La bascule RSC m&#195;&#169;morise le processus &#195;&#169;lu. Lorsque le processus n'a plus besoin d'acc&#195;&#169;der &#195; la ressource, il remet la cellule RSC &#195; z&#195;&#169;ro afin de permettre &#195; un autre processus d'avoir l'acc&#195;&#168;s &#195; la ressource.&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='84' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity round_robin is generic ( width : integer := 4); port ( clr : in std_logic; clk : in std_logic; req : in std_logic_vector(width - 1 downto 0); ack : in std_logic_vector(width - 1 downto 0); grant : out std_logic_vector(width - 1 downto 0)); end round_robin; architecture Behavioral of round_robin is signal choice : std_logic_vector(req'range); signal mask : std_logic_vector(req'range); signal decision : std_logic_vector(req'range); signal internal : std_logic_vector(req'range); constant zero : std_logic_vector(req'range) := (others =&gt; '0'); signal entrance : std_logic_vector(req'range); signal elected : std_logic_vector(req'range); signal req_doubled : std_logic_vector(2 * width - 2 downto 0); signal decision_doubled : std_logic_vector(2 * width - 1 downto 1); begin req_doubled &lt;= req(width - 2 downto 0) &amp; req; choice &lt;= entrance - 1; mask &lt;= not(entrance); decision &lt;= choice or mask; decision_doubled &lt;= decision &amp; decision(width - 1 downto 1); process (clr, clk) begin if (clr = '1') then internal &lt;= (others =&gt; '0'); elsif (rising_edge(clk)) then if (internal = zero) then internal &lt;= not(elected); elsif (internal = ack) then internal &lt;= not(elected); end if; end if; end process; process (internal, req_doubled) variable temp : std_logic_vector(req'range); begin temp := req_doubled(width - 1 downto 0); for index in internal'range loop if (internal(index) = '1') then temp := req_doubled(width + index - 1 downto index); end if; end loop; entrance &lt;= temp; end process; process (internal, decision_doubled) variable temp : std_logic_vector(req'range); begin temp := decision_doubled(2 * width - 1 downto width); for index in internal'range loop if (internal(index) = '1') then temp := decision_doubled(2 * width - index - 1 downto width - index); end if; end loop; elected &lt;= temp; end process; grant &lt;= internal; end Behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;Remarque&lt;/h3&gt;
&lt;p&gt;L'ordonnanceur tel qu'il est d&#195;&#169;crit permet d'effectuer une d&#195;&#169;cision par coup d'horloge. Par exemple, un processus est pr&#195;&#170;t &#195; rendre la main, au prochain coup d'horloge un autre processus est autoris&#195;&#169; &#195; acc&#195;&#169;der &#195; la ressource.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;J'ai synth&#195;&#169;tis&#195;&#169; la description sous plusieurs outils et pour plusieurs cibles.&lt;/p&gt;
&lt;table class=&#034;spip&#034;&gt;
&lt;thead&gt;&lt;tr class='row_first'&gt;&lt;th id='id28e1_c0'&gt; Nombre d'entr&#195;&#169;es &lt;/th&gt;&lt;th id='id28e1_c1'&gt; Outil de synth&#195;&#168;se &lt;/th&gt;&lt;th id='id28e1_c2'&gt; Cible &lt;/th&gt;&lt;th id='id28e1_c3'&gt; P&#195;&#169;riode minimum &lt;/th&gt;&lt;th id='id28e1_c4'&gt; Niveau logique &lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td class='numeric ' headers='id28e1_c0'&gt;4&lt;/td&gt;
&lt;td headers='id28e1_c1'&gt;ISE 11.3&lt;/td&gt;
&lt;td headers='id28e1_c2'&gt;XC3S400-5PQ208&lt;/td&gt;
&lt;td headers='id28e1_c3'&gt;6,213 ns&lt;/td&gt;
&lt;td headers='id28e1_c4'&gt;4&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td class='numeric ' headers='id28e1_c0'&gt;8&lt;/td&gt;
&lt;td headers='id28e1_c1'&gt;ISE 11.3&lt;/td&gt;
&lt;td headers='id28e1_c2'&gt;XC3S400-5PQ208&lt;/td&gt;
&lt;td headers='id28e1_c3'&gt;9,887 ns&lt;/td&gt;
&lt;td headers='id28e1_c4'&gt;7&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td class='numeric ' headers='id28e1_c0'&gt;4&lt;/td&gt;
&lt;td headers='id28e1_c1'&gt;Quartus 9.0sp2&lt;/td&gt;
&lt;td headers='id28e1_c2'&gt;EP3C40Q240C8&lt;/td&gt;
&lt;td headers='id28e1_c3'&gt;5,017 ns&lt;/td&gt;
&lt;td headers='id28e1_c4'&gt; ?&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td class='numeric ' headers='id28e1_c0'&gt;8&lt;/td&gt;
&lt;td headers='id28e1_c1'&gt;Quartus 9.0sp2&lt;/td&gt;
&lt;td headers='id28e1_c2'&gt;EP3C40Q240C8&lt;/td&gt;
&lt;td headers='id28e1_c3'&gt;9,943 ns&lt;/td&gt;
&lt;td headers='id28e1_c4'&gt; ?&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td class='numeric ' headers='id28e1_c0'&gt;4&lt;/td&gt;
&lt;td headers='id28e1_c1'&gt;Quartus 9.0sp2&lt;/td&gt;
&lt;td headers='id28e1_c2'&gt;EP3C16Q240C8&lt;/td&gt;
&lt;td headers='id28e1_c3'&gt;4,796 ns&lt;/td&gt;
&lt;td headers='id28e1_c4'&gt; ?&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td class='numeric ' headers='id28e1_c0'&gt;8&lt;/td&gt;
&lt;td headers='id28e1_c1'&gt;Quartus 9.0sp2&lt;/td&gt;
&lt;td headers='id28e1_c2'&gt;EP3C16Q240C8&lt;/td&gt;
&lt;td headers='id28e1_c3'&gt;11,011 ns&lt;/td&gt;
&lt;td headers='id28e1_c4'&gt; ?&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Attention : Ces r&#195;&#169;sultats ne sont donn&#195;&#169;s qu'&#195; titre indicatif. En effet, il n'y a pas de contraintes sur l'affectation des broches.&lt;/p&gt;&lt;/div&gt;
		
		</content:encoded>


		
		<enclosure url="https://s-muller.fr/SPIP/IMG/zip/roundrobin.vhdl.zip" length="1001" type="application/zip" />
		

	</item>
<item xml:lang="fr">
		<title>Un daemon UNIX en Python</title>
		<link>https://s-muller.fr/SPIP/spip.php?article8</link>
		<guid isPermaLink="true">https://s-muller.fr/SPIP/spip.php?article8</guid>
		<dc:date>2007-12-30T11:21:35Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Steve</dc:creator>



		<description>&lt;p&gt;Cette article d&#195;&#169;crit une classe permettant de cr&#195;&#169;er un daemon UNIX.&lt;/p&gt;

-
&lt;a href="https://s-muller.fr/SPIP/spip.php?rubrique8" rel="directory"&gt;Python&lt;/a&gt;


		</description>


 <content:encoded>&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Cette classe permet de cr&#195;&#169;er ais&#195;&#169;ment un daemon python. Pour l'utiliser, il suffit de d&#195;&#169;river de cette classe et de rajouter une m&#195;&#169;thode launch(self). Elle g&#195;&#168;re un syst&#195;&#168;me de verrou bas&#195;&#169; sur un fichier ainsi qu'une m&#195;&#169;thode permettant de tuer le daemon.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Les m&#195;&#169;thodes de la classe&lt;/h3&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; __init__&lt;/p&gt;
&lt;p&gt;Cette m&#195;&#169;thode instancie la classe et elle initialise quelques variables.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; _daemonExists&lt;/p&gt;
&lt;p&gt;Cette m&#195;&#169;thode teste l'existence du fichier verrou.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; _lock&lt;/p&gt;
&lt;p&gt;Cette m&#195;&#169;thode cr&#195;&#169;e le fichier verrou et elle &#195;&#169;crit le pid du daemon.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; _unlock&lt;/p&gt;
&lt;p&gt;Cette m&#195;&#169;thode ferme le fichier verrou puis elle efface le fichier verrou.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; _fork&lt;/p&gt;
&lt;p&gt;Cette m&#195;&#169;thode cr&#195;&#169;e le daemon.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; _run&lt;/p&gt;
&lt;p&gt;Cette m&#195;&#169;thode doit &#195;&#170;tre surcharg&#195;&#169;. Cette m&#195;&#169;thode effectue le travail en boucle. Elle doit v&#195;&#169;rifier que la variable &#034;_loop&#034; ne passe pas &#195; &#034;False&#034;.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; __signalHandler&lt;/p&gt;
&lt;p&gt;Cette m&#195;&#169;thode est le gestionnaire de signaux. Seul le signal SIGTERM est intercept&#195;&#169; afin de pouvoir terminer le daemon proprement. Elle modifie la variable &#034;_loop&#034; &#195; &#034;False&#034;.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; setOutput&lt;/p&gt;
&lt;p&gt;Cette m&#195;&#169;thode permet de rediriger les flux stdout et stderr vers des fichiers que l'on aura cr&#195;&#169;e.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; launch&lt;/p&gt;
&lt;p&gt;Cette m&#195;&#169;thode effectue tous les appels n&#195;&#169;cessaires &#195; la cr&#195;&#169;ation du daemon. Elle finit par appeler la m&#195;&#169;thode &#034;_run&#034;. Si le daemon est arr&#195;&#170;t&#195;&#169;, elle restaure les flux et supprime le fichier verrou gr&#195;&#162;ce &#195; la m&#195;&#169;thode &#034;_unlock&#034;.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Exemple d'utilisation&lt;/h3&gt;
&lt;textarea readonly='readonly' cols='40' rows='20' class='spip_cadre' dir='ltr'&gt;from pyUnixDaemon import pyUnixDaemon from datetime import datetime from os import getpid from time import sleep import sys class pyTest(pyUnixDaemon): def __init__(self, lockFilename): pyUnixDaemon.__init__(self, lockFilename) def _run(self): while(self._loop): print &#034;%s - %s&#034; % (datetime.now(), getpid()) sys.stdout.flush() sleep(5) daemon = pyTest(&#034;/var/run/pyTest.pid&#034;) daemon.setOutput(open(&#034;/var/log/pyTest.log&#034;, &#034;a&#034;)) daemon.launch()&lt;/textarea&gt;
&lt;p&gt;Cette exemple &#195;&#169;crit, dans le fichier &#034;/var/log/pyTest.log&#034;, l'heure courante ainsi que le &#034;pid&#034; du processus. Cette op&#195;&#169;ration est effectu&#195;&#169; toutes les cinq secondes.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Cette classe devrait permettre de d&#195;&#169;velopper tr&#195;&#168;s rapidement des scripts Python qui seront utilis&#195;&#169;s comme daemon.&lt;/p&gt;&lt;/div&gt;
		
		</content:encoded>


		
		<enclosure url="https://s-muller.fr/SPIP/IMG/zip/pyUnixDaemon.py.zip" length="1407" type="application/zip" />
		

	</item>
<item xml:lang="fr">
		<title>Contr&#195;&#180;leur I2C</title>
		<link>https://s-muller.fr/SPIP/spip.php?article7</link>
		<guid isPermaLink="true">https://s-muller.fr/SPIP/spip.php?article7</guid>
		<dc:date>2007-06-23T08:09:58Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Steve</dc:creator>



		<description>&lt;p&gt;Cet article contient la description VHDL d'un contr&#195;&#180;leur de bus I2C.&lt;/p&gt;

-
&lt;a href="https://s-muller.fr/SPIP/spip.php?rubrique6" rel="directory"&gt;FPGA&lt;/a&gt;


		</description>


 <content:encoded>&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;La description qui suit est un contr&#195;&#180;leur de bus I2C &#195;&#169;l&#195;&#169;mentaire. Il ne g&#195;&#168;re pas le mode multi-ma&#195;&#174;tre, toutefois le &#194;&#171; clock streching&#194; &#187; est pris en charge.&lt;br class='autobr' /&gt;
La fr&#195;&#169;quence de transmission est d&#195;&#169;fini gr&#195;&#162;ce &#195; un d&#195;&#169;compteur externe &#195; la description.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;D&#195;&#169;coupage&lt;/h3&gt;
&lt;p&gt;Le contr&#195;&#180;leur est d&#195;&#169;coup&#195;&#169; en plusieurs s&#195;&#169;quenceurs dont la liste exhaustive est la suivante :
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; le s&#195;&#169;quenceur de requ&#195;&#170;te,
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; le d&#195;&#169;tecteur d'&#195;&#169;v&#195;&#169;nements de bus,
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; le s&#195;&#169;quenceur de bus,
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; le contr&#195;&#180;leur de bus et
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; une bascule RSC.&lt;/p&gt;
&lt;p&gt;Chaque unit&#195;&#169; sera d&#195;&#169;crite dans les d&#195;&#169;tails ci-dessous.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Le s&#195;&#169;quenceur de requ&#195;&#170;te&lt;/h3&gt;
&lt;p&gt;Cette description prend en charge le s&#195;&#169;quencement des actions sur le bus, &#195; savoir :
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la condition de &#226;&#8364;&#339;Start&#226;&#8364; (start_req),
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la condition de &#226;&#8364;&#339;Repeat Start&#226;&#8364; (repeat_start_req),
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la condition de &#226;&#8364;&#339;Stop&#226;&#8364; (stop_req) et
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la g&#195;&#169;n&#195;&#169;ration de l'horloge lors de la transmission des donn&#195;&#169;es (byte_req).&lt;/p&gt;
&lt;p&gt;Le bloc a besoin de conna&#195;&#174;tre :
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; l'&#195;&#169;tat du bus (busy) et
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; l'&#195;&#169;tat de l'action (complete).&lt;/p&gt;
&lt;p&gt;Et il fournit :
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la demande d'ex&#195;&#169;cution de la condition de &#226;&#8364;&#339;Start&#226;&#8364; (process_start),
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la demande d'ex&#195;&#169;cution de la condition de &#226;&#8364;&#339;Repeat Start&#226;&#8364; (process_repeat_start),
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la demande d'ex&#195;&#169;cution de la condition de &#226;&#8364;&#339;Stop&#226;&#8364; (process_stop),
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la demande d'ex&#195;&#169;cution du signal d'horloge et
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; l'&#195;&#169;tat d'activit&#195;&#169; des actions de bus.&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='85' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity bus_state_seq is port ( \~CLR\ : in std_logic; clk : in std_logic; busy : in std_logic; start_req : in std_logic; repeat_start_req : in std_logic; stop_req : in std_logic; byte_req : in std_logic; complete : in std_logic; in_progress : out std_logic; process_start : out std_logic; process_repeat_start : out std_logic; process_stop : out std_logic; process_byte : out std_logic); end bus_state_seq; architecture Behavioral of bus_state_seq is signal state : std_logic_vector(5 downto 0); constant idle_state : std_logic_vector(state'range) := &#034;000000&#034;; constant start_state : std_logic_vector(state'range) := &#034;010001&#034;; constant busy_state : std_logic_vector(state'range) := &#034;100000&#034;; constant repeat_start_state : std_logic_vector(state'range) := &#034;010010&#034;; constant byte_state : std_logic_vector(state'range) := &#034;011000&#034;; constant stop_state : std_logic_vector(state'range) := &#034;010100&#034;; begin process (\~CLR\, clk) begin if (\~CLR\ = '0') then state &lt;= idle_state; elsif (rising_edge(clk)) then case state is when idle_state =&gt; if ((start_req = '1') and (busy = '0')) then state &lt;= start_state; end if; when start_state =&gt; if (complete = '1') then state &lt;= busy_state; end if; when busy_state =&gt; if (repeat_start_req = '1') then state &lt;= repeat_start_state; end if; if (byte_req = '1') then state &lt;= byte_state; end if; if (stop_req = '1') then state &lt;= stop_state; end if; when repeat_start_state =&gt; if (complete = '1') then state &lt;= busy_state; end if; when byte_state =&gt; if (complete = '1') then state &lt;= busy_state; end if; when stop_state =&gt; if (complete = '1') then state &lt;= idle_state; end if; when others =&gt; state &lt;= idle_state; end case; end if; end process; process_start &lt;= state(0); process_repeat_start &lt;= state(1); process_stop &lt;= state(2); process_byte &lt;= state(3); in_progress &lt;= state(4); end Behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;Le d&#195;&#169;tecteur d'&#195;&#169;v&#195;&#169;nements de bus&lt;/h3&gt;
&lt;p&gt;Cette description permet de d&#195;&#169;tecter une condition de &#226;&#8364;&#339;Start&#226;&#8364; ou &#226;&#8364;&#339;Repeat Start&#226;&#8364; , une condition de &#226;&#8364;&#339;Stop&#226;&#8364; , le front montant du signal d'horloge ou le front descendant du signal d'horloge.&lt;br class='autobr' /&gt;
Ces informations sont importantes pour le s&#195;&#169;quencement de certains unit&#195;&#169;s.&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='35' class='spip_cadre' dir='ltr'&gt;library ieee; use ieee.std_logic_1164.all; entity event_detector is port ( \~CLR\ : in std_logic; clk : in std_logic; sda : in std_logic; scl : in std_logic; start : out std_logic; stop : out std_logic; re : out std_logic; fe : out std_logic); end event_detector; architecture behavioral of event_detector is signal old_sda : std_logic; signal old_scl : std_logic; begin process (\~CLR\, clk) begin if (\~CLR\ = '0') then old_sda &lt;= '1'; old_scl &lt;= '1'; elsif (rising_edge(clk)) then old_sda &lt;= sda; old_scl &lt;= scl; start &lt;= scl and old_sda and not(sda); stop &lt;= scl and not(old_sda) and sda; re &lt;= not(old_scl) and scl; fe &lt;= old_scl and not(scl); end if; end process; end behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;Le s&#195;&#169;quenceur de bus&lt;/h3&gt;
&lt;p&gt;Cette description permet de g&#195;&#169;n&#195;&#169;rer :
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la condition de &#226;&#8364;&#339;Start&#226;&#8364; ,
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la condition de &#226;&#8364;&#339;Repeat Start&#226;&#8364; ,
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; la condition de &#226;&#8364;&#339;Stop&#226;&#8364; ,
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; le signal d'horloge n&#195;&#169;cessaire aux &#195;&#169;changes de donn&#195;&#169;es.&lt;/p&gt;
&lt;p&gt;Lors de la g&#195;&#169;n&#195;&#169;ration d'horloge, le bloc n&#195;&#169;cessite l'&#195;&#169;tat du signal &#226;&#8364;&#339;SCL&#226;&#8364; afin de traiter le cas du &#226;&#8364;&#339;clock strech&#226;&#8364; .&lt;br class='autobr' /&gt;
En effet, lorsque le s&#195;&#169;quenceur impose un niveau haut sur l'horloge, il attend que le signal passe effectivement &#195; un avant de lancer un processus ext&#195;&#169;rieur de temporisation.&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='187' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity bus_seq is port ( \~CLR\ : in std_logic; clk : in std_logic; process_start : in std_logic; process_repeat_start : in std_logic; process_stop : in std_logic; process_byte : in std_logic; bo_cnt : in std_logic; scl : in std_logic; s_sda : out std_logic; r_sda : out std_logic; s_scl : out std_logic; r_scl : out std_logic; clr_cnt : out std_logic; complete : out std_logic); end bus_seq; architecture Behavioral of bus_seq is signal counter : std_logic_vector(3 downto 0); signal state : std_logic_vector(7 downto 0); constant idle : std_logic_vector(state'range) := &#034;00000000&#034;; constant repeat_start_step0 : std_logic_vector(state'range) := &#034;00010010&#034;; constant repeat_start_step1 : std_logic_vector(state'range) := &#034;00000010&#034;; constant repeat_start_step2 : std_logic_vector(state'range) := &#034;00011000&#034;; constant repeat_start_step3 : std_logic_vector(state'range) := &#034;00001000&#034;; constant start_step0 : std_logic_vector(state'range) := &#034;00011010&#034;; constant start_step1 : std_logic_vector(state'range) := &#034;00001010&#034;; constant start_step2 : std_logic_vector(state'range) := &#034;00010001&#034;; constant start_step3 : std_logic_vector(state'range) := &#034;00000001&#034;; constant start_step4 : std_logic_vector(state'range) := &#034;00010100&#034;; constant start_step5 : std_logic_vector(state'range) := &#034;00000100&#034;; constant start_step6 : std_logic_vector(state'range) := &#034;00100000&#034;; constant stop_step0 : std_logic_vector(state'range) := &#034;00010101&#034;; constant stop_step1 : std_logic_vector(state'range) := &#034;00000101&#034;; constant stop_step2 : std_logic_vector(state'range) := &#034;01011000&#034;; constant stop_step3 : std_logic_vector(state'range) := &#034;01001000&#034;; constant stop_step4 : std_logic_vector(state'range) := &#034;01010010&#034;; constant stop_step5 : std_logic_vector(state'range) := &#034;01000010&#034;; constant stop_step6 : std_logic_vector(state'range) := &#034;01100000&#034;; constant byte_step0 : std_logic_vector(state'range) := &#034;10010100&#034;; constant byte_step1 : std_logic_vector(state'range) := &#034;10000100&#034;; constant byte_step2 : std_logic_vector(state'range) := &#034;10011000&#034;; constant byte_step3 : std_logic_vector(state'range) := &#034;10001000&#034;; constant byte_step4 : std_logic_vector(state'range) := &#034;11010100&#034;; constant byte_step5 : std_logic_vector(state'range) := &#034;00100100&#034;; begin process (\~CLR\, clk) begin if (\~CLR\ = '0') then state &lt;= idle; counter &lt;= (others =&gt; '0'); elsif (rising_edge(clk)) then case state is when idle =&gt; if (process_start = '1') then state &lt;= start_step0; end if; if (process_repeat_start = '1') then state &lt;= repeat_start_step0; end if; if (process_stop = '1') then state &lt;= stop_step0; end if; if (process_byte = '1') then state &lt;= byte_step0; end if; when repeat_start_step0 =&gt; state &lt;= repeat_start_step1; when repeat_start_step1 =&gt; if (bo_cnt = '1') then state &lt;= repeat_start_step2; end if; when repeat_start_step2 =&gt; state &lt;= repeat_start_step3; when repeat_start_step3 =&gt; if (bo_cnt = '1') then state &lt;= start_step2; end if; when start_step0 =&gt; state &lt;= start_step1; when start_step1 =&gt; if (bo_cnt = '1') then state &lt;= start_step2; end if; when start_step2 =&gt; state &lt;= start_step3; when start_step3 =&gt; if (bo_cnt = '1') then state &lt;= start_step4; end if; when start_step4 =&gt; state &lt;= start_step5; when start_step5 =&gt; if (bo_cnt = '1') then state &lt;= start_step6; end if; when start_step6 =&gt; state &lt;= idle; when stop_step0 =&gt; state &lt;= stop_step1; when stop_step1 =&gt; if (bo_cnt = '1') then state &lt;= stop_step2; end if; when stop_step2 =&gt; state &lt;= stop_step3; when stop_step3 =&gt; if (bo_cnt = '1') then state &lt;= stop_step4; end if; when stop_step4 =&gt; state &lt;= stop_step5; when stop_step5 =&gt; if (bo_cnt = '1') then state &lt;= stop_step6; end if; when stop_step6 =&gt; state &lt;= idle; when byte_step0 =&gt; counter &lt;= (others =&gt; '0'); state &lt;= byte_step1; when byte_step1 =&gt; if (bo_cnt = '1') then state &lt;= byte_step2; end if; when byte_step2 =&gt; if (scl /= '0') then state &lt;= byte_step3; end if; when byte_step3 =&gt; if (bo_cnt = '1') then state &lt;= byte_step4; end if; when byte_step4 =&gt; counter &lt;= counter + 1; if (counter = 8) then state &lt;= byte_step5; else state &lt;= byte_step1; end if; when byte_step5 =&gt; state &lt;= idle; when others =&gt; state &lt;= idle; end case; end if; end process; r_sda &lt;= state(0); s_sda &lt;= state(1); r_scl &lt;= state(2); s_scl &lt;= state(3); clr_cnt &lt;= state(4); complete &lt;= state(5); end behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;Le contr&#195;&#180;leur de bus&lt;/h3&gt;
&lt;p&gt;Cette description permet de :
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; d&#195;&#169;tecter la direction du transfert,
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; indiquer l'instant o&#195;&#185; doit se produire l'acquittement et
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; fournir l'&#195;&#169;tat du bus.&lt;/p&gt;
&lt;p&gt;Le bloc utilise les signaux &#226;&#8364;&#339;start&#226;&#8364; et &#226;&#8364;&#339;stop&#226;&#8364; pour indiquer l'&#195;&#169;tat du bus. Le signal interne &#226;&#8364;&#339;first&#226;&#8364; associ&#195;&#169; au compteur interne et au signal &#226;&#8364;&#339;sda&#226;&#8364; permet de d&#195;&#169;tecter la direction du transfert. Le compteur est aussi utilis&#195;&#169; pour d&#195;&#169;tecter l'instant o&#195;&#185; les acquittements doivent se produire.&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='76' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity bus_ctrl is port ( \~CLR\ : in std_logic; clk : in std_logic; sda : in std_logic; start : in std_logic; stop : in std_logic; re : in std_logic; fe : in std_logic; acktime : out std_logic; write : out std_logic; busy : out std_logic); end bus_ctrl; architecture Behavioral of bus_ctrl is signal internal : std_logic; signal must_count : std_logic; signal direction : std_logic; signal first : std_logic; signal counter : std_logic_vector(3 downto 0); begin process (\~CLR\, clk) begin if (\~CLR\ = '0') then internal &lt;= '0'; counter &lt;= (others =&gt; '0'); must_count &lt;= '0'; acktime &lt;= '0'; direction &lt;= '0'; write &lt;= '0'; first &lt;= '1'; elsif (rising_edge(clk)) then if (start = '1') then internal &lt;= '1'; counter &lt;= (others =&gt; '0'); must_count &lt;= '0'; direction &lt;= '0'; write &lt;= '0'; first &lt;= '1'; end if; if (stop = '1') then internal &lt;= '0'; end if; if (fe = '1') then if (must_count = '1') then if (counter = 8) then counter &lt;= (others =&gt; '0'); acktime &lt;= '0'; if (first = '1') then write &lt;= direction; first &lt;= '0'; end if; elsif (counter = 7) then counter &lt;= counter + 1; acktime &lt;= '1'; else counter &lt;= counter + 1; end if; else must_count &lt;= '1'; end if; end if; if (re = '1') then if (counter = 7) then direction &lt;= sda; end if; end if; end if; end process; busy &lt;= internal; end Behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;La bascule RS&lt;/h3&gt;
&lt;p&gt;La bascule RS est synchrone &#195; une horloge. De plus, l&#226;&#8364;&#8482;entr&#195;&#169;e de mise &#195; un (S) est prioritaire.&lt;/p&gt;
&lt;p&gt;Voici la description VHDL de la bascule :&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='27' class='spip_cadre' dir='ltr'&gt;library ieee; use ieee.std_logic_1164.all; entity rsc is port ( \~CLR\ : in std_logic; clk : in std_logic; s : in std_logic; r : in std_logic; q : out std_logic); end rsc; architecture behavioral of rsc is begin process (\~CLR\, clk) begin if (\~CLR\ = '0') then q &lt;= '1'; elsif (rising_edge(clk)) then if (s = '1') then q &lt;= '1'; elsif (r = '1') then q &lt;= '0'; end if; end if; end process; end behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;Le contr&#195;&#180;leur de bus I2C&lt;/h3&gt;
&lt;p&gt;Le contr&#195;&#180;leur de bus I2C est compos&#195;&#169; de toutes les descriptions ci-dessus auxquels on ajoute un multiplexeur pour la g&#195;&#169;n&#195;&#169;ration du signal SDA en sortie, un premier registre &#195; d&#195;&#169;calage pour l'&#195;&#169;mission et un second pour la r&#195;&#169;ception ainsi que deux blocs de synchronisation pour les signaux SDA et SCL en entr&#195;&#169;e.&lt;/p&gt;
&lt;p&gt;Le contr&#195;&#180;leur n&#195;&#169;cessite un compteur ext&#195;&#169;rieur afin de d&#195;&#169;finir la fr&#195;&#169;quence de SCL.&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='179' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity master_i2c is port ( \~CLR\ : in std_logic; clk : in std_logic; start_req : in std_logic; repeat_start_req : in std_logic; stop_req : in std_logic; byte_req : in std_logic; d : in std_logic_vector(7 downto 0); ackin : in std_logic; sda_in : in std_logic; scl_in : in std_logic; bo_cnt : in std_logic; clr_cnt : out std_logic; sda_out : out std_logic; scl_out : out std_logic; busy : out std_logic; in_progress : out std_logic; q : out std_logic_vector(7 downto 0); ackout : out std_logic); end master_i2c; architecture Behavioral of master_i2c is component bus_state_seq port ( \~CLR\ : in std_logic; clk : in std_logic; busy : in std_logic; start_req : in std_logic; repeat_start_req : in std_logic; stop_req : in std_logic; byte_req : in std_logic; complete : in std_logic; in_progress : out std_logic; process_start : out std_logic; process_repeat_start : out std_logic; process_stop : out std_logic; process_byte : out std_logic); end component; component event_detector port ( \~CLR\ : in std_logic; clk : in std_logic; sda : in std_logic; scl : in std_logic; start : out std_logic; stop : out std_logic; re : out std_logic; fe : out std_logic); end component; component bus_seq port ( \~CLR\ : in std_logic; clk : in std_logic; process_start : in std_logic; process_repeat_start : in std_logic; process_stop : in std_logic; process_byte : in std_logic; bo_cnt : in std_logic; scl : in std_logic; s_sda : out std_logic; r_sda : out std_logic; s_scl : out std_logic; r_scl : out std_logic; clr_cnt : out std_logic; complete : out std_logic); end component; component bus_ctrl port ( \~CLR\ : in std_logic; clk : in std_logic; sda : in std_logic; start : in std_logic; stop : in std_logic; re : in std_logic; fe : in std_logic; acktime : out std_logic; write : out std_logic; busy : out std_logic); end component; component rsc port ( \~CLR\ : in std_logic; clk : in std_logic; s : in std_logic; r : in std_logic; q : out std_logic); end component; signal internal_busy : std_logic; signal complete : std_logic; signal process_start : std_logic; signal process_repeat_start : std_logic; signal process_stop : std_logic; signal process_byte : std_logic; signal start : std_logic; signal stop : std_logic; signal re : std_logic; signal fe : std_logic; signal s_sda : std_logic; signal r_sda : std_logic; signal s_scl : std_logic; signal r_scl : std_logic; signal acktime : std_logic; signal write : std_logic; signal sda_bs : std_logic; signal outgoing : std_logic_vector(8 downto 0); signal incoming : std_logic_vector(8 downto 0); signal sda : std_logic_vector(1 downto 0); signal scl : std_logic_vector(1 downto 0); begin inst_bss : bus_state_seq port map (\~CLR\, clk, internal_busy, start_req, repeat_start_req, stop_req, byte_req, complete, in_progress, process_start, process_repeat_start, process_stop, process_byte); inst_ed : event_detector port map (\~CLR\, clk, sda(1), scl(1), start, stop, re, fe); inst_bs : bus_seq port map ( \~CLR\, clk, process_start, process_repeat_start, process_stop, process_byte, bo_cnt, scl(1), s_sda, r_sda, s_scl, r_scl, clr_cnt, complete); inst_bc : bus_ctrl port map ( \~CLR\, clk, sda(1), start, stop, re, fe, acktime, write, internal_busy); inst_rsc_sda : rsc port map ( \~CLR\, clk, s_sda, r_sda, sda_bs); inst_rsc_scl : rsc port map ( \~CLR\, clk, s_scl, r_scl, scl_out); sda_out &lt;= sda_bs when (process_byte = '0') else '1' when ((write /= '0') xor (acktime = '1')) else outgoing(8); process (\~CLR\, clk) begin if (\~CLR\ = '0') then outgoing &lt;= (others =&gt; '0'); incoming &lt;= (others =&gt; '0'); elsif (rising_edge(clk)) then if (fe = '1') then outgoing &lt;= outgoing(7 downto 0) &amp; sda(1); elsif (byte_req = '1') then outgoing &lt;= d &amp; ackin; end if; if (re = '1') then incoming &lt;= incoming(7 downto 0) &amp; sda(1); end if; end if; end process; process (\~CLR\, clk) begin if (\~CLR\ = '0') then sda &lt;= (others =&gt; '1'); scl &lt;= (others =&gt; '1'); elsif (rising_edge(clk)) then sda &lt;= sda(0) &amp; sda_in; scl &lt;= scl(0) &amp; scl_in; end if; end process; busy &lt;= internal_busy; q &lt;= incoming(8 downto 1); ackout &lt;= incoming(0); end Behavioral;&lt;/textarea&gt;&lt;/div&gt;
		
		</content:encoded>


		
		<enclosure url="https://s-muller.fr/SPIP/IMG/zip/i2cmaster.vhdl.zip" length="2902" type="application/zip" />
		

	</item>
<item xml:lang="fr">
		<title>PWM pour FPGA</title>
		<link>https://s-muller.fr/SPIP/spip.php?article6</link>
		<guid isPermaLink="true">https://s-muller.fr/SPIP/spip.php?article6</guid>
		<dc:date>2007-06-02T12:40:49Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Steve</dc:creator>



		<description>&lt;p&gt;Cet article contient la description VHDL d'une PWM.&lt;/p&gt;

-
&lt;a href="https://s-muller.fr/SPIP/spip.php?rubrique6" rel="directory"&gt;FPGA&lt;/a&gt;


		</description>


 <content:encoded>&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;La description qui suit permet de g&#195;&#169;rer une ou plusieurs PWM dans une FPGA. Elle est bas&#195;&#169;e sur un compteur 16 bits, de deux ou plusieurs comparateurs et d'une ou plusieurs bascules RS.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Le compteur&lt;/h3&gt;
&lt;p&gt;Mon exp&#195;&#169;rience m'a appris &#195; me m&#195;&#169;fier des outils de synth&#195;&#168;se. Toutefois, &#195; ce jour, ils sont susceptibles de synth&#195;&#169;tiser un compteur performant.&lt;br class='autobr' /&gt;
Voici la description VHDL du compteur :&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='25' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity cnt16 is port (clr : in std_logic; clk : in std_logic; q : out std_logic_vector(15 downto 0)); end cnt16; architecture behavioral of cnt16 is signal internal : std_logic_vector(15 downto 0); begin process (clr, clk) begin if (clr = '1') then internal &lt;= (others =&gt; '0'); elsif (rising_edge(clk)) then internal &lt;= internal + 1; end if; end process; q &lt;= internal; end behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;La bascule RS&lt;/h3&gt;
&lt;p&gt;La bascule RS est synchrone &#195; une horloge. De plus, l'entr&#195;&#169;e de mise &#195; z&#195;&#169;ro (R) est prioritaire.&lt;/p&gt;
&lt;p&gt;Voici la description VHDL de la bascule :&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='27' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity rs is port (clr : in std_logic; clk : in std_logic; s : in std_logic; r : in std_logic; q : out std_logic); end rs; architecture behavioral of rs is begin process (clr, clk) begin if (clr = '1') then q &lt;= '0'; elsif (rising_edge(clk)) then if (r = '1') then q &lt;= '0'; elsif (s = '1') then q &lt;= '1'; end if; end if; end process; end behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;Le comparateur&lt;/h3&gt;
&lt;p&gt;Le code du comparateur est extr&#195;&#170;mement simple, jugez plut&#195;&#180;t :&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='15' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity cmp is port (a : in std_logic_vector(15 downto 0); b : in std_logic_vector(15 downto 0); eq : out std_logic); end cmp; architecture behavioral of cmp is begin eq &lt;= '1' when (a = b) else '0'; end behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;La PWM&lt;/h3&gt;
&lt;p&gt;Finalement, nous allons instancier toutes les descriptions n&#195;&#169;cessaires &#195; l'obtention du bloc PWM.&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='43' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity pwm is port (clr : in std_logic; clk : in std_logic; d : in std_logic_vector(15 downto 0); q : out std_logic); end pwm; architecture behavioral of pwm is signal zero : std_logic; signal eq : std_logic; signal internal : std_logic_vector(15 downto 0); component cnt16 port (clr : in std_logic; clk : in std_logic; q : out std_logic_vector(15 downto 0)); end component; component rs port (clr : in std_logic; clk : in std_logic; s : in std_logic; r : in std_logic; q : out std_logic); end component; component cmp port (a : in std_logic_vector(15 downto 0); b : in std_logic_vector(15 downto 0); eq : out std_logic); end component; begin counter : cnt16 port map (clr, clk, internal); cmpzero : cmp port map (internal, x&#034;0000&#034;, zero); cmplimit : cmp port map (internal, d, eq); rsc : rs port map (clr, clk, zero, eq, q); end behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;Plusieurs PWMs&lt;/h3&gt;
&lt;p&gt;Si le besoin de plusieurs PWMs existe, il est possible de mutualiser le compteur ainsi que le comparateur &#195; z&#195;&#169;ro. De ce fait, chaque PWM suppl&#195;&#169;mentaire n&#195;&#169;cessite qu'un comparateur et qu'une bascule RS.&lt;/p&gt; &lt;textarea readonly='readonly' cols='40' rows='58' class='spip_cadre' dir='ltr'&gt;library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity fourpwm is port (clr : in std_logic; clk : in std_logic; d0 : in std_logic_vector(15 downto 0); q0 : out std_logic; d1 : in std_logic_vector(15 downto 0); q1 : out std_logic; d2 : in std_logic_vector(15 downto 0); q2 : out std_logic; d3 : in std_logic_vector(15 downto 0); q3 : out std_logic); end fourpwm; architecture behavioral of fourpwm is signal zero : std_logic; signal eq0 : std_logic; signal eq1 : std_logic; signal eq2 : std_logic; signal eq3 : std_logic; signal internal : std_logic_vector(15 downto 0); component cnt16 port (clr : in std_logic; clk : in std_logic; q : out std_logic_vector(15 downto 0)); end component; component rs port (clr : in std_logic; clk : in std_logic; s : in std_logic; r : in std_logic; q : out std_logic); end component; component cmp port (a : in std_logic_vector(15 downto 0); b : in std_logic_vector(15 downto 0); eq : out std_logic); end component; begin counter : cnt16 port map (clr, clk, internal); cmpzero : cmp port map (internal, x&#034;0000&#034;, zero); cmplimit0 : cmp port map (internal, d0, eq0); rsc0 : rs port map (clr, clk, zero, eq0, q0); cmplimit1 : cmp port map (internal, d1, eq1); rsc1 : rs port map (clr, clk, zero, eq1, q1); cmplimit2 : cmp port map (internal, d2, eq2); rsc2 : rs port map (clr, clk, zero, eq2, q2); cmplimit3 : cmp port map (internal, d3, eq3); rsc3 : rs port map (clr, clk, zero, eq3, q3); end behavioral;&lt;/textarea&gt;&lt;h3 class=&#034;spip&#034;&gt;Remarque&lt;/h3&gt;
&lt;p&gt;L'utilisation d'un comparateur avec une sortie &#194;&#171; plus petit que&#194; &#187; se comporte de la m&#195;&#170;me mani&#195;&#168;re. Toutefois, il n&#195;&#169;cessite plus de logique que l'op&#195;&#169;rateur &#194;&#171; &#195;&#169;gale&#194; &#187;. De ce fait, la description que je propose permet une fr&#195;&#169;quence de travail plus &#195;&#169;lev&#195;&#169;e. De plus, la synth&#195;&#168;se de l'op&#195;&#169;rateur &#194;&#171; &#195;&#169;gale&#194; &#187; est optimale sur tous les synth&#195;&#169;tiseurs que j'ai pu essayer ce qui n'est pas le cas de l'op&#195;&#169;rateur &#194;&#171; plus petit que&#194; &#187;.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;J'ai synth&#195;&#169;tis&#195;&#169; la description sous plusieurs outils et pour plusieurs cibles.&lt;/p&gt;
&lt;table class=&#034;spip&#034;&gt;
&lt;thead&gt;&lt;tr class='row_first'&gt;&lt;th id='id8f23_c0'&gt; Version &lt;/th&gt;&lt;th id='id8f23_c1'&gt; Outil de synth&#195;&#168;se &lt;/th&gt;&lt;th id='id8f23_c2'&gt; Cible &lt;/th&gt;&lt;th id='id8f23_c3'&gt; P&#195;&#169;riode minimum &lt;/th&gt;&lt;th id='id8f23_c4'&gt; Niveau logique &lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td headers='id8f23_c0'&gt;pwm&lt;/td&gt;
&lt;td headers='id8f23_c1'&gt;ISE 7.1&lt;/td&gt;
&lt;td headers='id8f23_c2'&gt;XC2S300E-7PQ208&lt;/td&gt;
&lt;td headers='id8f23_c3'&gt;8,049 ns&lt;/td&gt;
&lt;td headers='id8f23_c4'&gt;3&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td headers='id8f23_c0'&gt;fourpwm&lt;/td&gt;
&lt;td headers='id8f23_c1'&gt;ISE 7.1&lt;/td&gt;
&lt;td headers='id8f23_c2'&gt;XC2S300E-7PQ208&lt;/td&gt;
&lt;td headers='id8f23_c3'&gt;8,670 ns&lt;/td&gt;
&lt;td headers='id8f23_c4'&gt;3&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td headers='id8f23_c0'&gt;pwm&lt;/td&gt;
&lt;td headers='id8f23_c1'&gt;ISE 7.1&lt;/td&gt;
&lt;td headers='id8f23_c2'&gt;XC3S500E-4PQ208&lt;/td&gt;
&lt;td headers='id8f23_c3'&gt;8,180 ns&lt;/td&gt;
&lt;td headers='id8f23_c4'&gt;5&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td headers='id8f23_c0'&gt;fourpwm&lt;/td&gt;
&lt;td headers='id8f23_c1'&gt;ISE 7.1&lt;/td&gt;
&lt;td headers='id8f23_c2'&gt;XC3S500E-4PQ208&lt;/td&gt;
&lt;td headers='id8f23_c3'&gt;11,313 ns&lt;/td&gt;
&lt;td headers='id8f23_c4'&gt;5&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td headers='id8f23_c0'&gt;pwm&lt;/td&gt;
&lt;td headers='id8f23_c1'&gt;Libero 7.1&lt;/td&gt;
&lt;td headers='id8f23_c2'&gt;A54SX32A-F PQ208&lt;/td&gt;
&lt;td headers='id8f23_c3'&gt;12,155 ns&lt;/td&gt;
&lt;td headers='id8f23_c4'&gt; ?&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td headers='id8f23_c0'&gt;fourpwm&lt;/td&gt;
&lt;td headers='id8f23_c1'&gt;Libero 7.1&lt;/td&gt;
&lt;td headers='id8f23_c2'&gt;A54SX32A-F PQ208&lt;/td&gt;
&lt;td headers='id8f23_c3'&gt;12,155 ns&lt;/td&gt;
&lt;td headers='id8f23_c4'&gt; ?&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td headers='id8f23_c0'&gt;pwm&lt;/td&gt;
&lt;td headers='id8f23_c1'&gt;ispLEVER 7.0&lt;/td&gt;
&lt;td headers='id8f23_c2'&gt;LFXP3C-3P208C&lt;/td&gt;
&lt;td headers='id8f23_c3'&gt;6,107 ns&lt;/td&gt;
&lt;td headers='id8f23_c4'&gt;8&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td headers='id8f23_c0'&gt;fourpwm&lt;/td&gt;
&lt;td headers='id8f23_c1'&gt;ispLEVER 7.0&lt;/td&gt;
&lt;td headers='id8f23_c2'&gt;LFXP3C-3P208C&lt;/td&gt;
&lt;td headers='id8f23_c3'&gt;7,375 ns&lt;/td&gt;
&lt;td headers='id8f23_c4'&gt;8&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Attention : Ces r&#195;&#169;sultats ne sont donn&#195;&#169;s qu'&#195; titre indicatif. En effet, il n'y a pas de contraintes sur l'affectation des broches.&lt;/p&gt;&lt;/div&gt;
		
		</content:encoded>


		
		<enclosure url="https://s-muller.fr/SPIP/IMG/zip/pwm.vhdl.zip" length="1119" type="application/zip" />
		

	</item>
<item xml:lang="fr">
		<title>Conversion de niveaux &#195;&#169;lectriques pour le bus I2C</title>
		<link>https://s-muller.fr/SPIP/spip.php?article2</link>
		<guid isPermaLink="true">https://s-muller.fr/SPIP/spip.php?article2</guid>
		<dc:date>2006-12-05T14:00:11Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>Steve</dc:creator>



		<description>&lt;p&gt;Cette petite astuce permet de faire dialoguer des noeuds I2C qui sont dispos&#195;&#169;s sur deux segments de tension diff&#195;&#169;rentes.&lt;/p&gt;

-
&lt;a href="https://s-muller.fr/SPIP/spip.php?rubrique4" rel="directory"&gt;Solutions techniques&lt;/a&gt;


		</description>


 <content:encoded>&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Description&lt;/h3&gt;
&lt;p&gt;La petite astuce suivante permet de faire dialoguer des noeuds I2C qui sont dispos&#195;&#169;s sur deux segments de tension diff&#195;&#169;rente. Il faut mettre un exemplaire de la structure pour la ligne SDA et un autre pour la ligne SCL.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Sch&#195;&#169;ma&lt;/h3&gt;
&lt;p&gt;&lt;span class='spip_document_3 spip_documents spip_documents_center'&gt;
&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L466xH245/I2C_Level_shifter-55afe.png?1587815855' width='466' height='245' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Rappel sur le bus I2C&lt;/h3&gt;
&lt;p&gt;C'est un bus qui conna&#195;&#174;t deux &#195;&#169;tats :
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; le niveau haut qui est associ&#195;&#169; au 1 logique est un niveau r&#195;&#169;cessif et
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; le niveau bas qui est associ&#195;&#169; au 0 logique est un niveau dominant.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Principe&lt;/h3&gt;
&lt;p&gt;Trois possibilit&#195;&#169;s :
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Les deux cot&#195;&#169;s pr&#195;&#169;sentent un niveau haut, le transistor est bloqu&#195;&#169;,
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Le c&#195;&#180;t&#195;&#169; 3,3V est forc&#195;&#169; au niveau bas, la tension Grille-Source est suffisant pour rendre le transistor conducteur et le c&#195;&#180;t&#195;&#169; 5V se retrouve lui aussi forcer au niveau bas et
&lt;br /&gt;&lt;img src='https://s-muller.fr/SPIP/local/cache-vignettes/L8xH11/puce-32883.gif?1587815855' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Le c&#195;&#180;t&#195;&#169; 5V est forc&#195;&#169; au niveau bas, dans ce cas, la diode, cr&#195;&#169;e par le substrat &#034;bulk&#034; et la source, permet de faire baisser le 3,3V jusqu'&#195; 0,6V et on se retrouve dans le cas pr&#195;&#169;c&#195;&#169;dent.&lt;/p&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>



</channel>

</rss>
