<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pauljmac.com/projects/index.php?action=history&amp;feed=atom&amp;title=DBL_Flusher</id>
	<title>DBL Flusher - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pauljmac.com/projects/index.php?action=history&amp;feed=atom&amp;title=DBL_Flusher"/>
	<link rel="alternate" type="text/html" href="https://pauljmac.com/projects/index.php?title=DBL_Flusher&amp;action=history"/>
	<updated>2026-04-21T14:18:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://pauljmac.com/projects/index.php?title=DBL_Flusher&amp;diff=3&amp;oldid=prev</id>
		<title>Paul: Created page with &quot;== Updates == &lt;section begin=updates /&gt;*DBL Flusher project is posted in its completeness. BOM, CODE, HARDWARE, and more is all posted. --Paul 13:58, 7 November 2007 (EST)&lt;section end=updates /&gt; &lt;section begin=oldnews /&gt; *Its been a month of testing and everything looks good. The device is still operating fine. I am working on polishing up the code and adding programmable time delay. But the hardest part is creating a template for the bracket, and its takin...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pauljmac.com/projects/index.php?title=DBL_Flusher&amp;diff=3&amp;oldid=prev"/>
		<updated>2024-12-08T16:05:50Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Updates == &amp;lt;section begin=updates /&amp;gt;*DBL Flusher project is posted in its completeness. BOM, CODE, HARDWARE, and more is all posted. --&lt;a href=&quot;/projects/index.php?title=User:Paul&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Paul (page does not exist)&quot;&gt;Paul&lt;/a&gt; 13:58, 7 November 2007 (EST)&amp;lt;section end=updates /&amp;gt; &amp;lt;section begin=oldnews /&amp;gt; *Its been a month of testing and everything looks good. The device is still operating fine. I am working on polishing up the code and adding programmable time delay. But the hardest part is creating a template for the bracket, and its takin...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Updates ==&lt;br /&gt;
