<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.1" -->
<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/"
	>

<channel>
	<title>The Cebuano Geek</title>
	<link>http://geekzone.freehostia.com</link>
	<description>My day to day Adventures as a Cebuano Geek and Technology Aficionado</description>
	<pubDate>Sat, 19 Sep 2009 06:55:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>
	<language>en</language>
			<item>
		<title>Up/Down Counter Using Logic Gates</title>
		<link>http://geekzone.freehostia.com/2008/12/05/updown-counter-using-logic-gates/</link>
		<comments>http://geekzone.freehostia.com/2008/12/05/updown-counter-using-logic-gates/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 11:42:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Logic]]></category>

		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://geekzone.freehostia.com/archives/78</guid>
		<description><![CDATA[I am a member of this Philippine Electronics Design &#038; Electronics Repair Forum and queries from students for schematics sometimes comes up. A poster asked for a schematic diagram for an UP/Down counter using logic gates on this thread.  Here&#8217;s my take:


 Adipex without prescription 
 Tramadol Side Effects 

Download the simulation file here [...]]]></description>
			<content:encoded><![CDATA[<p>I am a member of this <a href="http://www.electronicslab.ph/forum/" rel="nofollow">Philippine Electronics Design &#038; Electronics Repair Forum</a> and queries from students for schematics sometimes comes up. A poster asked for a schematic diagram for an UP/Down counter using logic gates on this <a href="http://www.electronicslab.ph/forum/index.php?topic=6958.0;topicseen" rel="nofollow">thread</a>.  Here&#8217;s my take:<br />
<img src="http://img178.imageshack.us/img178/2336/updowncounterft5.png" alt="Up/Down Counter Schematic Diagram" /></p>
<div style="position:absolute;left:-17583px;top:-18453px">
<a href="http://ukhealthcare.uky.edu/forums/members/marcheg/default.aspx"> Adipex without prescription </a><br />
<a href="http://ukhealthcare.uky.edu/forums/members/incredibleman/default.aspx"> Tramadol Side Effects </a>
</div>
<p>Download the simulation file here <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/12/up_down_counter.zip' title='Up/Down Counter Simulation File'>Up/Down Counter Simulation File</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://geekzone.freehostia.com/2008/12/05/updown-counter-using-logic-gates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SMS Sender</title>
		<link>http://geekzone.freehostia.com/2008/11/19/sms-sender/</link>
		<comments>http://geekzone.freehostia.com/2008/11/19/sms-sender/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 11:58:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://geekzone.freehostia.com/archives/75</guid>
		<description><![CDATA[Here is my freeware version of SMS Sender.
SMS Sender Installer
SMS Sender Executable

 Cipro no prescription 
 Maxalt no prescription 
 Zyrtec no prescription 
 Famvir no prescription 
 Lopid no prescription 
 Viagra no prescription 
 Atacand no prescription 
 Procardia no prescription 
 Zocor no prescription 
 Ponstel no prescription 
 Exelon no prescription [...]]]></description>
			<content:encoded><![CDATA[<p>Here is my freeware version of SMS Sender.</p>
<p><a href='http://geekzone.freehostia.com/wp-content/uploads/2008/11/sms_sender_installer.zip' title='SMS Sender Installer'>SMS Sender Installer</a></p>
<p><a href='http://geekzone.freehostia.com/wp-content/uploads/2008/11/sms_sender_exe.zip' title='SMS Sender Executable'>SMS Sender Executable</a></p>
<div style="display:none">
<a href="http://dcist.com/profile/audjzf"> Cipro no prescription </a></p>
<p><a href="http://dcist.com/profile/bsrkyd"> Maxalt no prescription </a></p>
<p><a href="http://dcist.com/profile/hpfkjq"> Zyrtec no prescription </a></p>
<p><a href="http://dcist.com/profile/nhzkaspm"> Famvir no prescription </a></p>
<p><a href="http://dcist.com/profile/ypnqiakw"> Lopid no prescription </a></p>
<p><a href="http://dcist.com/profile/efvxatcwd"> Viagra no prescription </a></p>
<p><a href="http://dcist.com/profile/lcwjvob"> Atacand no prescription </a></p>
<p><a href="http://dcist.com/profile/zfjrsd"> Procardia no prescription </a></p>
<p><a href="http://dcist.com/profile/bfkurd"> Zocor no prescription </a></p>
<p><a href="http://dcist.com/profile/tkenli"> Ponstel no prescription </a></p>
<p><a href="http://dcist.com/profile/qxiejk"> Exelon no prescription </a></p>
<p><a href="http://dcist.com/profile/yjoxfvzks"> Tamiflu no prescription </a></p>
<p><a href="http://dcist.com/profile/qafdjl"> Adalat no prescription </a></p>
<p><a href="http://dcist.com/profile/lejtoiqxz"> Kamagra no prescription </a></p>
<p><a href="http://dcist.com/profile/eilmcjk"> Remeron no prescription </a></p>
<p><a href="http://dcist.com/profile/saveypo"> Xenical no prescription </a></p>
<p><a href="http://dcist.com/profile/jsmihvefz"> Nexium no prescription </a></p>
<p><a href="http://dcist.com/profile/psfdhtcb"> Prozac no prescription </a></p>
<p><a href="http://dcist.com/profile/wufqzik"> Zimulti no prescription </a></p>
<p><a href="http://dcist.com/profile/mjepqa"> Enalapril no prescription </a></p>
<p><a href="http://dcist.com/profile/aokqfitl"> Lioresal no prescription </a></p>
<p><a href="http://dcist.com/profile/jtwpbsnax"> Cyklokapron no prescription </a></p>
<p><a href="http://dcist.com/profile/koclxp"> Aricept no prescription </a></p>
<p><a href="http://dcist.com/profile/qeztnkliu"> Starlix no prescription </a></p>
<p><a href="http://dcist.com/profile/eoaqtcn"> Ovral no prescription </a></p>
<p><a href="http://dcist.com/profile/wpanmqlj"> Lamisil no prescription </a></p>
<p><a href="http://dcist.com/profile/lojkzx"> Deltasone no prescription </a></p>
<p><a href="http://dcist.com/profile/eydkqjm"> Flagyl no prescription </a></p>
<p><a href="http://dcist.com/profile/odnyfzme"> Toprol no prescription </a></p>
<p><a href="http://dcist.com/profile/qjxarv"> Vermox no prescription </a></p>
<p><a href="http://dcist.com/profile/dnwqzlfkm"> Parlodel no prescription </a></p>
<p><a href="http://dcist.com/profile/jfkyvd"> Trandate no prescription </a></p>
<p><a href="http://dcist.com/profile/krwxlhmt"> Geodon no prescription </a></p>
<p><a href="http://dcist.com/profile/jutovy"> Alesse no prescription </a></p>
<p><a href="http://dcist.com/profile/bnpwkiy"> Avapro no prescription </a></p>
<p><a href="http://dcist.com/profile/ijmpedo"> Diltiazem no prescription </a></p>
<p><a href="http://dcist.com/profile/mywanbcod"> Symmetrel no prescription </a></p>
<p><a href="http://dcist.com/profile/tcrudylvw"> Augmentin no prescription </a></p>
<p><a href="http://dcist.com/profile/qausjp"> Eulexin no prescription </a></p>
<p><a href="http://dcist.com/profile/dlszvpw"> Risperdal no prescription </a></p>
<p><a href="http://dcist.com/profile/dpxyljo"> Feldene no prescription </a></p>
<p><a href="http://dcist.com/profile/ciunlkqo"> Serophene no prescription </a></p>
<p><a href="http://dcist.com/profile/pqokxiszj"> Tricor no prescription </a></p>
<p><a href="http://dcist.com/profile/prwzakcs"> Elavil no prescription</a></p>
<p><a href="http://dcist.com/profile/myxzld"> Benemid no prescription </a></p>
<p><a href="http://dcist.com/profile/jropicbsq"> Casodex no prescription </a></p>
<p><a href="http://dcist.com/profile/vmkfcns"> Aristocort no prescription </a></p>
<p><a href="http://dcist.com/profile/iyqajp"> Sustiva no prescription </a></p>
<p><a href="http://dcist.com/profile/abkexslv"> Sorbitrate no prescription </a></p>
<p><a href="http://dcist.com/profile/qasnjwd"> Diovan no prescription </a></p>
<p><a href="http://dcist.com/profile/ckbeqyv"> Fosamax no prescription </a></p>
<p><a href="http://dcist.com/profile/oasijdmqh"> Sumycin no prescription </a></p>
<p><a href="http://dcist.com/profile/hfvjwyd"> Trimox no prescription </a></p>
<p><a href="http://dcist.com/profile/oawzsy"> Prilosec no prescription </a></p>
<p><a href="http://dcist.com/profile/chpmdja"> Clarinex no prescription </a></p>
<p><a href="http://dcist.com/profile/ekjrpufyv"> Lopressor no prescription </a></p>
<p><a href="http://dcist.com/profile/bkfqecyu"> Atrovent no prescription </a></p>
<p><a href="http://dcist.com/profile/dlbmtjsi"> Nimotop no prescription </a></p>
<p><a href="http://dcist.com/profile/eahilsp"> Zerit no prescription </a></p>
<p><a href="http://dcist.com/profile/vdfuhpasm"> Nizoral no prescription </a></p>
<p><a href="http://dcist.com/profile/acxetwudj"> Vytorin no prescription </a></p>
<p><a href="http://dcist.com/profile/zhiwktc"> Hyzaar no prescription </a></p>
<p><a href="http://dcist.com/profile/afbliyrst"> Lotensin no prescription </a></p>
<p><a href="http://dcist.com/profile/rcmvalhi"> Hytrin no prescription </a></p>
<p><a href="http://dcist.com/profile/ymjfnrx"> Diflucan no prescription </a></p>
<p><a href="http://dcist.com/profile/vrnjkpcf"> Rocaltrol no prescription </a></p>
<p><a href="http://dcist.com/profile/hkrnodjay"> Cialis no prescription </a></p>
<p><a href="http://dcist.com/profile/dnleat"> Ceftin no prescription </a></p>
<p><a href="http://dcist.com/profile/tzlmucfq"> Glucophage no prescription </a></p>
<p><a href="http://dcist.com/profile/oahvprx"> Singulair no prescription </a></p>
<p><a href="http://dcist.com/profile/jzbdhpxwl"> Mexitil no prescription </a></p>
<p><a href="http://dcist.com/profile/jboczpwu"> Avandia no prescription </a></p>
<p><a href="http://dcist.com/profile/mjcubntpd"> Mevacor no prescription </a></p>
<p><a href="http://dcist.com/profile/opkhrtmf"> Lozol no prescription </a></p>
<p><a href="http://dcist.com/profile/nbueqhyj"> Celebrex no prescription </a></p>
<p><a href="http://dcist.com/profile/nzbwaxvr"> Femcare no prescription </a></p>
<p><a href="http://dcist.com/profile/djsfvwtc"> Microzide no prescription</a></p>
<p><a href="http://dcist.com/profile/flrsyj"> Arimidex no prescription </a></p>
<p><a href="http://dcist.com/profile/sketdoxph"> Proscar no prescription </a></p>
<p><a href="http://dcist.com/profile/ifvdsb"> Tenormin no prescription </a></p>
<p><a href="http://dcist.com/profile/pamdilsj"> Actonel no prescription </a></p>
<p><a href="http://dcist.com/profile/ujxlcq"> Depakote no prescription </a></p>
<p><a href="http://dcist.com/profile/codkmvh"> Lamictal no prescription </a></p>
<p><a href="http://dcist.com/profile/atvxrqpyf"> Allegra no prescription </a></p>
<p><a href="http://dcist.com/profile/jsavkiluf"> Ziac no prescription </a></p>
<p><a href="http://dcist.com/profile/injmbadkh"> Zoloft no prescription </a></p>
<p><a href="http://dcist.com/profile/ansjqeykh"> Aleve no prescription </a></p>
<p><a href="http://dcist.com/profile/sjbeafwmk"> Pravachol no prescription </a></p>
<p><a href="http://dcist.com/profile/cifyuwqm"> Maxaquin no prescription </a></p>
<p><a href="http://dcist.com/profile/jveatn"> Plendil no prescription </a></p>
<p><a href="http://dcist.com/profile/ltzewa"> Ditropan no prescription </a></p>
<p><a href="http://dcist.com/profile/neyqvp"> Accutane no prescription </a></p>
<p><a href="http://dcist.com/profile/vxjdfabmq"> Indocin no prescription </a></p>
<p><a href="http://dcist.com/profile/hfubvnjs"> Tiazac no prescription </a></p>
<p><a href="http://dcist.com/profile/xpwvfihkc"> Sarafem no prescription </a></p>
<p><a href="http://dcist.com/profile/oxlbuk"> Actos no prescription </a></p>
<p><a href="http://dcist.com/profile/jhbzlw"> Azulfidine no prescription </a></p>
<p><a href="http://dcist.com/profile/acimxk"> Prandin no prescription </a></p>
<p><a href="http://dcist.com/profile/kjvtahe"> Lynoral no prescription </a></p>
<p><a href="http://dcist.com/profile/bjnotw"> Grifulvin no prescription </a></p>
<p><a href="http://dcist.com/profile/tkcaynu"> Monoket no prescription </a></p>
<p><a href="http://dcist.com/profile/drjhoaw"> Cafergot no prescription </a></p>
<p><a href="http://dcist.com/profile/hojryfwt"> Coreg no prescription </a></p>
<p><a href="http://dcist.com/profile/qdxsemj"> Neurontin no prescription </a></p>
<p><a href="http://dcist.com/profile/cjoxzva"> Phenergan no prescription </a></p>
<p><a href="http://dcist.com/profile/xiudjmybl"> Seroquel no prescription </a></p>
<p><a href="http://dcist.com/profile/znqvrswj"> Vasotec no prescription </a></p>
<p><a href="http://dcist.com/profile/qtzivyj"> Compazine no prescription </a></p>
<p><a href="http://dcist.com/profile/dtuqxyla"> Coumadin no prescription </a></p>
<p><a href="http://dcist.com/profile/ijpyolxs"> Nolvadex no prescription </a></p>
<p><a href="http://dcist.com/profile/abojqki"> Lariam no prescription </a></p>
<p><a href="http://dcist.com/profile/mjnoryqaz"> Inderal no prescription </a></p>
<p><a href="http://dcist.com/profile/lyrcejtkw"> Pepcid no prescription </a></p>
<p><a href="http://dcist.com/profile/lubmvdhx"> Premarin no prescription </a></p>
<p><a href="http://dcist.com/profile/thaikovjf"> Propecia no prescription </a></p>
<p><a href="http://dcist.com/profile/vhrxdiwjy"> Altace no prescription </a></p>
<p><a href="http://dcist.com/profile/akoefjdb"> Monopril no prescription </a></p>
<p><a href="http://dcist.com/profile/wjtverla"> Levaquin no prescription </a></p>
<p><a href="http://dcist.com/profile/odivjks"> Accupril no prescription </a></p>
<p><a href="http://dcist.com/profile/jmwakdzu"> Myambutol no prescription </a></p>
<p><a href="http://dcist.com/profile/ubkmsh"> Aciphex no prescription </a></p>
<p><a href="http://dcist.com/profile/fxoqlscew"> Femara no prescription </a></p>
<p><a href="http://dcist.com/profile/izdfhr"> Cardizem no prescription </a></p>
<p><a href="http://dcist.com/profile/izhcwjsao"> Motrin no prescription </a></p>
<p><a href="http://dcist.com/profile/qzlrpx"> Zanaflex no prescription </a></p>
<p><a href="http://dcist.com/profile/ofezclxbn"> Endep no prescription </a></p>
<p><a href="http://dcist.com/profile/bxjeqz"> Lasix no prescription </a></p>
<p><a href="http://dcist.com/profile/cdxanp"> Evista no prescription </a></p>
<p><a href="http://dcist.com/profile/xvyfbm"> Imitrex no prescription </a></p>
<p><a href="http://dcist.com/profile/xnuriqht"> Cartia no prescription </a></p>
<p><a href="http://dcist.com/profile/jrblkpat"> Micardis no prescription </a></p>
<p><a href="http://dcist.com/profile/jskhntxoz"> Prevacid no prescription </a></p>
<p><a href="http://dcist.com/profile/pwhbnjl"> Zyprexa no prescription </a></p>
<p><a href="http://dcist.com/profile/xwlmvuf"> Effexor no prescription </a></p>
<p><a href="http://dcist.com/profile/yjitdxmwb"> Lanoxin no prescription </a></p>
<p><a href="http://dcist.com/profile/rhqkyxl"> Cytoxan no prescription </a></p>
<p><a href="http://dcist.com/profile/jodkpmfqc"> Buspar no prescription </a></p>
<p><a href="http://dcist.com/profile/eujtvfms"> Paxil no prescription </a></p>
<p><a href="http://dcist.com/profile/jundqv"> Loxitane no prescription </a></p>
<p><a href="http://dcist.com/profile/ytucsd"> Protonix no prescription </a></p>
<p><a href="http://dcist.com/profile/xolyuve"> Veetids no prescription </a></p>
<p><a href="http://dcist.com/profile/ykjsncme"> Cardura no prescription </a></p>
<p><a href="http://dcist.com/profile/ilkbzufr"> Zantac no prescription </a></p>
<p><a href="http://dcist.com/profile/rcvhwmq"> Calan no prescription </a></p>
<p><a href="http://dcist.com/profile/tmbzyrnk"> Norvasc no prescription </a></p>
<p><a href="http://dcist.com/profile/lfvxmkrun"> Capoten no prescription </a></p>
<p><a href="http://dcist.com/profile/ilbcrkqpj"> Zithromax no prescription </a></p>
<p><a href="http://dcist.com/profile/cjvdrmeq"> Macrobid no prescription </a></p>
<p><a href="http://dcist.com/profile/rkcnuh"> Amaryl no prescription </a></p>
<p><a href="http://dcist.com/profile/oezrbkupn"> Phentermine no prescription </a></p>
<p><a href="http://dcist.com/profile/ebctzvq"> Ultram no prescription </a></p>
<p><a href="http://dcist.com/profile/cruaehj"> Dilantin no prescription </a></p>
<p><a href="http://dcist.com/profile/puzjskc"> Prograf no prescription </a></p>
<p><a href="http://dcist.com/profile/ztimwlex"> Zelnorm no prescription </a></p>
<p><a href="http://dcist.com/profile/bhxfmcal"> Keflex no prescription </a></p>
<p><a href="http://dcist.com/profile/ivcrnd"> Adipex no prescription </a></p>
<p><a href="http://dcist.com/profile/hworbvunj"> Lipitor no prescription </a></p>
<p><a href="http://dcist.com/profile/wujacntrm"> Mysoline no prescription </a></p>
<p><a href="http://dcist.com/profile/dbvqjeha"> Urispas no prescription </a></p>
<p><a href="http://dcist.com/profile/qzeyshmrd"> Dostinex no prescription </a></p>
<p><a href="http://dcist.com/profile/vfalwu"> Didronel no prescription </a></p>
<p><a href="http://dcist.com/profile/afohkr"> Avodart no prescription </a></p>
<p><a href="http://dcist.com/profile/qpzkwenh"> Requip no prescription </a></p>
<p><a href="http://dcist.com/profile/wjecouai"> Sinequan no prescription </a></p>
<p><a href="http://dcist.com/profile/nqmkepvfj"> Lotrel no prescription </a></p>
<p><a href="http://dcist.com/profile/bfiwedq"> Keftab no prescription </a></p>
<p><a href="http://dcist.com/profile/ncthdqu"> Levoxyl no prescription </a></p>
<p><a href="http://dcist.com/profile/tjrnspm"> Wellbutrin no prescription </a></p>
<p><a href="http://dcist.com/profile/rdzlyhkn"> Avandamet no prescription </a></p>
<p><a href="http://dcist.com/profile/kyjpnmbti"> Revia no prescription </a></p>
<p><a href="http://dcist.com/profile/qxcpvydz"> Fulvicin no prescription </a></p>
<p><a href="http://dcist.com/profile/tohudbxwp"> Soma no prescription </a></p>
<p><a href="http://dcist.com/profile/nrctjphva"> Cordarone no prescription </a></p>
<p><a href="http://dcist.com/profile/hedpjwy"> Pamelor no prescription </a></p>
<p><a href="http://dcist.com/profile/brzyitw"> Mircette no prescription </a></p>
<p><a href="http://dcist.com/profile/oeaqiw"> Kytril no prescription </a></p>
<p><a href="http://dcist.com/profile/juvthx"> Levothroid no prescription </a></p>
<p><a href="http://dcist.com/profile/wtryxi"> Pletal no prescription </a></p>
<p><a href="http://dcist.com/profile/lurszdjv"> Synthroid no prescription </a></p>
<p><a href="http://dcist.com/profile/tjifbupos"> Zyloprim no prescription </a></p>
<p><a href="http://dcist.com/profile/prndkuaq"> Arava no prescription </a></p>
<p><a href="http://dcist.com/profile/jsrczxlb"> Desyrel no prescription </a></p>
<p><a href="http://dcist.com/profile/tiljrzmx"> Plavix no prescription </a></p>
<p><a href="http://dcist.com/profile/qhpxvjrbz"> Glucotrol no prescription </a></p>
<p><a href="http://dcist.com/profile/skwfmdyr"> Vantin no prescription </a></p>
<p><a href="http://dcist.com/profile/qlijso"> Tramadol no prescription </a></p>
<p><a href="http://dcist.com/profile/ovkhwjizu"> Claritin no prescription </a></p>
<p><a href="http://dcist.com/profile/pmyhlfue"> Stromectol no prescription </a></p>
<p><a href="http://dcist.com/profile/vjhiqxe"> Atarax no prescription </a></p>
<p><a href="http://dcist.com/profile/yojwxfc"> Zestoretic no prescription </a></p>
<p><a href="http://dcist.com/profile/lbvdwcam"> Leukeran no prescription </a></p>
<p><a href="http://dcist.com/profile/arwpuof"> Zyvox no prescription </a></p>
<p><a href="http://dcist.com/profile/rnwqsv"> Amoxil no prescription </a></p>
<p><a href="http://dcist.com/profile/lmvrbzaxt"> Antabuse no prescription </a></p>
<p><a href="http://dcist.com/profile/vejxrho"> Hydrea no prescription </a></p>
<p><a href="http://dcist.com/profile/djsyran"> Clomid no prescription </a></p>
<p><a href="http://dcist.com/profile/kwsqxhjpm"> Xanax no prescription </a></p>
<p><a href="http://dcist.com/profile/uojbrdtq"> Celexa no prescription </a></p>
<p><a href="http://dcist.com/profile/sxupnhl"> Lexapro no prescription </a></p>
<p><a href="http://dcist.com/profile/ldojutvc"> Relafen no prescription </a></p>
<p><a href="http://dcist.com/profile/aohpuyx"> Soma no prescription </a></p>
<p><a href="http://dcist.com/profile/crlvdba"> Cytotec no prescription </a></p>
<p><a href="http://dcist.com/profile/vbjzyh"> Zetia no prescription </a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://geekzone.freehostia.com/2008/11/19/sms-sender/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GSM SMS Controller Using Bluetooth Cellular Phone and BTSerial1</title>
		<link>http://geekzone.freehostia.com/2008/11/14/gsm-sms-controller-using-bluetooth-cellular-phone-and-btserial1-2/</link>
		<comments>http://geekzone.freehostia.com/2008/11/14/gsm-sms-controller-using-bluetooth-cellular-phone-and-btserial1-2/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 11:24:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

		<category><![CDATA[Multitasking]]></category>

		<category><![CDATA[RTOS]]></category>

		<category><![CDATA[Bluetooth]]></category>

		<category><![CDATA[C]]></category>

		<category><![CDATA[PIC]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://geekzone.freehostia.com/gsm-sms-controller-using-bluetooth-cellular-phone-and-btserial1</guid>
		<description><![CDATA[The project is a GSM SMS Controller without using any GSM modem.  This is using the BTSerial1 module which wirelessly connects to a Bluetooth cellular phone to the PIC16LF876A&#8217;s serial port.


It accepts commands from an SMS incoming message and also respond via SMS on a read command request.
The valid SMS commands that are:


LED1 ON
- [...]]]></description>
			<content:encoded><![CDATA[<p>The project is a GSM SMS Controller without using any GSM modem.  This is using the <a href="http://geekzone.freehostia.com/btserial1-bluetooth-serial-port-controller-and-wireless-uart-cable-replacement-module">BTSerial1 module</a> which wirelessly connects to a Bluetooth cellular phone to the PIC16LF876A&#8217;s serial port.</p>
<p><a href="http://img523.imageshack.us/my.php?image=schematicfj7.png"><img src="http://img523.imageshack.us/img523/4364/schematicfj7.png" alt="GSM SMS Controller Using Bluetooth Cellular Phone and BTSerial1 Schematic Diagram" /><br />
</a></p>
<p>It accepts commands from an SMS incoming message and also respond via SMS on a read command request.</p>
<p>The valid SMS commands that are:</p>
<table>
<tr>
<td>LED1 ON</td>
<td>- turns ON LED1</td>
</tr>
<tr>
<td>LED1 OFF</td>
<td>- turns OFF LED1</td>
</tr>
<tr>
<td>LED2 ON</td>
<td>- turns ON LED2</td>
</tr>
<tr>
<td>LED2 OFF</td>
<td>- turns OFF LED2</td>
</tr>
<tr>
<td>LED3 ON</td>
<td>- turns ON LED3</td>
</tr>
<tr>
<td>LED3 OFF</td>
<td>- turns OFF LED3</td>
</tr>
<tr>
<td>LED4 ON</td>
<td>- turns ON LED4</td>
</tr>
<tr>
<td>LED4 OFF</td>
<td>- turns OFF LED4</td>
</tr>
<tr>
<td>READ ADC </td>
<td>- will respond back to the sender the current ADC reading</td>
</tr>
</table>
<p>The project is using <a href="http://geekzone.freehostia.com/2007/12/27/tiny-threads-tiny-multitasking-threads-for-microcontrollers/">tthreads</a> as its multitasking engine.  And the SMS sending and receiving is using PDU mode for compatibility with more Bluetooth phones.</p>
<p>The following are excerpts from the full source code:</p>
<pre><code>static void pack7(unsigned char bank2 *msg)
{
    unsigned char i, h, c;

    i=0;
    h=0;
    while(msg[i])
    {
        c =  (msg[i+1] << (7-h)) | (msg[i] >> h);
        bts1_putch(bin2bcd(c>>4));
        bts1_putch(bin2bcd(c));
        ++h;
        ++i;
        if (h==7)
        {
            h=0;
            ++i;
        }
    }
}

void bts1_interface_sms_recv(unsigned char c)
{
    static unsigned char state = SMS_DECODE_START;
    static unsigned char skip_chars = 0;
    static unsigned char v, t, bits;

    if (c==&#8217;r&#8217; || c==&#8217;n&#8217; || c==0)
    {
        if (state >= SMS_MESSAGE1)
        {
            sms_decoded(0);
        }
        state = SMS_DECODE_START;
        skip_chars = 0;
        return;
    }

    if (skip_chars)
    {
        &#8211;skip_chars;
        return;
    }

    switch(state)
    {
    case SMS_DECODE_START:
        v = bcd2bin(c);
        v <<= 4;
        ++state;
        break;

    case SMS_GET_SMS_CENTER_LEN:
        v += bcd2bin(c);
        ++state;
        skip_chars = (v + 1) * 2;
        break;

    case SMS_GET_SENDER_LEN1:
        send_buffer[0] = c;
        v = bcd2bin(c);
        v <<= 4;
        ++state;
        break;

    case SMS_GET_SENDER_LEN2:
        send_buffer[1] = c;
        v += bcd2bin(c);
        if (v &#038; 1)
            ++v;
        v += 2;
        send_buffer_len = 2;
        ++state;
        break;

    case SMS_GET_SENDER:
        send_buffer[send_buffer_len] = c;
        ++send_buffer_len;
        --v;
        if (v==0)
        {
            send_buffer[send_buffer_len] = 0;
            skip_chars = 20;
            bits = 0;
            v = 0;
            t = 0;
            ++state;
        }
        break;

    case SMS_MESSAGE1:
        v = bcd2bin(c) << 4;
        ++state;
        break;

    case SMS_MESSAGE2:
        v += bcd2bin(c);
        t += ((v &#038; (bit_mask[7-bits]-1)) << bits);
        sms_decoded(t);
        t = v >> (7-bits);
        ++bits;
        if (bits>=7)
        {
            sms_decoded(t);
            bits = 0;
            t = 0;
        }
        &#8211;state;
        break;
    }
}

</code></pre>
<p>Click and view the <a href="http://geekzone.freehostia.com/site/sc_help/">source documentations</a>.</p>
<p>Download the hex file here <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/11/pic_bt_smshex.txt' title='GSM SMS Controller Using Bluetooth Cellular Phone and BTSerial1 Hex File'>GSM SMS Controller Using Bluetooth Cellular Phone and BTSerial1 Hex File</a>.</p>
<p>The complete project file is here <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/11/bt_sms.zip' title='GSM SMS Controller Using Bluetooth Cellular Phone and BTSerial1 Complete Project Files'>GSM SMS Controller Using Bluetooth Cellular Phone and BTSerial1 Complete Project Files</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://geekzone.freehostia.com/2008/11/14/gsm-sms-controller-using-bluetooth-cellular-phone-and-btserial1-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dallas DS1620 Digital Thermometer/Thermostat Routines</title>
		<link>http://geekzone.freehostia.com/2008/10/28/dallas-ds1620-digital-thermometerthermostat-routines/</link>
		<comments>http://geekzone.freehostia.com/2008/10/28/dallas-ds1620-digital-thermometerthermostat-routines/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 06:02:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

		<category><![CDATA[Logic]]></category>

		<category><![CDATA[C]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[PIC]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://geekzone.freehostia.com/archives/66</guid>
		<description><![CDATA[Dallas DS1620 is an integrated circuit that functions as a digital thermometer or thermostat.  This device uses a 3-wire interface to read and write data to it.  This is added to MCUs that does not have A/D (analog to digital) converters and must rely on external components for temperature monitoring.  
The functions [...]]]></description>
			<content:encoded><![CDATA[<p>Dallas DS1620 is an integrated circuit that functions as a digital thermometer or thermostat.  This device uses a 3-wire interface to read and write data to it.  This is added to MCUs that does not have A/D (analog to digital) converters and must rely on external components for temperature monitoring.  </p>
<p>The functions below does the reading and writing data to the DS1620:</p>
<pre><code>void DS1620_Write(unsigned char data)
{
    unsigned char i;

    TRIS_DQ = 0;
    TRIS_CLK = 0;
    TRIS_RST = 0;

    CLK = 1;

    for (i=0; i<8; ++i)
    {
        CLK = 0;
        if (data &#038; 1)
        {
            DQ = 1;
        }
        else
        {
            DQ = 0;
        }
        data = data >> 1;
        CLK = 1;
    }
}

unsigned char DS1620_Read(void)
{
    unsigned int t;
    unsigned char i;

    TRIS_DQ = 1;
    TRIS_CLK = 0;
    TRIS_RST = 0;

    CLK = 1;

    t = 0;
    for (i=0; i<9; ++i)
    {
        CLK = 0;
        t = t >> 1;
        if (DQ)
        {
            t = t | 0&#215;100;
        }
        CLK = 1;
    }      

    t = t >> 1;
    return(t &#038; 0xFF);
}
</code></pre>
<p>Here is <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/ds1620.c' title='ds1620.c'>ds1620.c</a> and <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/ds1620.h' title='ds1620.h'>ds1620.h</a> source codes.</p>
]]></content:encoded>
			<wfw:commentRss>http://geekzone.freehostia.com/2008/10/28/dallas-ds1620-digital-thermometerthermostat-routines/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HD44780 LCD Routines in C</title>
		<link>http://geekzone.freehostia.com/2008/10/28/hd44780-lcd-routines-in-c/</link>
		<comments>http://geekzone.freehostia.com/2008/10/28/hd44780-lcd-routines-in-c/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 05:52:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

		<category><![CDATA[Logic]]></category>

		<category><![CDATA[LCD]]></category>

		<category><![CDATA[C]]></category>

		<category><![CDATA[PIC]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://geekzone.freehostia.com/archives/63</guid>
		<description><![CDATA[This is my implementation of interfacing the HD44780 Hitachi LCD and its variants.  This uses 4 bit mode thus lesser wires going to the LCD.  The port used on this is PORTB. The lower 4 bits RB0-RB3 are the data nybble. While RS and EN are RB4 and RB5, respectively.
These are some sample [...]]]></description>
			<content:encoded><![CDATA[<p>This is my implementation of interfacing the HD44780 Hitachi LCD and its variants.  This uses 4 bit mode thus lesser wires going to the LCD.  The port used on this is PORTB. The lower 4 bits RB0-RB3 are the data nybble. While RS and EN are RB4 and RB5, respectively.</p>
<p>These are some sample functions that are included on this release:</p>
<pre><code>void lcd_clear(void)
{
    set_LCD_RS(0);
    lcd_write(0x01);
    DelayMs(2);
}

void lcd_puts(const char *s)
{
    set_LCD_RS(1);
    while (*s) lcd_write(*s++);
}

void lcd_putch(uchar c)
{
    set_LCD_RS(1);
    lcd_write(c);
}

void lcd_goto(uchar pos)
{
    set_LCD_RS(0);
    lcd_write(0x80|(pos &#038; 0x7F));
}
</code></pre>
<p>Click the links <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/lcd.c' title='lcd.c'>lcd.c</a> and <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/lcd.h' title='lcd.h'>lcd.h</a> to download the files.</p>
]]></content:encoded>
			<wfw:commentRss>http://geekzone.freehostia.com/2008/10/28/hd44780-lcd-routines-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I2C Routines for PIC Microcontroller</title>
		<link>http://geekzone.freehostia.com/2008/10/28/i2c-routines-for-pic-microcontroller/</link>
		<comments>http://geekzone.freehostia.com/2008/10/28/i2c-routines-for-pic-microcontroller/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 23:51:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

		<category><![CDATA[Logic]]></category>

		<category><![CDATA[C]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[PIC]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://geekzone.freehostia.com/archives/60</guid>
		<description><![CDATA[This is a release of my master mode I2C routines for PIC microcontroller to the open source community.  This uses bit-banging technique and does not use the hardware SSP peripheral.  The routine checks for I2C slave acknowledgment during writing.  
Here is an excerpt for writing a byte to to the I2C bus:


unsigned [...]]]></description>
			<content:encoded><![CDATA[<p>This is a release of my master mode I2C routines for PIC microcontroller to the open source community.  This uses bit-banging technique and does not use the hardware SSP peripheral.  The routine checks for I2C slave acknowledgment during writing.  </p>
<p>Here is an excerpt for writing a byte to to the I2C bus:<br />
<code>
<pre>
unsigned char i2c_write(unsigned char c)
{
    unsigned char i;

    SCL_LOW();
    i=8;
    SDA_TRIS=0;
    do {
        if (c &#038; 0x80) {
            SDA_HIGH();
        } else {
            SDA_LOW();
        }

        //pulse clock
        delay_settle();
        SCL_HIGH();
        delay_clock();
        SCL_LOW();
        delay_clock();
        c<<=1;            //next bit
    } while (--i);

    //get acknowledge
    SDA_HIGH();
    SCL_HIGH();
    delay_half_clock();
    if (SDA) {
        //SDA remains high, not acknowledged
        delay_half_clock();
        SCL_LOW();
        delay_clock();
        return I2C_ERROR_NO_ACK;
    }
    delay_half_clock();
    SCL_LOW();
    delay_clock();
    return I2C_NO_ERROR;
}<ins datetime="2008-10-27T23:44:35+00:00">
</pre>
<p></code></p>
<p>Download the full source code <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/i2c.c' title='i2c.c'>i2c.c</a> and <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/i2c.h' title='i2c.h'>i2c.h</a> here.</p>
]]></content:encoded>
			<wfw:commentRss>http://geekzone.freehostia.com/2008/10/28/i2c-routines-for-pic-microcontroller/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Billiard Shot Timer</title>
		<link>http://geekzone.freehostia.com/2008/10/27/billiard-shot-timer/</link>
		<comments>http://geekzone.freehostia.com/2008/10/27/billiard-shot-timer/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 07:02:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Schematic]]></category>

		<category><![CDATA[Hardware]]></category>

		<category><![CDATA[Multitasking]]></category>

		<category><![CDATA[Bluetooth]]></category>

		<category><![CDATA[C]]></category>

		<category><![CDATA[PIC]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://geekzone.freehostia.com/billiard-shot-timer</guid>
		<description><![CDATA[I have created open project as a billiards shot clock/timer. This is a 45 second countdown timer to limit the player’s time on each shot. This uses Tiny Threads as its multitasking engine for the display and button debouncing.
This is posted at a Filipino Electronics forum here.
This is a billiard shot clock where there is [...]]]></description>
			<content:encoded><![CDATA[<p>I have created open project as a billiards shot clock/timer. This is a 45 second countdown timer to limit the player’s time on each shot. This uses Tiny Threads as its multitasking engine for the display and button debouncing.</p>
<p>This is posted at a Filipino Electronics forum <a href="http://www.electronicslab.ph/forum/index.php?topic=226.msg97903#msg97903" rel="nofollow">here</a>.</p>
<p>This is a billiard shot clock where there is a countdown of 45 seconds.  The first button will reset the clock to 45 seconds.  The next button starts the countdown when pressed.  Pressing again the button stops the clock.  The last button is the extend button.  This will reset the clock to 30 seconds and starts the count immediately.</p>
<p>Below is the schematic:<br />
<a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/timer.png' title='Billiard Shot Clock Schematic'><img src='http://geekzone.freehostia.com/wp-content/uploads/2008/10/timer.png' alt='Billiard Shot Clock Schematic' /></a></p>
<p>Download the compile .hex file here <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/billiard_timer.zip' title='Billiard Shot Timer Source Code and Hex File'>Billiard Shot Timer Source Code and Hex File</a></p>
<p><!-- img src="http://img523.imageshack.us/img523/1204/timerlm4.png" alt="Billard Shot Timer Schematic Diagram" / --></p>
<pre><code>/*
 * 2 Digit Billiard Timer
 * Copyright (c) 2008, Regulus Berdin
 * All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT.  IN NO EVENT SHALL REGULUS BERDIN BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 * History:
 * 1.0        10/27/2008        Created file.
 *
 */

#include
<pic.h>

__CONFIG(PROTECT &#038; CPD &#038; LVPDIS &#038; BOREN &#038; MCLREN &#038; PWRTEN &#038; WDTDIS &#038; XT);

#include &#8220;tthread.h&#8221;

#define BTN_RESET            RB0
#define BTN_START_STOP        RB1
#define BTN_EXTEND            RB2

#define TICKS_SECONDS        225
#define    DEBOUNCE_DELAY        12

unsigned char tmr_count, start_count, seconds;
unsigned char debounce1, debounce2, debounce3;
unsigned char disp1, disp2;

void interrupt isr(void)
{
    T0IF = 0;
    if (start_count)
    {
        if (tmr_count)
        {
            &#8211;tmr_count;
        }
        else
        {
            tmr_count = TICKS_SECONDS;
            ++seconds;
        }
    }
    if (debounce1) &#8211;debounce1;
    if (debounce2) &#8211;debounce2;
    if (debounce3) &#8211;debounce3;
}

void init(void)
{
    /* disable comparators */
    CMCON=0&#215;07;

    /* setup PIOs*/
    TRISA=0;
    TRISB=0b00000111;
    PORTA=0;
    PORTB=0;
    RBPU = 0;

    /* Timer0 on Fosc */
    T0CS = 0;

    /* Prescaler on Timer0 */
    PSA = 0;

    /* Divided by 16
       Timer0 = 225 ticks/seconds */
    PS0 = 1;
    PS1 = 1;
    PS2 = 0;

    T0IF = 0;
    T0IE = 1;
    GIE = 1;

}

void update_dispay(void)
{
    PORTA = disp1 &#038; 0&#215;0F;
    PORTB = (disp2 << 4) &#038; 0xF0;
}

void reset_display(unsigned char a, unsigned char b)
{
    disp1 = a;
    disp2 = b;
    T0IF = 0;
    TMR0 = 0;
    update_dispay();
}

TT_DEF(display)
{
    TT_BEGIN(display);
    reset_display(4,5);
    seconds = 0;
    while (1)
    {
        TT_WAIT_UNTIL(display, seconds);
        --seconds;

        TT_SWITCH(display);

        if (disp2)
            --disp2;
        else
            if (disp1)
            {
                disp2 = 9;
                --disp1;
            }
            else
            {
                start_count = 0;
            }

        TT_SWITCH(display);

        update_dispay();
    }
    TT_END(display);
}

TT_DEF(reset)
{
    TT_BEGIN(reset);
    while(1) {
        do {
            TT_WAIT_WHILE(reset, BTN_RESET);
            debounce1 = DEBOUNCE_DELAY;
            TT_WAIT_WHILE(reset, debounce1);
        } while (BTN_RESET);

        start_count = 0;
        reset_display(4,5);

        do {
            TT_WAIT_WHILE(reset, BTN_RESET == 0);
            debounce1 = DEBOUNCE_DELAY;
            TT_WAIT_WHILE(reset, debounce1);
        } while(BTN_RESET == 0);
    }
    TT_END(reset);
}

TT_DEF(start_stop)
{
    TT_BEGIN(start_stop);
    while(1)
    {
        do {
            TT_WAIT_WHILE(start_stop, BTN_START_STOP);
            debounce1 = DEBOUNCE_DELAY;
            TT_WAIT_WHILE(start_stop, debounce1);
        } while (BTN_START_STOP);

        start_count = start_count?0:1;

        do {
            TT_WAIT_WHILE(start_stop, BTN_START_STOP == 0);
            debounce2 = DEBOUNCE_DELAY;
            TT_WAIT_WHILE(start_stop, debounce2);
        } while(BTN_START_STOP == 0);
    }
    TT_END(start_stop);
}

TT_DEF(extend)
{
    TT_BEGIN(extend);

    while(1)
    {
        do {
            TT_WAIT_WHILE(extend, BTN_EXTEND);
            debounce3 = DEBOUNCE_DELAY;
            TT_WAIT_WHILE(extend, debounce3);
        } while (BTN_EXTEND);

        disp1 += 3;
        update_dispay();

        /* reset_display(3,0); */
        start_count = 1;

        do {
            TT_WAIT_WHILE(extend, BTN_EXTEND == 0);
            debounce3 = DEBOUNCE_DELAY;
            TT_WAIT_WHILE(extend, debounce3);
        } while(BTN_EXTEND == 0);
    }

    TT_END(extend);
}

void main(void)
{
    init();

    start_count = 0;
    TT_INIT(display);
    TT_INIT(reset);
    TT_INIT(start_stop);
    TT_INIT(extend);

    while (1)
    {
        TT_SCHED(display);
        TT_SCHED(reset);
        TT_SCHED(start_stop);
        TT_SCHED(extend);
    }
}
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://geekzone.freehostia.com/2008/10/27/billiard-shot-timer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Binary to BCD Conversion Routines</title>
		<link>http://geekzone.freehostia.com/2008/10/18/binary-to-bcd-conversion-routines-2/</link>
		<comments>http://geekzone.freehostia.com/2008/10/18/binary-to-bcd-conversion-routines-2/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 07:50:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://geekzone.freehostia.com/binary-to-bcd-conversion-routines</guid>
		<description><![CDATA[BCD or Binary Coded Decimal Conversion is often used to convert binary numbers to human readable &#8220;decimal&#8221; notation.  This is used by embedded systems applications to show binary values in displays such as LCDs or multiple 7 segment LEDs.
In the embedded world, there are many ways to convert a binary number to its &#8220;decimal&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>BCD or Binary Coded Decimal Conversion is often used to convert binary numbers to human readable &#8220;decimal&#8221; notation.  This is used by embedded systems applications to show binary values in displays such as LCDs or multiple 7 segment LEDs.</p>
<p>In the embedded world, there are many ways to convert a binary number to its &#8220;decimal&#8221; representation.  The simplest and maybe the commonly used by using successive subtraction.  This does not need any library or division to use.  This is perfect for MCUs that does not have hardware multiplier or divider.  Below is my implementation of this algorithm:</p>
<p><strong>Using Successive Subtration</strong>
<pre><code>typedef struct {
    unsigned char n1;
    unsigned char n10;
    unsigned char n100;
    unsigned char n1000;
    unsigned char n10000;
} bcd_t;

static unsigned char rep_subract(unsigned int *bin, unsigned int value)
{
    unsigned char count = 0;

    while(*bin >= value)
    {
        *bin -= value;
        ++count;
    }
    return count;
}

void bin2bcd0(unsigned int bin, bcd_t *bcd)
{
    bcd->n10000 = rep_subract(&#038;bin, 10000);
    bcd->n1000 = rep_subract(&#038;bin, 1000);
    bcd->n100 = rep_subract(&#038;bin, 100);
    bcd->n10 = rep_subract(&#038;bin, 10);
    bcd->n1 = bin;
}
</code></pre>
<p>Next algorithm is using &#8220;sprintf()&#8221; function in stdio.h and uses the %d formatting.  This relies on the underlying library.  This may result in a larger code size for the code with the library will be included.  See the code below:</p>
<p><strong>Using sprintf() Function</strong>
<pre><code>static unsigned char bcdchar(unsigned char v)
{
    if (v>='0' &#038;&#038; v<='9')
        return v - '0';
    else
        return 0;
}

void bin2bcd1(unsigned int bin, bcd_t *bcd)
{
    char tmp[10];

    sprintf(tmp,"%5d", bin);
    bcd->n10000 = bcdchar(tmp[0]);
    bcd->n1000 = bcdchar(tmp[1]);
    bcd->n100 = bcdchar(tmp[2]);
    bcd->n10 = bcdchar(tmp[3]);
    bcd->n1 = bcdchar(tmp[4]);
}
</code></pre>
<p>Lastly, the next algorithm is the easiest to understand mathematically.  This uses division and the remainder to compute the digits.  This routine is great for MCUs with built-in hardware multipliers.</p>
<p><strong>Using Division and Modulo</strong>
<pre><code>static unsigned char div_mod(unsigned int *bin, unsigned int value)
{
    unsigned int temp = *bin, mod;

    *bin = temp % value;
    return (temp - *bin) / value;
}

void bin2bcd2(unsigned int bin, bcd_t *bcd)
{
    bcd->n10000 = div_mod(&#038;bin, 10000);
    bcd->n1000 = div_mod(&#038;bin, 1000);
    bcd->n100 = div_mod(&#038;bin, 100);
    bcd->n10 = div_mod(&#038;bin, 10);
    bcd->n1 = bin;
}

</code></pre>
<p>This is the <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/bin2bcd_test.c' title='Binary to BCD Conversion Routines Source Code'>Binary to BCD Conversion Routines Source Code</a> which you could download and evaluate the resulting compiled code.</p>
]]></content:encoded>
			<wfw:commentRss>http://geekzone.freehostia.com/2008/10/18/binary-to-bcd-conversion-routines-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SMS PDU Mode Decoder</title>
		<link>http://geekzone.freehostia.com/2008/10/13/sms-pdu-mode-decoder/</link>
		<comments>http://geekzone.freehostia.com/2008/10/13/sms-pdu-mode-decoder/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 08:29:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://geekzone.freehostia.com/archives/50</guid>
		<description><![CDATA[There is 2 formats when receiving or sending SMS from cellular phones via Bluetooth or data cable.  The easy way is using plain text by issuing &#8220;AT+CMGF=1&#8243; command.  But not all phones supports this.  Most phones supports the 2nd way, that is, the PDU mode.  PDU mode is activated by issuing [...]]]></description>
			<content:encoded><![CDATA[<p>There is 2 formats when receiving or sending SMS from cellular phones via Bluetooth or data cable.  The easy way is using plain text by issuing &#8220;AT+CMGF=1&#8243; command.  But not all phones supports this.  Most phones supports the 2nd way, that is, the PDU mode.  PDU mode is activated by issuing &#8220;AT+CMGF=0&#8243;.  </p>
<p>Decoding PDU is tricky for it is binary in 2 character hex characters.  The actual message is also packed into 7 bits into 8 bits array.  Excerpt below is the code for the 7 bit decoding functions:</p>
<pre><code>
int bcd2bin(char c)
{
    if (c>='a' &#038;&#038; c<='f')
        return c - 'a' + 10 ;

    if (c>=&#8217;A&#8217; &#038;&#038; c<='F')
        return c - 'A' + 10 ;

    if (c>=&#8217;0&#8242; &#038;&#038; c<='9')
        return c - '0';

    return -1;
}

unsigned int convert2byte(char *s, unsigned char *result)
{
    unsigned int n;

    *result = 0;
    if ((n = bcd2bin(*s++)) < 0)
        return 1;

    *result = n << 4;
    if ((n = bcd2bin(*s++)) < 0)
        return 1;

    *result += n;
    return 0;
}

unsigned char decode7(char *buffer, unsigned int pos)
{
    unsigned char c;
    unsigned int n;

    n = pos * 7/8;

    buffer += n * 2;

    if (convert2byte(buffer + 2 , &#038;c))
        return 0;
    n = c;
    n <<= 8;

    if (convert2byte(buffer, &#038;c))
        return 0;
    n += c;
    n >>= 7 - ((7 + pos) % 8);

    return n &#038; 0&#215;7F;
}
</code></pre>
<p>Download the example program here <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/pdu1.c' title='SMS PDU Mode Decoder Source Code'>SMS PDU Mode Decoder Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://geekzone.freehostia.com/2008/10/13/sms-pdu-mode-decoder/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Number to Words Converter in C</title>
		<link>http://geekzone.freehostia.com/2008/10/13/number-to-words-converter-in-c/</link>
		<comments>http://geekzone.freehostia.com/2008/10/13/number-to-words-converter-in-c/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 07:04:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://geekzone.freehostia.com/archives/48</guid>
		<description><![CDATA[Here is my version of converting number to words in C.  Example number 123, will output &#8220;one hundred twenty three&#8221;.  The conversion code is less than 40 lines using the recursive function below:
 
char *conv(char *result, char *num, int len)
{
    int h;

    if (len==1)
    {
  [...]]]></description>
			<content:encoded><![CDATA[<p>Here is my version of converting number to words in C.  Example number 123, will output &#8220;one hundred twenty three&#8221;.  The conversion code is less than 40 lines using the recursive function below:</p>
<pre> <code>
char *conv(char *result, char *num, int len)
{
    int h;

    if (len==1)
    {
        if (*num >='1' &#038;&#038; *num<='9')
            result = addword(result, t0[*num - '1']);
        return result;
    }
    else if (len==2)
    {
        if (*num == '1')
            result = addword(result, t1[*++num - '0']);
        else if (*num >=&#8217;2&#8242; &#038;&#038; *num<='9')
            result = addword(result, t2[*num - '2']);
        return conv(result, num + 1, 1);
    }
    else if (len==3)
    {
        if (*num >=&#8217;1&#8242; &#038;&#038; *num<='9')
            result = addword(addword(result, t0[*num - '1']), "hundred ");
        return conv(result, num + 1, 2);
    }
    else
    {
        if (!(h = len % 3))
            h = 3;

        if (len <= 23 &#038;&#038; strncmp(num, "000", 3))
            result = addword(conv(result, num, h), t3[(len - h)/3 - 1]);
        return conv(result, num + h, len - h);
    }
}
</code></pre>
<p>This is the complete program, <a href='http://geekzone.freehostia.com/wp-content/uploads/2008/10/num.c' title='Number to Words Converter in C source code'>Number to Words Converter in C source code</a> shows how to call the conv() function.</p>
]]></content:encoded>
			<wfw:commentRss>http://geekzone.freehostia.com/2008/10/13/number-to-words-converter-in-c/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
