<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Electronic Archives - Tom Barbette</title>
	<atom:link href="https://perso.uclouvain.be/tom.barbette/category/passions/electronic/feed/" rel="self" type="application/rss+xml" />
	<link>https://perso.uclouvain.be/tom.barbette/category/passions/electronic/</link>
	<description></description>
	<lastBuildDate>Thu, 08 Oct 2015 12:51:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2022/04/cropped-logo-uclouvain-2021-barbette-32x32.png</url>
	<title>Electronic Archives - Tom Barbette</title>
	<link>https://perso.uclouvain.be/tom.barbette/category/passions/electronic/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>PIC Domotic station</title>
		<link>https://perso.uclouvain.be/tom.barbette/pic-domotic-station/</link>
		
		<dc:creator><![CDATA[Tom Barbette]]></dc:creator>
		<pubDate>Fri, 26 Dec 2014 18:14:02 +0000</pubDate>
				<category><![CDATA[Domotic]]></category>
		<category><![CDATA[Electronic]]></category>
		<guid isPermaLink="false">http://queen.run.montefiore.ulg.ac.be/~barbette/?p=377</guid>

					<description><![CDATA[<p>I use this Microchip&#8217;s PIC program made in C to control my domotic system for quite some time now, and I think it&#8217;s ready to be published. Below is the readme file, to read the last version, directly go to : https://github.com/tbarbette/picdomotic PIC Domotic station &#160; PIC program for a domotic station controlling two temperature &#8230; </p>
<p class="link-more"><a href="https://perso.uclouvain.be/tom.barbette/pic-domotic-station/" class="more-link">Continue reading<span class="screen-reader-text"> "PIC Domotic station"</span></a></p>
<p>The post <a href="https://perso.uclouvain.be/tom.barbette/pic-domotic-station/">PIC Domotic station</a> appeared first on <a href="https://perso.uclouvain.be/tom.barbette">Tom Barbette</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I use this Microchip&#8217;s PIC program made in C to control my domotic system for quite some time now, and I think it&#8217;s ready to be published.</p>
<p>Below is the readme file, to read the last version, directly go to :</p>
<p>https://github.com/tbarbette/picdomotic</p>
<h1>PIC Domotic station</h1>
<p>&nbsp;</p>
<p>PIC program for a domotic station controlling two temperature sensors, multiple relay, a USB port (for power only) and connected to a PC using UART to receive its instructions.</p>
<p>It uses a PIC18F23K20 but should work on most of them. The PC sends simple commandes through /dev/ttyUSB0 like &#8220;A 32&#8221; to enable the device 32, or &#8220;E 32&#8221; to disable it. &#8220;T&#8221; to get temperature, &#8230; See the source code in main.c.</p>
<p>This is MPLAB X IDE project. The only usefull file is in fact main.c, the rest is auto-generated, but I include them if someone would want to directly program the binaries, for example.</p>
<h1><a id="user-content-technology-used" class="anchor" href="https://github.com/MappaM/picdomotic#technology-used"></a>Technology used</h1>
<p>If you&#8217;re looking for sample code, you may find here how to :</p>
<ul class="task-list">
<li>Use the UART to communicate with a PC (UART is connected to a &#8220;uart usb&#8221; module very cheaped that you can find on ebay for example) .</li>
<li>Use the watchdog timer to ensure a device reset if something goes wrong</li>
<li>Use Brown-out to jump to do an interrupt and do &#8220;something&#8221; (blink in my case) if the voltage goes below some threshold</li>
<li>Use the ADC to read the temperature given by two LM35</li>
<li>Read/write to eeprom</li>
<li>Control a 5V relay board with a 3.3V relay board using NPN Transistors (when I&#8217;ll add the schematic though)</li>
</ul>
<p>The python script used to manage the PIC controller is available at<a href="https://github.com/tbarbette/monitoring/blob/master/scripts/relay.py">https://github.com/tbarbette/monitoring/blob/master/scripts/relay.py</a> and a small HTTP server allowing you to remotely control it is available at<a href="https://github.com/tbarbette/monitoring/blob/master/scripts/server.py">https://github.com/tbarbette/monitoring/blob/master/scripts/server.py</a></p>
<p>The post <a href="https://perso.uclouvain.be/tom.barbette/pic-domotic-station/">PIC Domotic station</a> appeared first on <a href="https://perso.uclouvain.be/tom.barbette">Tom Barbette</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read and write PIC EEPROM</title>
		<link>https://perso.uclouvain.be/tom.barbette/read-and-write-pic-eeprom/</link>
		
		<dc:creator><![CDATA[Tom Barbette]]></dc:creator>
		<pubDate>Sun, 19 Jan 2014 11:08:10 +0000</pubDate>
				<category><![CDATA[Electronic]]></category>
		<category><![CDATA[eeprom]]></category>
		<category><![CDATA[hightechc]]></category>
		<category><![CDATA[microchip]]></category>
		<category><![CDATA[mplab]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[pic16]]></category>
		<category><![CDATA[pic18]]></category>
		<category><![CDATA[xc8]]></category>
		<guid isPermaLink="false">http://queen.run.montefiore.ulg.ac.be/~barbette/?p=100</guid>

					<description><![CDATA[<p>More a little post-it than a post, I wanted to put somewhere the commands : Using the eeprom is as simple as these two commands : [code lang=&#8221;c&#8221;]EEPROM_READ(addr) EEPROM_WRITE(addr,value) [/code] A little example (reading from the USART a value and putting it in the EEPROM address 0x00) [code] while (!DataRdyUSART()); char data = ReadUSART(); EEPROM_WRITE(0x00,data); &#8230; </p>
<p class="link-more"><a href="https://perso.uclouvain.be/tom.barbette/read-and-write-pic-eeprom/" class="more-link">Continue reading<span class="screen-reader-text"> "Read and write PIC EEPROM"</span></a></p>
<p>The post <a href="https://perso.uclouvain.be/tom.barbette/read-and-write-pic-eeprom/">Read and write PIC EEPROM</a> appeared first on <a href="https://perso.uclouvain.be/tom.barbette">Tom Barbette</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>More a little post-it than a post, I wanted to put somewhere the commands :</p>
<p>Using the eeprom is as simple as these two commands :</p>
<p>[code lang=&#8221;c&#8221;]EEPROM_READ(addr)<br />
EEPROM_WRITE(addr,value)<br />
[/code]</p>
<p>A little example (reading from the USART a value and putting it in the EEPROM address 0x00)</p>
<p>[code]<br />
while (!DataRdyUSART());<br />
char data = ReadUSART();<br />
EEPROM_WRITE(0x00,data);<br />
[/code]</p>
<p>Note that theses header are defined in the standard xc8 header <xc8.h> which will include <pic18.h> (or <pic16.h>, &#8230;) or High Tech C headers if you come from the past :</p>
<p>[code lang=&#8221;c&#8221;]<br />
// MACROS for EEPROM Access<br />
/* macro versions of EEPROM read and write */</p>
<p>/* NOTE WELL:<br />
EEPROM_READ() is NOT safe to use immediately after any<br />
write to EEPROM, as it does NOT wait for WR to clear. This is by<br />
design, to allow minimal code size if a sequence of reads is<br />
desired. To guarantee uncorrupted writes insert<br />
while(WR)continue;<br />
before calling EEPROM_READ().<br />
*/</p>
<p>#if _EEPROMSIZE &gt; 0 &amp;&amp; defined(_PLIB)<br />
#define EEPROM_READ(addr) Read_b_eep(addr)<br />
#define eeprom_read(addr) Read_b_eep(addr)<br />
#else<br />
#define EEPROM_READ(addr) 0 // Added only for code portability<br />
#define eeprom_read(addr) 0<br />
#endif</p>
<p>#if _EEPROMSIZE &gt; 0 &amp;&amp; defined(_PLIB)<br />
#define EEPROM_WRITE(addr, value) (Busy_eep(), Write_b_eep(addr,value))<br />
#define eeprom_write(addr, value) (Busy_eep(), Write_b_eep(addr,value))<br />
#else<br />
#define EEPROM_WRITE(addr, value) // Added only for code portability<br />
#define eeprom_write(addr, value)<br />
#endif<br />
[/code]</p>
<p>The post <a href="https://perso.uclouvain.be/tom.barbette/read-and-write-pic-eeprom/">Read and write PIC EEPROM</a> appeared first on <a href="https://perso.uclouvain.be/tom.barbette">Tom Barbette</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