&amp;lt;section begin=updates /&amp;gt;*DBL Flusher project is posted in its completeness. BOM, CODE, HARDWARE, and more is all posted. --[[User:Paul|Paul]] 13:58, 7 November 2007 (EST)&amp;lt;section end=updates /&amp;gt;&lt;br /&gt;
&amp;lt;section begin=oldnews /&amp;gt;&lt;br /&gt;
*Its been a month of testing and everything looks good. The device is still operating fine. I am working on polishing up the code and adding programmable time delay. But the hardest part is creating a template for the bracket, and its taking a long time to get that to where I want it to be. I will soon flood the page with all this stuff once I&amp;#039;m satisfied with it. --[[User:Paul|Paul]] 13:18, 1 November 2007 (EDT)&lt;br /&gt;
*Its been over a week with my DBL Flusher installed on the potty and so far so good. I am waiting to see how long the battery lasts to device if any further changes need to be made. --[[User:Paul|Paul]] 17:39, 22 September 2007 (EDT)&lt;br /&gt;
*I have completed the DBL flusher code to my likening. The device is currently installed in my home toilet for testing. Pics and video soon to follow! --[[User:Paul|Paul]] 22:33, 11 September 2007 (EDT)&lt;br /&gt;
*Boards arrived on sat. I got all the stuff on them and they work great. I have some preliminary code that Ive tried out and it works great. More to come later on in the week. --[[User:Paul|Paul]] 11:59, 10 September 2007 (EDT)&lt;br /&gt;
*The PCBs are inbound. I am eager to receive them and get to work! If all goes according to plan (haha!) I feel like I should have a working model by Monday (if i receive them tomorrow).--[[User:Paul|Paul]] 15:15, 6 September 2007 (EDT)&lt;br /&gt;
*I made the first bracket to suspend the servo in the filler tank in the potty. Images have been uploaded. --[[User:Paul|Paul]] 12:36, 21 August 2007 (EDT)&lt;br /&gt;
*I am currently waiting on parts and will soon be ordering the first PCB. This project will be my first attempt at working with SMD components. After bench testing with the parts I will order the PCB. --[[User:Paul|Paul]] 13:17, 16 August 2007 (EDT)&lt;br /&gt;
*Reworked the PCB. The new design uses a different PIC with more I/O. I did all I could to avoid changing the PIC but in the end it seemed like the cheapest method for me to get working prototype. I was short I/O on the 84a and I would have had to do some fancy things to get what I wanted, which meant more components, and more PCB space. The new PIC allows me to implement ICSP easily which makes development so much smoother. Also the new design uses two 2-digit 7-segment displays for a total of 4 digits. Once I&amp;#039;m happy with the BOM I will order the parts and the PCB shortly after. --Paul 17:26, 6 August 2007 (EDT)&lt;br /&gt;
&lt;br /&gt;
*Added a schematic of the [[DBL Flusher]] to the DBL flusher page along with the PCB layout. --[[User:Paul|Paul]] 21:39, 30 July 2007 (EDT)&lt;br /&gt;
&amp;lt;section end=oldnews /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
The DBL Flusher is a device that will automatically flush a toilet. A PIC micro controller is used to control the device. A small control board is placed on top the fill tank of the toilet with a leash to a servo that is inside the tank. A bracket is used to suspend the servo in the proper position inside the tank allowing it to flush the toilet while still allowing manual flushing. The control board has 2 buttons and a 3 digit 7 segment display. 1 button is used to set the number of flushes that will be made while the other starts the automation control. The default number of flushes is 1. When the start button is pressed a count down is started and displayed on the 7 segment display. When the count down reaches 0 the servo is driven to flush the toilet and then resets for the next flush. If only 1 flush was selected the device will go to sleep and wait for the next use. If not the device will reset and flush again. The device will continue doing so until the number of flushes desired is achieved. &lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&amp;lt;table border=0 cellpadding=0 cellspacing=0 width=968 style=&amp;#039;border-collapse:&lt;br /&gt;
 collapse;table-layout:fixed;width:726pt&amp;#039;&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 width=128 style=&amp;#039;height:15.0pt;width:96pt&amp;#039;&amp;gt;Part Decription&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=363 style=&amp;#039;width:272pt&amp;#039;&amp;gt;Part&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt; &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=195 style=&amp;#039;width:146pt&amp;#039;&amp;gt;Mouser PN&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65 width=37 style=&amp;#039;width:28pt&amp;#039;&amp;gt;Qty&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 width=53 style=&amp;#039;width:40pt&amp;#039;&amp;gt;Price&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=64 style=&amp;#039;width:48pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=64 style=&amp;#039;width:48pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=64 style=&amp;#039;width:48pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Servo&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;HiTech HS-322HD&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;*&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;  &amp;lt;/span&amp;gt;395760&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;16.9500&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;7-seg display&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Kingbright BC56-12GWA&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;604-BC5612GWA&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;2.7300&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;10K 1206 Resistors&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;KOA Speer RK73H2BTTD1002F&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;660-RK73H2BTTD1002F&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;3&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.1000&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;4.7K 1206 Resistors&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;KOA Speer RK73H2BTTD4751F&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;  &amp;lt;/span&amp;gt;660-RK73H2BTTD4751F&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.1000&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;1K 1206 Resistors&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;KOA Speer RK73H2BTTD1001F&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;660-RK73H2BTTD1001F&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;3&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.1000&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Battery Holder&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Eagle Plastic Devices, 4 D cells. 12BH144A-GR&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;12BH144A-GR&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;1.8900&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;100Ohm R Network&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Bourns QSOP 2QSP16-TJ1-101LF&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;652-2QSP16-TJ1-101LF&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;1.6800&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;TSV&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Vishay DO-214AA 5V TSV SMBJ5.0A-E3/52&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;625-SMBJ5.0A-E3&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;2&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.2800&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;MCLR Diode&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Vishay MELF Switching diode LS4148-GS08&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;78-LS4148&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.0600&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;MOSFET&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Fairchild N type RPP and Servo Sitching SOT-3 NDS335N&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;512-NDS335N&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;2&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.3900&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Headers&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;For ICSP and Servo con 649-68000-436HLF&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;68000-436HLF&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt; &amp;lt;/span&amp;gt;1/4&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.1200&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Crystal&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Murata SMD ceramic Resonator 4MHz CSTCR4M00G53-R0&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;81-CSTCR4M00G53&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.5600&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Transistors&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Central Simiconductor NPN SOT-23, 7seg Mux CMPT4401&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;610-CMPT4401&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;3&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.2000&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;PIC&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Microchip PIC MCU16F872 SOIC-28 PIC16F872-I/SO&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;579-PIC16F872-I/SO&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;4.8400&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Voltage Regulator&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;5V regulator STMicro L7805CV TO-220&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;511-L7805CV&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.2400&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Decoupleing Cap&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;30pF Ceramic Radial 140-50N5-200J-TB-RC&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;140-50N5-200J-TB-RC&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.0600&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Cap&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;1uF Electrolytic Xicon 140-XRL25V1.0-RC&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;140-XRL25V1.0-RC&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.0600&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Cap&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;.1uF Electrolytic Xicon 140-XRL100V0.1-RC&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;140-XRL100V0.1-RC&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.0600&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Red Switch&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;NO MO Red 104-0012-EVX&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;104-0012-EVX&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.8700&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Black Switch&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;NO MO Black 104-0013-EVX&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;104-0013-EVX&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;0.8700&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;PCB&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Circuit Board&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;15.0000&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;Sheet Metal&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;Sheet metal for the servo bracket with various parts&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl65&amp;gt;1&amp;lt;span style=&amp;#039;mso-spacerun:yes&amp;#039;&amp;gt;    &amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td class=xl66 align=right&amp;gt;10.0000&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=3 class=xl66 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 colspan=8 style=&amp;#039;height:15.0pt;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td height=20 style=&amp;#039;height:15.0pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;* Servo is only avaliable from Jameco&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td colspan=6 style=&amp;#039;mso-ignore:colspan&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;tr height=0 style=&amp;#039;display:none&amp;#039;&amp;gt;&lt;br /&gt;
  &amp;lt;td width=128 style=&amp;#039;width:96pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=363 style=&amp;#039;width:272pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=195 style=&amp;#039;width:146pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=37 style=&amp;#039;width:28pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=53 style=&amp;#039;width:40pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=64 style=&amp;#039;width:48pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=64 style=&amp;#039;width:48pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td width=64 style=&amp;#039;width:48pt&amp;#039;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
spelling not guaranteed correct. But hey, it works so it docent matter. Its not like it keeps the names anyway when you disassemble it...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;**********************************************************************&lt;br /&gt;
;                                                                     *&lt;br /&gt;
;    Filename:	    main.asm                                          *&lt;br /&gt;
;    Date:          10/13/07                                          *&lt;br /&gt;
;    File Version:   1.0                                              *&lt;br /&gt;
;                                                                     *&lt;br /&gt;
;    Author:       Paul Mac                                           *&lt;br /&gt;
;                                                                     * &lt;br /&gt;
;                                                                     *&lt;br /&gt;
;**********************************************************************&lt;br /&gt;
;                                                                     *&lt;br /&gt;
;    Files required:   P16F872.INC                                    *&lt;br /&gt;
;                                                                     *&lt;br /&gt;
;                                                                     *&lt;br /&gt;
;                                                                     *&lt;br /&gt;
;**********************************************************************&lt;br /&gt;
;                                                                     *&lt;br /&gt;
;    Notes:  RC0 is start button. RC1 is the increment button. Both   *&lt;br /&gt;
;     buttons are idle high.                                          *&lt;br /&gt;
;                                                                     *&lt;br /&gt;
;                                                                     *&lt;br /&gt;
;                                                                     *&lt;br /&gt;
;**********************************************************************&lt;br /&gt;
&lt;br /&gt;
	list      p=16f872            ; list directive to define processor&lt;br /&gt;
	#include &amp;lt;p16f872.inc&amp;gt;        ; processor specific variable definitions&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
	__CONFIG _CP_OFF &amp;amp; _WDT_OFF &amp;amp; _BODEN_OFF &amp;amp; _PWRTE_OFF &amp;amp; _XT_OSC &amp;amp; _WRT_ENABLE_OFF &amp;amp; _LVP_OFF &amp;amp; _CPD_OFF&lt;br /&gt;
&lt;br /&gt;
; &amp;#039;__CONFIG&amp;#039; directive is used to embed configuration data within .asm file.&lt;br /&gt;
; The lables following the directive are located in the respective .inc file.&lt;br /&gt;
; See respective data sheet for additional information on configuration word.&lt;br /&gt;
&lt;br /&gt;
ERRORLEVEL -302 ;remove message about using proper bank&lt;br /&gt;
&lt;br /&gt;
ORG 0x2100&lt;br /&gt;
DE	1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	cblock	0x20&lt;br /&gt;
	d1,d2,d3&lt;br /&gt;
	dig1,dig2,dig3&lt;br /&gt;
	sec, loop, flush, i&lt;br /&gt;
	hundreds, tens_and_ones, bin, limit, sleeps, sleepn, counter&lt;br /&gt;
	endc&lt;br /&gt;
;**********************************************************************&lt;br /&gt;
	ORG     0x000		; processor reset vector&lt;br /&gt;
	clrf    PCLATH		; ensure page bits are cleared&lt;br /&gt;
  	goto    Main		; go to beginning of program&lt;br /&gt;
Main&lt;br /&gt;
	clrf	PORTA&lt;br /&gt;
	clrf	PORTB&lt;br /&gt;
	clrf	PORTC&lt;br /&gt;
	movlw	0x06&lt;br /&gt;
	BANKSEL	ADCON1&lt;br /&gt;
	movwf	ADCON1&lt;br /&gt;
	BANKSEL	TRISA				;bank 1&lt;br /&gt;
	clrf	TRISA&lt;br /&gt;
	clrf	TRISB&lt;br /&gt;
	movlw	b&amp;#039;00000011&amp;#039;&lt;br /&gt;
	movwf	TRISC&lt;br /&gt;
	BANKSEL	PORTC&lt;br /&gt;
	movlw	d&amp;#039;1&amp;#039;&lt;br /&gt;
	movwf	flush				; the flush counter&lt;br /&gt;
	movlw	d&amp;#039;3&amp;#039;		&lt;br /&gt;
	movwf	limit				; the max amount of flushes alloud&lt;br /&gt;
	call 	SetupSleep	&lt;br /&gt;
	clrf	sleeps&lt;br /&gt;
	call 	DisplayOn&lt;br /&gt;
Buttons&lt;br /&gt;
	btfsc	sleeps,0&lt;br /&gt;
	call	DisplayOff&lt;br /&gt;
	btfss	PORTC,0			; test start button&lt;br /&gt;
	goto	SetupTimer	&lt;br /&gt;
	btfss	PORTC,1			;test inc button&lt;br /&gt;
	call	Inc&lt;br /&gt;
	movf	flush,w				; call the flush value to display it&lt;br /&gt;
	movwf	bin&lt;br /&gt;
	call	binary_to_bcd&lt;br /&gt;
	movf	tens_and_ones,0			;bring BCD ones and tens into W&lt;br /&gt;
	andlw	b&amp;#039;00001111&amp;#039;				;mask the junk &lt;br /&gt;
	movwf	dig1&lt;br /&gt;
	movf	dig1,0			;move the digi into W to get ready to display it&lt;br /&gt;
	call 	LookupA&lt;br /&gt;
	movwf	PORTA&lt;br /&gt;
	movf	dig1,0&lt;br /&gt;
	call 	LookupB&lt;br /&gt;
	movwf	PORTB&lt;br /&gt;
	call	FourtyMS&lt;br /&gt;
	call	SleepR&lt;br /&gt;
	goto	Buttons&lt;br /&gt;
SetupSleep&lt;br /&gt;
	movlw	d&amp;#039;255&amp;#039;&lt;br /&gt;
	movwf	sleepn			; setup the sleep counter&lt;br /&gt;
	return&lt;br /&gt;
DisplayOff&lt;br /&gt;
	bcf		PORTC,7&lt;br /&gt;
	return&lt;br /&gt;
DisplayOn&lt;br /&gt;
	bsf		PORTC,7&lt;br /&gt;
	return&lt;br /&gt;
SleepR&lt;br /&gt;
	decfsz	sleepn,f			; decrement the sleep counter&lt;br /&gt;
	return&lt;br /&gt;
	movlw	d&amp;#039;1&amp;#039;				;set the sleep var to 1 to put it to sleep when its time&lt;br /&gt;
	movwf	sleeps				&lt;br /&gt;
	return&lt;br /&gt;
Inc&lt;br /&gt;
	clrf	sleeps&lt;br /&gt;
	call 	SetupSleep&lt;br /&gt;
	call 	DisplayOn&lt;br /&gt;
	btfsc	PORTC,1		;test inc button&lt;br /&gt;
	goto	Buttons&lt;br /&gt;
	incf	flush,f		; incriment counter&lt;br /&gt;
	movf	flush,w		;move flush to the W&lt;br /&gt;
	subwf	limit,w		; TEST TO MAK SURE THE INC IS LESS THAN THE LIMIT&lt;br /&gt;
	btfsc	STATUS,Z&lt;br /&gt;
	goto	SetFlush&lt;br /&gt;
	btfss	STATUS,C&lt;br /&gt;
	goto	SetFlush&lt;br /&gt;
Release&lt;br /&gt;
	call 	Debounce	;20mS debounce delay&lt;br /&gt;
	btfsc	PORTC,1		;test inc button&lt;br /&gt;
	return&lt;br /&gt;
	call	FourtyMS&lt;br /&gt;
	goto	Release&lt;br /&gt;
&lt;br /&gt;
SetFlush&lt;br /&gt;
	movlw	d&amp;#039;1&amp;#039;&lt;br /&gt;
	movwf	flush&lt;br /&gt;
	goto	Release&lt;br /&gt;
SetupTimer&lt;br /&gt;
	call 	FourtyMS	;40mS debounce delay&lt;br /&gt;
	call 	FourtyMS	;40mS debounce delay&lt;br /&gt;
	call 	FourtyMS	;40mS debounce delay&lt;br /&gt;
	call 	FourtyMS	;40mS debounce delay&lt;br /&gt;
	movlw	d&amp;#039;120&amp;#039;				; delay seconds&lt;br /&gt;
	movwf	sec&lt;br /&gt;
Start&lt;br /&gt;
	movf	sec,w&lt;br /&gt;
	movwf	bin			; bin is the variable that is BCD&amp;#039;d&lt;br /&gt;
	call	binary_to_bcd&lt;br /&gt;
	movf	hundreds,w&lt;br /&gt;
	movwf	dig3&lt;br /&gt;
	swapf	tens_and_ones,0			; swap the nibbles in BCD and put it in W&lt;br /&gt;
	andlw	b&amp;#039;00001111&amp;#039;		; mask the crap, leaves the clean number in W&lt;br /&gt;
	movwf	dig2			; put it in the 2nd digit holder&lt;br /&gt;
	movf	tens_and_ones,0			;bring BCD back into W&lt;br /&gt;
	andlw	b&amp;#039;00001111&amp;#039;		;mask the crap&lt;br /&gt;
	movwf	dig1&lt;br /&gt;
Print&lt;br /&gt;
	movlw	0xFA				; loop count for 1 sec&lt;br /&gt;
	movwf	loop&lt;br /&gt;
MuxLoop&lt;br /&gt;
	movf	dig3,0			;move the digi into W to get ready to display it&lt;br /&gt;
	call 	LookupA&lt;br /&gt;
	movwf	PORTA&lt;br /&gt;
	movf	dig3,0&lt;br /&gt;
	call 	LookupB&lt;br /&gt;
	movwf	PORTB&lt;br /&gt;
	movlw	b&amp;#039;00100000&amp;#039;			;strobe the 3nd digit&lt;br /&gt;
	movwf	PORTC&lt;br /&gt;
	call 	MuxDelay&lt;br /&gt;
	movf	dig2,0			;move the digi into W to get ready to display it&lt;br /&gt;
	call 	LookupA&lt;br /&gt;
	movwf	PORTA&lt;br /&gt;
	movf	dig2,0&lt;br /&gt;
	call 	LookupB&lt;br /&gt;
	movwf	PORTB&lt;br /&gt;
	movlw	b&amp;#039;01000000&amp;#039;			;strobe the 2nd digit&lt;br /&gt;
	movwf	PORTC&lt;br /&gt;
	call 	MuxDelay&lt;br /&gt;
	movf	dig1,0			;move the digi into W to get ready to display it&lt;br /&gt;
	call 	LookupA&lt;br /&gt;
	movwf	PORTA&lt;br /&gt;
	movf	dig1,0&lt;br /&gt;
	call 	LookupB&lt;br /&gt;
	movwf	PORTB&lt;br /&gt;
	movlw	b&amp;#039;10000000&amp;#039;			;strobe the 1st digit&lt;br /&gt;
	movwf	PORTC&lt;br /&gt;
	call 	MuxDelay&lt;br /&gt;
	btfss	PORTC,0			; test start button for cancelation&lt;br /&gt;
	goto	Cancle&lt;br /&gt;
	decfsz	loop,f				;decrement loop counter, do it 250 times for 1 second&lt;br /&gt;
	goto	MuxLoop&lt;br /&gt;
	decfsz	sec,f				;decrement sec counter, do it however many times&lt;br /&gt;
	goto	Start&lt;br /&gt;
	call	ServoDrive&lt;br /&gt;
	BANKSEL flush&lt;br /&gt;
	decfsz	flush,f&lt;br /&gt;
	goto	SetupTimer&lt;br /&gt;
	goto	Main&lt;br /&gt;
Cancle&lt;br /&gt;
	movlw	b&amp;#039;00011111&amp;#039;&lt;br /&gt;
	andwf	PORTC,f&lt;br /&gt;
	btfss	PORTC,0			; test start button for cancelation&lt;br /&gt;
	goto	Cancle&lt;br /&gt;
	call	FourtyMS&lt;br /&gt;
	call 	Debounce	;20mS debounce delay&lt;br /&gt;
	goto	Main&lt;br /&gt;
ServoDrive&lt;br /&gt;
	call 	Hone&lt;br /&gt;
	call	OneEighty&lt;br /&gt;
	BANKSEL EEADR&lt;br /&gt;
	movlw	0&lt;br /&gt;
	movwf	EEADR&lt;br /&gt;
	BANKSEL	EECON1&lt;br /&gt;
	BCF		EECON1,EEPGD&lt;br /&gt;
	BSF		EECON1,RD&lt;br /&gt;
	BANKSEL EEDATA&lt;br /&gt;
	MOVF	EEDATA,w&lt;br /&gt;
	BANKSEL	counter&lt;br /&gt;
	MOVWF	counter&lt;br /&gt;
	INCF	counter&lt;br /&gt;
&lt;br /&gt;
	BANKSEL EEADR&lt;br /&gt;
	movlw 	0&lt;br /&gt;
	movwf	EEADR&lt;br /&gt;
	BANKSEL	counter&lt;br /&gt;
	movf	counter,w&lt;br /&gt;
	BANKSEL	EEDATA&lt;br /&gt;
	movwf	EEDATA&lt;br /&gt;
	BANKSEL	EECON1&lt;br /&gt;
	BCF		EECON1,EEPGD&lt;br /&gt;
	BSF		EECON1,WREN&lt;br /&gt;
	MOVLW	0x55&lt;br /&gt;
	MOVWF	EECON2&lt;br /&gt;
	MOVLW	0xAA&lt;br /&gt;
	MOVWF	EECON2&lt;br /&gt;
	BSF		EECON1,WR&lt;br /&gt;
	BCF		EECON1,WREN&lt;br /&gt;
&lt;br /&gt;
EEPROMcheck	&lt;br /&gt;
	btfsc	EECON1,WR		&lt;br /&gt;
	goto	EEPROMcheck&lt;br /&gt;
	return&lt;br /&gt;
LookupA&lt;br /&gt;
	addwf	0x02,f&lt;br /&gt;
	retlw	b&amp;#039;00000001&amp;#039;		;0&lt;br /&gt;
	retlw	0x00			;1&lt;br /&gt;
	retlw	b&amp;#039;00000011&amp;#039;		;2&lt;br /&gt;
	retlw	b&amp;#039;00000011&amp;#039;		;3&lt;br /&gt;
	retlw	b&amp;#039;00000010&amp;#039;		;4&lt;br /&gt;
	retlw	b&amp;#039;00000011&amp;#039;		;5&lt;br /&gt;
	retlw	b&amp;#039;00000011&amp;#039;		;6&lt;br /&gt;
	retlw	0x00			;7&lt;br /&gt;
	retlw	b&amp;#039;00000011&amp;#039;		;8&lt;br /&gt;
	retlw	b&amp;#039;00000010&amp;#039;		;9&lt;br /&gt;
LookupB&lt;br /&gt;
	addwf	0x02,f&lt;br /&gt;
	retlw	b&amp;#039;00110111&amp;#039;		;0&lt;br /&gt;
	retlw	b&amp;#039;00000110&amp;#039;		;1&lt;br /&gt;
	retlw	b&amp;#039;00010011&amp;#039;		;2&lt;br /&gt;
	retlw	b&amp;#039;00000111&amp;#039;		;3&lt;br /&gt;
	retlw	b&amp;#039;00100110&amp;#039;		;4&lt;br /&gt;
	retlw	b&amp;#039;00100101&amp;#039;		;5&lt;br /&gt;
	retlw	b&amp;#039;00110100&amp;#039;		;6&lt;br /&gt;
	retlw	b&amp;#039;00000111&amp;#039;		;7&lt;br /&gt;
	retlw	b&amp;#039;00110111&amp;#039;		;8&lt;br /&gt;
	retlw	b&amp;#039;00100111&amp;#039;		;9&lt;br /&gt;
Hone&lt;br /&gt;
	movlw	d&amp;#039;75&amp;#039;&lt;br /&gt;
	movwf	i&lt;br /&gt;
	movlw	b&amp;#039;00001000&amp;#039;			; turn on the FET&lt;br /&gt;
	xorwf	PORTC,f&lt;br /&gt;
Hone0&lt;br /&gt;
	movlw	b&amp;#039;00000100&amp;#039;			; 1ms pulse to put the servo somewhere IDK GOD&lt;br /&gt;
	xorwf	PORTC,f&lt;br /&gt;
	call	ZeroDegre&lt;br /&gt;
	movlw	b&amp;#039;11111011&amp;#039;&lt;br /&gt;
	addwf	PORTC,f&lt;br /&gt;
	call	ZeroDegreR&lt;br /&gt;
	decfsz	i,f					; make the loop happen 5 secdonds worth (250 times)&lt;br /&gt;
	goto	Hone0&lt;br /&gt;
	movlw	b&amp;#039;11110111&amp;#039;			; turn off the FET&lt;br /&gt;
	andwf	PORTC,f&lt;br /&gt;
	return&lt;br /&gt;
OneEighty&lt;br /&gt;
	movlw	d&amp;#039;75&amp;#039;&lt;br /&gt;
	movwf	i&lt;br /&gt;
	movlw	b&amp;#039;00001000&amp;#039;			; turn on the FET&lt;br /&gt;
	xorwf	PORTC,f&lt;br /&gt;
OneEighty0&lt;br /&gt;
	movlw	b&amp;#039;00000100&amp;#039;			; 2ms pulse to put the servo somewhere IDK GOD&lt;br /&gt;
	xorwf	PORTC,f&lt;br /&gt;
	call	OneEightDegre&lt;br /&gt;
	movlw	b&amp;#039;11111011&amp;#039;&lt;br /&gt;
	addwf	PORTC,f&lt;br /&gt;
	call	OneEightDegreR&lt;br /&gt;
	decfsz	i,f					; make the loop happen 5 secdonds worth (250 times)&lt;br /&gt;
	goto	OneEighty0&lt;br /&gt;
	movlw	b&amp;#039;11110111&amp;#039;			; Turn off the FETS&lt;br /&gt;
	andwf	PORTC,f&lt;br /&gt;
	return&lt;br /&gt;
FourtyMS&lt;br /&gt;
			;39993 cycles&lt;br /&gt;
	movlw	0x3E&lt;br /&gt;
	movwf	d1&lt;br /&gt;
	movlw	0x20&lt;br /&gt;
	movwf	d2&lt;br /&gt;
FourtyMS_0&lt;br /&gt;
	decfsz	d1, f&lt;br /&gt;
	goto	$+2&lt;br /&gt;
	decfsz	d2, f&lt;br /&gt;
	goto	FourtyMS_0&lt;br /&gt;
&lt;br /&gt;
			;3 cycles&lt;br /&gt;
	goto	$+1&lt;br /&gt;
	nop&lt;br /&gt;
&lt;br /&gt;
			;4 cycles (including call)&lt;br /&gt;
	return&lt;br /&gt;
Debounce						;20mS delay&lt;br /&gt;
			;19993 cycles&lt;br /&gt;
	movlw	0x9E&lt;br /&gt;
	movwf	d1&lt;br /&gt;
	movlw	0x10&lt;br /&gt;
	movwf	d2&lt;br /&gt;
Debounce_0&lt;br /&gt;
	decfsz	d1, f&lt;br /&gt;
	goto	$+2&lt;br /&gt;
	decfsz	d2, f&lt;br /&gt;
	goto	Debounce_0&lt;br /&gt;
&lt;br /&gt;
			;3 cycles&lt;br /&gt;
	goto	$+1&lt;br /&gt;
	nop&lt;br /&gt;
&lt;br /&gt;
			;4 cycles (including call)&lt;br /&gt;
	return&lt;br /&gt;
MuxDelay&lt;br /&gt;
			;1323 cycles&lt;br /&gt;
	movlw	0x08&lt;br /&gt;
	movwf	d1&lt;br /&gt;
	movlw	0x02&lt;br /&gt;
	movwf	d2&lt;br /&gt;
MuxDelay_0&lt;br /&gt;
	decfsz	d1, f&lt;br /&gt;
	goto	$+2&lt;br /&gt;
	decfsz	d2, f&lt;br /&gt;
	goto	MuxDelay_0&lt;br /&gt;
&lt;br /&gt;
			;4 cycles&lt;br /&gt;
	goto	$+1&lt;br /&gt;
	goto	$+1&lt;br /&gt;
&lt;br /&gt;
			;4 cycles (including call)&lt;br /&gt;
	return&lt;br /&gt;
ZeroDegre&lt;br /&gt;
			;893 cycles&lt;br /&gt;
	movlw	0x73			;B2 is orgional vlaue&lt;br /&gt;
	movwf	d1&lt;br /&gt;
	movlw	0x01&lt;br /&gt;
	movwf	d2&lt;br /&gt;
ZeroDegre_0&lt;br /&gt;
	decfsz	d1, f&lt;br /&gt;
	goto	$+2&lt;br /&gt;
	decfsz	d2, f&lt;br /&gt;
	goto	ZeroDegre_0&lt;br /&gt;
&lt;br /&gt;
			;3 cycles&lt;br /&gt;
	goto	$+1&lt;br /&gt;
	nop&lt;br /&gt;
&lt;br /&gt;
			;4 cycles (including call)&lt;br /&gt;
	return&lt;br /&gt;
&lt;br /&gt;
ZeroDegreR&lt;br /&gt;
			;19093 cycles&lt;br /&gt;
	movlw	0xEA				;EA is orgional Value&lt;br /&gt;
	movwf	d1&lt;br /&gt;
	movlw	0x0F&lt;br /&gt;
	movwf	d2&lt;br /&gt;
ZeroDegreR_0&lt;br /&gt;
	decfsz	d1, f&lt;br /&gt;
	goto	$+2&lt;br /&gt;
	decfsz	d2, f&lt;br /&gt;
	goto	ZeroDegreR_0&lt;br /&gt;
&lt;br /&gt;
			;3 cycles&lt;br /&gt;
	goto	$+1&lt;br /&gt;
	nop&lt;br /&gt;
&lt;br /&gt;
			;4 cycles (including call)&lt;br /&gt;
	return&lt;br /&gt;
&lt;br /&gt;
OneEightDegre&lt;br /&gt;
			;2093 cycles&lt;br /&gt;
	movlw	0xC8				; A2 orgional value&lt;br /&gt;
	movwf	d1&lt;br /&gt;
	movlw	0x02&lt;br /&gt;
	movwf	d2&lt;br /&gt;
OneEightDegre_0&lt;br /&gt;
	decfsz	d1, f&lt;br /&gt;
	goto	$+2&lt;br /&gt;
	decfsz	d2, f&lt;br /&gt;
	goto	OneEightDegre_0&lt;br /&gt;
&lt;br /&gt;
			;3 cycles&lt;br /&gt;
	goto	$+1&lt;br /&gt;
	nop&lt;br /&gt;
&lt;br /&gt;
			;4 cycles (including call)&lt;br /&gt;
	return&lt;br /&gt;
OneEightDegreR&lt;br /&gt;
			;17893 cycles&lt;br /&gt;
	movlw	0xFA&lt;br /&gt;
	movwf	d1&lt;br /&gt;
	movlw	0x0E&lt;br /&gt;
	movwf	d2&lt;br /&gt;
OneEightDegreR_0&lt;br /&gt;
	decfsz	d1, f&lt;br /&gt;
	goto	$+2&lt;br /&gt;
	decfsz	d2, f&lt;br /&gt;
	goto	OneEightDegreR_0&lt;br /&gt;
&lt;br /&gt;
			;3 cycles&lt;br /&gt;
	goto	$+1&lt;br /&gt;
	nop&lt;br /&gt;
&lt;br /&gt;
			;4 cycles (including call)&lt;br /&gt;
	return&lt;br /&gt;
binary_to_bcd&lt;br /&gt;
	CLRF	hundreds &lt;br /&gt;
	SWAPF	bin,w 			;w  = A0*16+A1&lt;br /&gt;
	ADDWF	bin,w 			;w  = A0+A1&lt;br /&gt;
	ANDLW	b&amp;#039;00001111&amp;#039; 	;w  = A0+A1 % 16&lt;br /&gt;
	SKPNDC 					;if A0+A1 &amp;gt; 16&lt;br /&gt;
	ADDLW	0x16 			;w  += 16&lt;br /&gt;
	SKPNDC 					;if w % 16 &amp;gt; 10&lt;br /&gt;
	ADDLW	0x06 			;w  += 6&lt;br /&gt;
	ADDLW 	0x06 			;w  += 6&lt;br /&gt;
	SKPDC 					;if w &amp;lt; 10&lt;br /&gt;
	ADDLW	-0x06 			;w  -= 6&lt;br /&gt;
&lt;br /&gt;
	BTFSC	bin,4 &lt;br /&gt;
	ADDLW	0x16 - 1 + 0x6 &lt;br /&gt;
	SKPDC &lt;br /&gt;
	ADDLW	-0x06 &lt;br /&gt;
&lt;br /&gt;
	BTFSC	bin,5 &lt;br /&gt;
	ADDLW	0x30 &lt;br /&gt;
	&lt;br /&gt;
	BTFSC	bin,6 &lt;br /&gt;
	ADDLW	0x60 &lt;br /&gt;
&lt;br /&gt;
	BTFSC	bin,7 &lt;br /&gt;
	ADDLW	0x20 &lt;br /&gt;
&lt;br /&gt;
	ADDLW	0x60 &lt;br /&gt;
	RLF		hundreds,f &lt;br /&gt;
	BTFSS	hundreds, 0 &lt;br /&gt;
	ADDLW 	-0x60 &lt;br /&gt;
&lt;br /&gt;
	MOVWF	tens_and_ones &lt;br /&gt;
	BTFSC	bin,7 &lt;br /&gt;
	INCF	hundreds,f &lt;br /&gt;
	return&lt;br /&gt;
&lt;br /&gt;
	END                       ; directive &amp;#039;end of program&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Schematic ==&lt;br /&gt;
[[Image:DBLschem.png]]&lt;br /&gt;
&lt;br /&gt;
== Board ==&lt;br /&gt;
[https://www.batchpcb.com/login.php?osCsid=ef6e564f68fd7b680e717a1675aacff4] Batch PCB board. (login required to view/buy)&lt;br /&gt;
&lt;br /&gt;
[[Image:DBLFlusherboard.png]]&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
This is the bracket used to suspend the servo in position in the water tank of the potty. &lt;br /&gt;
&lt;br /&gt;
A 1:1 PDF template of the bracket assembly is here [[Media:Bracket.pdf]]‎&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:DBL flusher bracket.jpg| Top &lt;br /&gt;
Image:DBL flusher bracket1.jpg| Side&lt;br /&gt;
Image:DBL flusher bracket2.jpg| Front&lt;br /&gt;
Image:DBL flusher bracket3.jpg| Front&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pictures ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:DBLFassembled.JPG| Fully assembled DBL Flusher in place. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Paul</name></author>
	</entry>
</feed>