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

<channel>
	<title>OCFreaks!</title>
	<atom:link href="http://www.ocfreaks.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ocfreaks.com</link>
	<description>Overclocking , Gaming , Technology , Robotics &#38; DIY!</description>
	<lastBuildDate>Wed, 01 May 2013 10:30:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ASUS HD 7970 Matrix Platinum 3 GB review</title>
		<link>http://www.ocfreaks.com/asus-hd-7970-matrix-platinum-3-gb-review/</link>
		<comments>http://www.ocfreaks.com/asus-hd-7970-matrix-platinum-3-gb-review/#comments</comments>
		<pubDate>Sun, 28 Apr 2013 19:17:56 +0000</pubDate>
		<dc:creator>Sumon Pathak</dc:creator>
				<category><![CDATA[Graphics card]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[ASUS]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[HD 7970 Matrix Platinum 3GB]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://www.ocfreaks.com/?p=1051</guid>
		<description><![CDATA[Fastest Single GPU...reviewed!]]></description>
			<content:encoded><![CDATA[<p><!--pagetitle:Introduction--><br />
<span class="shead"><span class="sheadin">Introduction</span></span></p>
<p>Hey guys!<br />
Hows it going? Finally got my hands on the HD 7970 Gigahertz Edition and i thought i should do a review for you. Now the sample i have today is the Matrix Platinum Version of HD 7970 from Asus which is a beast in its own right.</p>
<p>This card is clocked higher than any other 7970 Gigahertz Edition  in the market and as such it competes directly with the 7970 Lighting as to the specs. Clocking in at 1100 MHz Core and 1650 MHz memory speed this THE fastest 7970 as of now.</p>
<p>Lets take a look what Asus have in their 7970 offerings and then we shall check out more about this card.</p>
<table width="650" border="0">
<colgroup>
<col width="179" />
<col width="338" />
<col width="337" /> </colgroup>
<tbody>
<tr>
<td style="text-align: center;" width="179" height="49">Model name</td>
<td style="text-align: center;" width="338">MATRIXHD7970P-3GD5(Platinum Edition)</td>
<td style="text-align: center;" width="337">MATRIXHD7970-3GD5</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">Graphics engine</td>
<td style="text-align: center;" colspan="2" width="675">AMD Radeon™ HD 7970 GHz Edition</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">Stream processors</td>
<td style="text-align: center;" colspan="2" width="675">2048</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">Bus standard</td>
<td style="text-align: center;" colspan="2" width="675">PCI Express® 3.0</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">OpenGL®</td>
<td style="text-align: center;" colspan="2" width="675">OpenGL 4.2</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">Video memory</td>
<td style="text-align: center;" colspan="2" width="675">3072MB GDDR5</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="49">Engine clock</td>
<td style="text-align: center;" width="338">1100MHz (boost clock)1050MHz (base clock)</td>
<td style="text-align: center;" width="337">1050MHz (boost clock)1000MHz (base clock)</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">Memory clock</td>
<td style="text-align: center;" colspan="2" width="675">6600MHz (1650MHz GDDR5)</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">Memory interface</td>
<td style="text-align: center;" colspan="2" width="675">384-bit</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="5">DVI max resolution</td>
<td style="text-align: center;" colspan="2" width="675">2560 x 1600</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="49">DVI output</td>
<td style="text-align: center;" colspan="2" width="675">1 x single link DVI1 x dual link DVI</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">HDMI output</td>
<td style="text-align: center;" colspan="2" width="675">1 x HDMI via adapter</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">HDCP compliant</td>
<td style="text-align: center;" colspan="2" width="675">Yes</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">DisplayPort</td>
<td style="text-align: center;" colspan="2" width="675">4 x native DisplayPort</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="73">Adapters/cables bundled</td>
<td colspan="2" width="675">
<p style="text-align: center;">2 x 8-pin power cable, 1 x DVI to HDMI adapter,1 x extended CrossFire™ bridge,</p>
<p style="text-align: center;">1 x VRM heatsink for liquid nitrogen overclocking</p>
</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="49">Software bundled</td>
<td style="text-align: center;" colspan="2" width="675">ASUS utilities and driver<br />
GPU Tweak</td>
</tr>
<tr>
<td style="text-align: center;" width="179" height="24">Dimensions</td>
<td style="text-align: center;" colspan="2" width="675">11&#8243; x 5.1&#8243; x 2.1&#8243; (2.6-slot)</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.ocfreaks.com/asus-hd-7970-matrix-platinum-3-gb-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bioshock Infinite Review</title>
		<link>http://www.ocfreaks.com/bioshock-infinite-review/</link>
		<comments>http://www.ocfreaks.com/bioshock-infinite-review/#comments</comments>
		<pubDate>Sun, 21 Apr 2013 15:01:22 +0000</pubDate>
		<dc:creator>Vivek Singh (Aka: Reaper)</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[2K Games]]></category>
		<category><![CDATA[bioshock]]></category>
		<category><![CDATA[bioshock infinite]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[First Person Shooter]]></category>
		<category><![CDATA[game review]]></category>

		<guid isPermaLink="false">http://www.ocfreaks.com/?p=1117</guid>
		<description><![CDATA[Bioshock Infinite .. Reviewed!]]></description>
			<content:encoded><![CDATA[<p><!--pagetitle:Introduction--><br />
<img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/bioshock-infinite-review/s/cover.jpg"></p>
<p><span class="shead"><span class="sheadin">Introduction</span></span></p>
<p><center></p>
<table>
<tr>
<td>Developer:</td>
<td> Irrational Games</td>
</tr>
<tr>
<td>Publisher:</td>
<td> 2K Games</td>
</tr>
<tr>
<td>Platforms:</td>
<td> PC, Xbox 360, PlayStation 3</td>
</tr>
<tr>
<td>Genre:</td>
<td> First Person Shooter</td>
</tr>
<tr>
<td>Engine:</td>
<td> Modified Unreal Engine 3</td>
</tr>
</table>
<p></center></p>
<p>Bioshock Infinte is a First Person Shooter set in the early 20th Century America. You play as Booker DeWitt, a private Investigator and former Pinkerton Agent. Offered a chance to clear his debt by bringing in a girl &#8220;Elizabeth&#8221; you are escorted by a mysterious pair to a lighthouse , This is not a sequel to Bioshock in fact this takes place 5 decades before the events in Rapture, and you are flown to a beautiful floating air-city of Columbia, founded by and under the rule of Zachary Hale &#8220;Father&#8221; Comstock.</p>
<p>Comstock learns of your arrival and dispatches his troops after you, but you soon meet Elizabeth in a tower where she has been held captive for 20 years. Booker offers Elizabeth an escape to Paris and they team up against Comstock and fight their way through hordes of human and &#8216;automated&#8217; enemies all the while discovering more about their connection with the city and the prophecy. Bioshock Infinite was announced in 2010, and has been on a pedestal since as Irrational claimed to be working on a different kind of Video Game experience. And now it&#8217;s time to confirm whether they were successful or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocfreaks.com/bioshock-infinite-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LPC2148 Timer Tutorial</title>
		<link>http://www.ocfreaks.com/lpc2148-timer-tutorial/</link>
		<comments>http://www.ocfreaks.com/lpc2148-timer-tutorial/#comments</comments>
		<pubDate>Thu, 28 Mar 2013 07:18:58 +0000</pubDate>
		<dc:creator>Power_user_EX</dc:creator>
				<category><![CDATA[Embedded]]></category>
		<category><![CDATA[delay using timers]]></category>
		<category><![CDATA[lpc2148]]></category>
		<category><![CDATA[lpc2148 timer tutorial]]></category>
		<category><![CDATA[lpc2148 timer using interrupt]]></category>

		<guid isPermaLink="false">http://www.ocfreaks.com/?p=1072</guid>
		<description><![CDATA[The Basics After writing the first blinky program using random delay , now its time to improvise and induce precise delay using timers! The real fun in embedded starts when you start playing with timers (&#038; UARTs , PWM , etc.. ofcourse which we will see in my future posts). I&#8217;ll try to keep it [...]]]></description>
			<content:encoded><![CDATA[<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/lpc2148-tutorial/timer/lpc214x-timer-tutorial.jpg" /></p>
<p><span class="shead"><span class="sheadin">The Basics</span></span><br />
After writing the first blinky program using random delay , now its time to improvise and induce precise delay using timers! The real fun in embedded starts when you start playing with timers (&#038; UARTs , PWM , etc.. ofcourse which we will see in my future posts). I&#8217;ll try to keep it simple and short so its easy to understand.</p>
<p>LPC2148 comes loaded with two 32-bit-Timer blocks. Each Timer block can be used as a &#8216;Timer&#8217; (like for e.g. triggering an interrupt every &#8216;t&#8217; microseconds) or as a &#8216;Counter&#8217; and can be also used to demodulate PWM signals given as input.</p>
<p>A timer has a <strong>Timer Counter(TC)</strong> and <strong>Prescale Register(PR)</strong> associated with it. When Timer is Reset and Enabled TC is set to 0 and incremented by 1 every <strong>&#8216;PR+1&#8242;</strong> clock cycles. When it reached its maximum value it gets reset to 0 and hence restarts counting. Prescale Register is used to define the <strong>resolution</strong> of the timer. If <strong>PR=0</strong> then TC is incremented every <strong>1 clock cycle of the peripheral clock</strong>. If <strong>PR=1</strong> then TC is incremented every <strong>2 clock cycles of peripheral clock and so on</strong>. By setting an appropriate value in PR we can make timer increment or count : every peripheral clock cycle or 1 microsecond or 1 millisecond or 1 second and so on.</p>
<p>Each Timer has <strong>four 32-bit Match Registers</strong> and <strong>four 32-bit Capture Registers</strong>.</p>
<p><span class="shead"><span class="sheadin">The Register Specifics</span></span></p>
<p><strong>What is a Match Register anyways ? </p>
<p>Ans: </strong>A Match Register is a Register which contains a specific value set by the user. When the Timer starts &#8211; every time after TC is incremented the value in TC is compared with match register. If it matches then it can Reset the Timer or can generate an interrupt as defined by the user. We are only concerned with match registers in this tutorial.</p>
<div class="intendb">
<strong>Match Registers can be used to:</strong></p>
<ul>
<li>Stop Timer on Match(i.e when the value in count register is same as than in Match register) and trigger an optional interrupt.</li>
<li>Reset Timer on Match and trigger an optional interrupt.</li>
<li>
To count continuously and trigger an interrupt on match.</li>
</ul>
</div>
<p><strong>What are Capture Registers ?</p>
<p>Ans:</strong> As the name suggests it is used to Capture Input signal. When a transition event occurs on a Capture pin , it can be used to copy the value of TC into any of the 4 Capture Register or to genreate an Interrupt. Hence these can be also used to demodulated PWM signals. We are not going to use them in this tutorial since we are only concerned with using Timer block as a &#8216;Timer&#8217;. We&#8217;ll see them in upcoming tutorial since it needs a dedicated tutorial.</p>
<div class="highlight">
<strong>Now lets see some of the important registers concerned mainly with timer operation.</strong></p>
<p><strong><span class="font_15px">1) PR : Prescale Register (32 bit)</span></strong> &#8211; Stores the maximum value of Prescale counter after which it is reset.</p>
<p><strong><span class="font_15px">2) PC : Prescale Counter Register (32 bit)</span></strong> &#8211; This register increments on every PCLK(Peripheral clock). This register controls the resolution of the timer. When PR reaches the value in PC , PR is reset back to 0 and Timer Counter is incremented by 1. Hence if PR=0 then Timer Counter Increments on every 1 PCLK. If PR=9 then Timer Counter Increments on every 10th cycle of PCLK. Hence by selecting an appropriate prescale value we can control the resolution of the timer. </p>
<p><strong><span class="font_15px">3) TC : Timer Counter Register (32 bit)</span></strong> &#8211; This is the main counting register. Timer Counter increments when PC reaches its maximum value as specified by PR. If timer is not reset explicitly(directly) or by using an interrupt then it will act as a free running counter which resets back to zero when it reaches its maximum value which is 0xFFFFFFFF.</p>
<p><strong><span class="font_15px">4) TCR : Timer Control Register</span></strong> &#8211; This register is used to enable , disable and reset TC. When bit0 is 1 timer is enabled and when 0 it is disabled. When bit1 is set to 1 TC and PC are set to zero together in sync on the next positive edge of PCLK. Rest of the bits of TCR are reserved.</p>
<p><strong><span class="font_15px">5) CTCR : Count Control register</span></strong> &#8211; Used to select Timer/Counter Mode. For our purpose we are always gonna use this in Timer Mode. When the value of the CTCR is set to 0&#215;0 Timer Mode is selected.</p>
<p><strong><span class="font_15px">6) MCR : Match Control register</span></strong> &#8211; This register is used to control which all operations can be done when the value in MR matches the value in TC. Bits 0,1,2 are for MR0 , Bits 3,4,5 for MR1 and so on.. Heres a quick table which shows the usage:</p>
<div class="intendbhl"><strong>For MR0:</strong></p>
<p>Bit 0 : Interrupt on MR0 i.e trigger an interrupt when MR0 matches TC. Interrupts are enabled when set to 1 and disabled when set to 0.</p>
<p>Bit 1 : Reset on MR0. When set to 1 , TC will be reset when it matched MR0. Disabled when set to 0.</p>
<p>Bit 2 : Stop on MR0. When set to 1 , TC &#038; PC will stop when MR0 matches TC.</p>
<p>Similarly bits 3-5 , 6-8 , 9-11 are for MR1 , MR2 , MR3 respectively.
</p></div>
<p><strong><span class="font_15px">7) IR : Interrupt Register</span></strong> &#8211; It contains the interrupt flags for 4 match and 4 capture interrupts. Bit0 to bit3 are for MR0 to MR3 interrupts respectively. And similarly the next 4 for CR0-3 interrupts. when an interrupt is raised the corresponding bit in IR will be set to 1 and 0 otherwise. Writing a 1 to the corresponding bit location will reset the interrupt &#8211; which is used to acknowledge the completion of the corresponding ISR execution.
</div>
<p>Now lets actually use a Timer and see it in action. We are gonna use Interrupts in one of our example. An article on using interrupts in lpc214x will be posted shortly. </p>
<p><span class="shead"><span class="sheadin">Setting up &#038; configuring Timers</span></span><br />
To use timers we need to first configure them. We need to set appropriate values in TxCTCR , TxIR , TxPR and reset TxPC , TxTC. Finally we assign TxTCR = 0&#215;01 which enables the timer. </p>
<div class="highlight">I would like to encourage the readers to use the following sequence for Setting up Timers:</p>
<ol>
<li>Set appropriate value in TxCTCR</li>
<li>Define the Prescale value in TxPR</li>
<li>Set Value(s) in Match Register(s) if required</li>
<li>Set appropriate value in TxMCR if using Match registers / Interrupts</li>
<li>Reset Timer &#8211; Which resets PR and TC</li>
<li>
Set TxTCR to 0&#215;01 to Enable the Timer when required</li>
<li>
Reset TxTCR to 0&#215;00 to Disable the Timer when required</li>
</ol>
</div>
<p>Now lets implement to basic function required for Timer Operation:<br />
<strong>1.</strong> void initTimer0(void);<br />
<strong>2.</strong> void delayMS(unsigned int milliseconds); </p>
<h4>#1) initTimer0(void); [Used in Example #1] </h4>
<div class="snippet_darkred">
<strong>Attention Plz! :</strong> This function is used to setup and initialize the Timer block. Timer blocks use peripheral clock as their input and hence peripheral clock must be initialized before Timer is initialized. In our case it is assumed that LPC2148 is connected to 12Mhz XTAL and both CPU and Peripheral Clocks have been setup to tick at 60Mhz.
</div>
<p><center></p>
<div class="codecolorer-container c railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333;">void</span> initTimer0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/*Assuming that PLL0 has been setup with CCLK = 60Mhz and PCLK also = 60Mhz.*/</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; T0CTCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; T0PR <span style="color: #339933;">=</span> PRESCALE<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//(Value in Decimal!) - Increment T0TC at every 60000 clock cycles</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">//Count begins from zero hence subtracting 1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">//60000 clock cycles @60Mhz = 1 mS</span><br />
<br />
&nbsp; &nbsp; T0TCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x02</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Reset Timer</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p></center></p>
<div class="snippet_darkblue">
<h4>Prescale (TxPR) Related Calculations:</h4>
<p>The delay or time required for 1 clock cycle at &#8216;X&#8217; MHz is given by :<br />
<strong> (1 / X * (10^6)) Seconds </strong></p>
<p>Hence in our case when PR=0 i.e TC increments at every PCLK the delay required for TC to increment by 1 is:<br />
<strong>((0+1) / 60 * (10^6)) Seconds</strong></p>
<p>Similarly when we set PR = 59999 the delay in this case will be:<br />
<strong>((59999+1) / 60 * (10^6)) = (60000 / 60 * (10^6) = 1 / (10^3) Seconds </strong></p>
<p>&#8230; which boils down to<strong> 1/1000 = 0.001</strong> Seconds which is nothing but <strong>1 Milli-Second i.e mS</strong>. Hence the delay required for TC to increment by 1 will be 1mS.
</div>
<h4> #2) delayMS(unsigned int milliseconds); </h4>
<p><center></p>
<div class="codecolorer-container c railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333;">void</span> delayMS<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> milliseconds<span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//Using Timer0</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; T0TCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x02</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Reset Timer</span><br />
<br />
&nbsp; &nbsp; T0TCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x01</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Enable timer</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>T0TC <span style="color: #339933;">&lt;</span> milliseconds<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//wait until timer counter reaches the desired delay</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; T0TCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x00</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Disable timer</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p></center></p>
<p><span class="shead"><span class="sheadin">Some Real World Examples</span></span></p>
<h4> Example #1) &#8211; Basic Blinky example using Timer </h4>
<p>Now lets make a blinky program which flashes a LED every half a second. Since 0.5 second = 500 millisecond we will invoke &#8216;delayMS&#8217; as delayMS(500).</p>
<p><center></p>
<div class="codecolorer-container c railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:600px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">/*<br />
(C) Umang Gajera | Power_user_EX - www.ocfreaks.com 2011-13.<br />
More Embedded tutorials @ www.ocfreaks.com/cat/embedded<br />
<br />
LPC2148 Basic Timer example.<br />
License : GPL.<br />
*/</span><br />
<span style="color: #339933;">#include &lt;lpc214x.h&gt;</span><br />
<br />
<span style="color: #339933;">#define PLOCK 0x00000400</span><br />
<span style="color: #339933;">#define PRESCALE 60000 &nbsp; //60000 PCLK clock cycles to increment TC by 1 </span><br />
<br />
<span style="color: #993333;">void</span> delayMS<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> milliseconds<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">void</span> initClocks<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">void</span> initTimer0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">void</span> setupPLL0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">void</span> feedSeq<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">void</span> connectPLL0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<br />
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; initClocks<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Initialize CPU and Peripheral Clocks @ 60Mhz</span><br />
&nbsp; &nbsp; initTimer0<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Initialize Timer0</span><br />
&nbsp; &nbsp; IO0DIR <span style="color: #339933;">=</span> <span style="color: #208080;">0xFFFFFFFF</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Configure all pins on Port 0 as Output</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; IO0SET <span style="color: #339933;">=</span> <span style="color: #208080;">0xFFFFFFFF</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Turn on LEDs</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; delayMS<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//0.5 Second(s) Delay</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; IO0CLR <span style="color: #339933;">=</span> <span style="color: #208080;">0xFFFFFFFF</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Turn them off</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; delayMS<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//return 0; //normally this wont execute ever :P</span><br />
&nbsp; &nbsp; <br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">void</span> initTimer0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/*Assuming that PLL0 has been setup with CCLK = 60Mhz and PCLK also = 60Mhz.*/</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; T0CTCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; T0PR <span style="color: #339933;">=</span> PRESCALE<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//(Value in Decimal!) - Increment T0TC at every 60000 clock cycles</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">//Count begins from zero hence subtracting 1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">//60000 clock cycles @60Mhz = 1 mS</span><br />
<br />
&nbsp; &nbsp; T0TCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x02</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Reset Timer</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">void</span> delayMS<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> milliseconds<span style="color: #009900;">&#41;</span> <span style="color: #666666; font-style: italic;">//Using Timer0</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; T0TCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x02</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Reset Timer</span><br />
<br />
&nbsp; &nbsp; T0TCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x01</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Enable timer</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span>T0TC <span style="color: #339933;">&lt;</span> milliseconds<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//wait until timer counter reaches the desired delay</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; T0TCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x00</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Disable timer</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">void</span> initClocks<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; setupPLL0<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; feedSeq<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//sequence for locking PLL to desired freq.</span><br />
&nbsp; &nbsp; connectPLL0<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; feedSeq<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//sequence for connecting the PLL as system clock</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//SysClock is now ticking @ 60Mhz!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; VPBDIV <span style="color: #339933;">=</span> <span style="color: #208080;">0x01</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// PCLK is same as CCLK i.e 60Mhz</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Using PLL settings as shown in : http://www.ocfreaks.com/lpc214x-pll-tutorial-for-cpu-and-peripheral-clock/</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//PLL0 Now configured!</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<br />
<span style="color: #666666; font-style: italic;">//---------PLL Related Functions :---------------</span><br />
<br />
<span style="color: #993333;">void</span> setupPLL0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Note : Assuming 12Mhz Xtal is connected to LPC2148.</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; PLL0CON <span style="color: #339933;">=</span> <span style="color: #208080;">0x01</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// PPLE=1 &amp; PPLC=0 so it will be enabled</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// but not connected after FEED sequence</span><br />
&nbsp; &nbsp; PLL0CFG <span style="color: #339933;">=</span> <span style="color: #208080;">0x24</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set the multipler to 5 (i.e actually 4)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// i.e 12x5 = 60 Mhz (M - 1 = 4)!!!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Set P=2 since we want FCCO in range!!!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// So , Assign PSEL =01 in PLL0CFG as per the table.</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">void</span> feedSeq<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; PLL0FEED <span style="color: #339933;">=</span> <span style="color: #208080;">0xAA</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; PLL0FEED <span style="color: #339933;">=</span> <span style="color: #208080;">0x55</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">void</span> connectPLL0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// check whether PLL has locked on to the &nbsp;desired freq by reading the lock bit</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// in the PPL0STAT register</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span> PLL0STAT <span style="color: #339933;">&amp;</span> PLOCK <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// now enable(again) and connect</span><br />
&nbsp; &nbsp; PLL0CON <span style="color: #339933;">=</span> <span style="color: #208080;">0x03</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p></center></p>
<div class="highlight"><strong>Download Project Source for Example #1 @</strong> <a href='http://www.ocfreaks.com/wp-content/uploads/2013/03/OCFreaks.com_LPC214x_Timer_Tutorial.zip'>OCFreaks.com_LPC214x_Timer_Tutorial.zip</a> [Successfully tested on Keil UV4.70a] </div>
<h4> Example #2) &#8211; Blinky example using Timer with Interrupt </h4>
<div class="snippet_darkred">
<strong>Attention Plz! :</strong> Please take your time to go through &#8220;initTimer0()&#8221; function. Here I&#8217;ve used Match Register 0(T0MR0) and Match Control Register(T0MCR) and setup Interrupt handler which gets triggered when value in TC equals the value in T0MR0. A detailed tutorial on using and configuring Interrupts on LPC214x will be online very shortly.</p>
<p>Also if you are using Keil Version4(or higher) you&#8217;ll need to edit Target Option settings and those Crossworks for ARM etc .. you need to manually enable global interrupts &#8211; A simple way to make interrupts working is @ <a href="http://www.ocfreaks.com/lpc2148-interrupt-problem-issue-fix">Here</a>
</div>
<p><center></p>
<div class="codecolorer-container c railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:600px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">/*<br />
(C) Umang Gajera | Power_user_EX - www.ocfreaks.com 2011-13.<br />
More Embedded tutorials @ www.ocfreaks.com/cat/embedded<br />
<br />
LPC2148 Timer example using Interrupt.<br />
License : GPL.<br />
*/</span><br />
<br />
<span style="color: #339933;">#include &lt;lpc214x.h&gt;</span><br />
<br />
<span style="color: #339933;">#define PLOCK 0x00000400</span><br />
<span style="color: #339933;">#define MR0I (1&lt;&lt;0) //Interrupt When TC matches MR0</span><br />
<span style="color: #339933;">#define MR0R (1&lt;&lt;1) //Reset TC when TC matches MR0</span><br />
<br />
<span style="color: #339933;">#define DELAY_MS 500 //0.5 Seconds Delay</span><br />
<span style="color: #339933;">#define PRESCALE 60000 //60000 PCLK clock cycles to increment TC by 1 </span><br />
<br />
<span style="color: #993333;">void</span> delayMS<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> milliseconds<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">void</span> initClocks<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">void</span> initTimer0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
__irq <span style="color: #993333;">void</span> T0ISR<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #993333;">void</span> setupPLL0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">void</span> feedSeq<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #993333;">void</span> connectPLL0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<br />
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; initClocks<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Initialize CPU and Peripheral Clocks @ 60Mhz</span><br />
&nbsp; &nbsp; initTimer0<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Initialize Timer0</span><br />
<br />
&nbsp; &nbsp; IO0DIR <span style="color: #339933;">=</span> <span style="color: #208080;">0xFFFFFFFF</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Configure all pins on Port 0 as Output</span><br />
&nbsp; &nbsp; IO0PIN <span style="color: #339933;">=</span> <span style="color: #208080;">0xF</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; T0TCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x01</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Enable timer</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Infinite Idle Loop</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//return 0; //normally this wont execute ever &nbsp; :P</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">void</span> initTimer0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/*Assuming that PLL0 has been setup with CCLK = 60Mhz and PCLK also = 60Mhz.*/</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//----------Configure Timer0-------------</span><br />
<br />
&nbsp; &nbsp; T0CTCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x0</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; T0PR <span style="color: #339933;">=</span> PRESCALE<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//(Value in Decimal!) - Increment T0TC at every 60000 clock cycles</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">//Count begins from zero hence subtracting 1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">//60000 clock cycles @60Mhz = 1 mS</span><br />
<br />
&nbsp; &nbsp; T0MR0 <span style="color: #339933;">=</span> DELAY_MS<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//(Value in Decimal!) Zero Indexed Count - hence subtracting 1</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; T0MCR <span style="color: #339933;">=</span> MR0I <span style="color: #339933;">|</span> MR0R<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Set bit0 &amp; bit1 to High which is to : Interrupt &amp; Reset TC on MR0 &nbsp;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//----------Setup Timer0 Interrupt-------------</span><br />
<br />
&nbsp; &nbsp; VICVectAddr4 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #009900;">&#41;</span>T0ISR<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Pointer Interrupt Function (ISR)</span><br />
<br />
&nbsp; &nbsp; VICVectCntl4 <span style="color: #339933;">=</span> <span style="color: #208080;">0x20</span> <span style="color: #339933;">|</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//0x20 (i.e bit5 = 1) -&gt; to enable Vectored IRQ slot</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">//0x4 (bit[4:0]) -&gt; this the source number - here its timer0 which has VIC channel mask # as 4</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">//You can get the VIC Channel number from Lpc214x manual R2 - pg 58 / sec 5.5</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; VICIntEnable <span style="color: #339933;">=</span> <span style="color: #208080;">0x10</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Enable timer0 int</span><br />
<br />
&nbsp; &nbsp; T0TCR <span style="color: #339933;">=</span> <span style="color: #208080;">0x02</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Reset Timer</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
__irq <span style="color: #993333;">void</span> T0ISR<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #993333;">long</span> <span style="color: #993333;">int</span> regVal<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; regVal <span style="color: #339933;">=</span> T0IR<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Read current IR value</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; IO0PIN <span style="color: #339933;">=</span> ~IO0PIN<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Toggle the state of the Pins</span><br />
<br />
&nbsp; &nbsp; T0IR <span style="color: #339933;">=</span> regVal<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Write back to IR to clear Interrupt Flag</span><br />
&nbsp; &nbsp; VICVectAddr <span style="color: #339933;">=</span> <span style="color: #208080;">0x0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//This is to signal end of interrupt execution</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">void</span> initClocks<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; setupPLL0<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; feedSeq<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//sequence for locking PLL to desired freq.</span><br />
&nbsp; &nbsp; connectPLL0<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; feedSeq<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//sequence for connecting the PLL as system clock</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//SysClock is now ticking @ 60Mhz!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; VPBDIV <span style="color: #339933;">=</span> <span style="color: #208080;">0x01</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// PCLK is same as CCLK i.e 60Mhz</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//PLL0 Now configured!</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">//---------PLL Related Functions :---------------</span><br />
<br />
<span style="color: #666666; font-style: italic;">//Using PLL settings as shown in : http://www.ocfreaks.com/lpc214x-pll-tutorial-for-cpu-and-peripheral-clock/</span><br />
<br />
<span style="color: #993333;">void</span> setupPLL0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Note : Assuming 12Mhz Xtal is connected to LPC2148.</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; PLL0CON <span style="color: #339933;">=</span> <span style="color: #208080;">0x01</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// PPLE=1 &amp; PPLC=0 so it will be enabled</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// but not connected after FEED sequence</span><br />
<br />
&nbsp; &nbsp; PLL0CFG <span style="color: #339933;">=</span> <span style="color: #208080;">0x24</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set the multipler to 5 (i.e actually 4)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// i.e 12x5 = 60 Mhz (M - 1 = 4)!!!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Set P=2 since we want FCCO in range!!!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// So , Assign PSEL =01 in PLL0CFG as per the table.</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">void</span> feedSeq<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; PLL0FEED <span style="color: #339933;">=</span> <span style="color: #208080;">0xAA</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; PLL0FEED <span style="color: #339933;">=</span> <span style="color: #208080;">0x55</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #993333;">void</span> connectPLL0<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// check whether PLL has locked on to the &nbsp;desired freq by reading the lock bit</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// in the PPL0STAT register</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span> PLL0STAT <span style="color: #339933;">&amp;</span> PLOCK <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// now enable(again) and connect</span><br />
&nbsp; &nbsp; PLL0CON <span style="color: #339933;">=</span> <span style="color: #208080;">0x03</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p></center></p>
<div class="highlight"><strong>Download Project Source for Example #2 @</strong> <a href='http://www.ocfreaks.com/wp-content/uploads/2013/03/OCFreaks.com_LPC214x_TimerIRQ_Tutorial.zip'>OCFreaks.com_LPC214x_TimerIRQ_Tutorial.zip</a> [Successfully tested on Keil UV4.70a] </div>
]]></content:encoded>
			<wfw:commentRss>http://www.ocfreaks.com/lpc2148-timer-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LPC2148 Interrupt Problem and Issue fix</title>
		<link>http://www.ocfreaks.com/lpc2148-interrupt-problem-issue-fix/</link>
		<comments>http://www.ocfreaks.com/lpc2148-interrupt-problem-issue-fix/#comments</comments>
		<pubDate>Thu, 28 Mar 2013 06:19:08 +0000</pubDate>
		<dc:creator>Power_user_EX</dc:creator>
				<category><![CDATA[Embedded]]></category>
		<category><![CDATA[crossworks global interrupts]]></category>
		<category><![CDATA[keil interrupt problem]]></category>
		<category><![CDATA[lpc2148 enable interrupt]]></category>
		<category><![CDATA[lpc2148 timer interrupt problem]]></category>

		<guid isPermaLink="false">http://www.ocfreaks.com/?p=1069</guid>
		<description><![CDATA[Many guys including me have been facing a problem with KEIL4 where the Interrupts or IRQs wont execute even if the code is correct .. but now I&#8217;ve found a simple trick to make the interrupts work. Even I have wasted a long time trying to figure out what the heck was going wrong with [...]]]></description>
			<content:encoded><![CDATA[<p>Many guys including me have been facing a problem with KEIL4 where the Interrupts or IRQs wont execute even if the code is correct .. but now I&#8217;ve found a simple trick to make the interrupts work. Even I have wasted a long time trying to figure out what the heck was going wrong with KEIL4. This problem was not there with KEIL3 and the code would work flawless.</p>
<div class="highlight">To make your interrupts fire in KEIL4 .. all you need to do is : &#8216;Check&#8217; a Checkbox in Target options Under the Linker Tab and you are Done! I don&#8217;t know why .. but KEIL4 doesn&#8217;t do this automatically when you create new project.</div>
<p><strong>Step 1 &#8211; Click Target Options which will open a new Window. Next click on the &#8216;Linker&#8217; Tab:<br />
</strong><br />
<img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/lpc2148-tutorial/lpc2148-interrupt-issue-solved/1.jpg" /></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/lpc2148-tutorial/lpc2148-interrupt-issue-solved/2.jpg" /></p>
<p><strong>Step 2 &#8211; Check the very first checkbox called &#8220;Use Memory layout from Target Dialog&#8221;:</strong></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/lpc2148-tutorial/lpc2148-interrupt-issue-solved/3.jpg" /></p>
<p>Now , rebuild your target and run the simulation. Interrupts must fire now.</p>
<div class="snippet_darkblue">For those having similar problem on Crossworks for ARM / Yagarto or any other GNU based ARM toolchain a fix is @ <a href="https://forum.sparkfun.com/viewtopic.php?p=66975">Here</a></div>
<p><strong>Whether this helped you or not please let me know in your comments.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocfreaks.com/lpc2148-interrupt-problem-issue-fix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ADATA DashDrive HE 720 USB 3.0 Portable hard disk review</title>
		<link>http://www.ocfreaks.com/adata-dashdrive-he-720-usb-3-0-portable-hard-disk-review/</link>
		<comments>http://www.ocfreaks.com/adata-dashdrive-he-720-usb-3-0-portable-hard-disk-review/#comments</comments>
		<pubDate>Sun, 24 Mar 2013 17:32:14 +0000</pubDate>
		<dc:creator>Sumon Pathak</dc:creator>
				<category><![CDATA[Hard disk]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[500GB]]></category>
		<category><![CDATA[adata]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[portqable]]></category>
		<category><![CDATA[usb 3.0]]></category>

		<guid isPermaLink="false">http://www.ocfreaks.com/?p=997</guid>
		<description><![CDATA[Howdy folks! hows it going out there? Today for you guys i have something from ADATA. Something from their range of portable HDD&#8217;s. but first a few words about the company ADATA Technology Co., Ltd. is a Taiwanese memory and storage manufacturer, founded in May 2001 by Simon Chen.Its main product line consists of DRAM [...]]]></description>
			<content:encoded><![CDATA[<p><!--pagetitle:Introduction--></p>
<p>Howdy folks! hows it going out there?<br />
Today for you guys i have something from <a href="http://in.adata-group.com/index_IN.html" target="_blank">ADATA</a>.<br />
Something from their range of portable HDD&#8217;s.</p>
<p>but first a few words about the company</p>
<blockquote><p><strong>ADATA Technology Co., Ltd.</strong> is a Taiwanese memory and storage manufacturer, founded in May 2001 by Simon Chen.Its main product line consists of DRAM modules, USB drives, USBhard drives and memory cards in CompactFlash and Secure digital formats. ADATA has also explored other markets, such as digital frames, solid-state drives, and Express Cards.</p></blockquote>
<p>Now that&#8217;s out-of-the-way,lets see what we have in our hands today.<br />
Presenting the <a href="http://in.adata-group.com/index.php?action=product_feature&amp;cid=2&amp;piid=195&amp;lan=in" target="_blank">Adata DashDrive HE 720<br />
</a></p>
<p>Main feature</p>
<ul>
<li>8.9mm Slimmest Profile</li>
<li>
<div align="left">Stainless Steel Enclosure with 9H Scratch Resistance</div>
</li>
<li>
<div align="left">One-Touch Backup Button Allowing Easy Backup Process,</div>
</li>
<li>
<div align="left">SuperSpeed USB 3.0 (backward compatible with USB 2.0)</div>
</li>
</ul>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/adata-dashdrive-he720/Adata_cover.jpg" alt="" width="600" height="212" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocfreaks.com/adata-dashdrive-he-720-usb-3-0-portable-hard-disk-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY CNC Router / Mill</title>
		<link>http://www.ocfreaks.com/diy-cnc-router-mill/</link>
		<comments>http://www.ocfreaks.com/diy-cnc-router-mill/#comments</comments>
		<pubDate>Thu, 21 Mar 2013 07:02:11 +0000</pubDate>
		<dc:creator>Power_user_EX</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[3 axis cnc]]></category>
		<category><![CDATA[cnc]]></category>
		<category><![CDATA[CNC India]]></category>
		<category><![CDATA[diy]]></category>
		<category><![CDATA[mill]]></category>
		<category><![CDATA[project bootstrap]]></category>
		<category><![CDATA[router]]></category>

		<guid isPermaLink="false">http://www.ocfreaks.com/?p=999</guid>
		<description><![CDATA[Project Bootstrap &#8211; (Yet another xD) DIY 3 Axis CNC Project Bootstrap is OCFreaks&#8217; 2nd Official Project which is &#8211; a Homemade DIY CNC Routing and Milling Machine. For those guys who are new to CNC and related stuff lemme give you a formal introduction to &#8216;CNC Machine&#8217; : CNC stands for &#8216;Computer Numerical Control&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/project-bootstrap.jpg" ></p>
<p><span class="shead"><span class="sheadin">Project Bootstrap &#8211; (Yet another xD) DIY 3 Axis CNC</span></span></p>
<h3>Project Bootstrap is OCFreaks&#8217; 2nd Official Project which is &#8211; a Homemade DIY CNC Routing and Milling Machine.</h3>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/cnccp1.jpg" ></p>
<p><strong>For those guys who are new to CNC and related stuff lemme give you a formal introduction to &#8216;CNC Machine&#8217; :</strong></p>
<div class="intendb">CNC stands for &#8216;Computer Numerical Control&#8217; and that might confuse you even more. In its simplest form a CNC is an automated cutting-n-drilling machine. It can be used to cut, engrave, carve, mill,.. metal or wood or plastic , etc.. in the way you want. You design your 3D-solid using a CAD software. Then you convert that design into a format called &#8216;G-Code&#8217; which a CNC controller software(CAM) understands. This CNC Controller software controls the Stepper motors on each Axes. The cutting head can be anything from a router(spindle), Laser cutting head to a Water Jet cutting head and also an extruder too which prints objects i.e your CNC becomes a 3D-Printer! To cut 3D-solids a CNC needs to have at least 3 Axis. Adding more Axes to a CNC enables you to cut more complex objects which is not possible using a 3-Axis CNC.</div>
</p>
<p>Link to CNC on wiki : <a href="http://en.wikipedia.org/wiki/Numerical_control" target="_blank">http://en.wikipedia.org/wiki/Numerical_control</a></p>
<p>It all started when I entered into Robotics &#038; Embedded &#8211; Somewhere around in late 2009. Back then I was working on a Hexapod Robot project. I had made a new design for my hexapod and then was faced with a challenge. How do I cut the design ? I had to do it manually or get it fabricated. Pro fabricators wont accept such sample quantity jobs. So I had to manually cut the parts for my hexapod .. Damn! During that time a random thought came in my mind &#8211; Why not make a CNC router and cut parts for robotics projects at home? I was like .. hmmmmm .. but making a CNC is tough ask. For months I was still like .. hmmmmm .. can I make it? can I really make it? Finally in April 2012 somewhere around my birthday I decided &#8211; Enough of this &#8216;can I make it? crap&#8217; , Lets start freaking buildin&#8217; it. After my exams in June 2012 I started researching on DIY CNCs seriously .. I mean damn seriously .. endlessly going through CNC related stuff for hours n hours n hours. My CNC story starts from here! My CNC project is divided into Intervals &#8211; each interval has its own story to say.</p>
<div class="highlight">
<strong>Interval 1 </strong>: <a href="http://www.ocfreaks.com/diy-cnc-interval-1/">INCEPTION (&#038; Research)</a></p>
<p><strong>Interval 2 </strong>: Part Selection and Sourcing</p>
<div class="intendbhl">Interval 2A : <a href="http://www.ocfreaks.com/diy-cnc-leadscrew-leadnut-bearing-selection/">Lead Screw , Lead Nut and Bearings Selection </a><br />
Interval 2B : <a href="http://www.ocfreaks.com/diy-cnc-lm-bearings-motor-coupling-selection/">LM Bearings , Couplings &#038; Motor Selection</a></div>
</p>
<p><strong>Interval 3 </strong>: The Design**</p>
<p><strong>Interval 4 </strong>: Ze Assembly &#038; Electronics</p>
<div class="intendbhl">Interval 4A : Ze Assembly Phase**<br />
Interval 4B : Ze Custom Electronics</div>
</p>
<p><strong>Interval 5 </strong>: Final Calibration**</p>
<p><strong>Interval 6 </strong>: PCB Engraving Test**</p>
<p><strong>Interval 7 </strong>: &#8230;In Progress&#8230;**</p>
<p>Note : &#8216;**&#8217; => Post has not been uploaded yet. It will be online soon.</p>
</div>
<p><strong>Here is Quick Video of Interval 6 : Here I&#8217;ve used the CNC to engrave text on PCB Copper Clads:</strong></p>
<p><iframe class="aligncenter" width="640" height="360" src="http://www.youtube.com/embed/KI1M8oMWsTo" frameborder="0" allowfullscreen></iframe></p>
<p>So .. What next in pipeline? : 2nd Version of the current CNC and a 3D-Printer!</p>
<p><span class="shead"><span class="sheadin">The CNC Build in a Nutshell(sort-of)</span></span></p>
<p>6mm Thick Wooden Plates cut as per Design:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/1.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/1.jpg" /></a></p>
<p>Drilled Sandwiched plates with effective thickness of 12mm: </p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/3-wooden-plates-ready.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/3-wooden-plates-ready.jpg" /></a></p>
<p>Base aluminum frame:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/4-base-aluminum-frame-y-axis.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/4-base-aluminum-frame-y-axis.jpg" /></a></p>
<p>Anti-backlash Lead Nuts , Regular ball-Bearings , Thrust Bearings &#038; Couplings , Shaft and Lead Screw end support blocks:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/6-ab-lead-nuts-bearings-couplings-end-supports.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/6-ab-lead-nuts-bearings-couplings-end-supports.jpg" /></a></p>
<p>Cut &#038; Drilled Aluminum Angles of thickness 2mm:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/7-aluminum-angles.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/7-aluminum-angles.jpg" /></a></p>
<p>Open and Closed type Linear Motion Bearings for Linear Motion:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/8-linear-motion-bearings.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/8-linear-motion-bearings.jpg" /></a></p>
<p>Nema-23 18.9Kgcm Stepper Motors:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/9-nema-23-stepper-motors.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/9-nema-23-stepper-motors.jpg" /></a></p>
<p>20mm Shafts , M10x1.5 Mild-steel &#038; Stainless-steel Lead Screws: </p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/10-shafts-ms-lead-screws.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/10-shafts-ms-lead-screws.jpg" /></a></p>
<p>Fasteners:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/11-fasteners.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/11-fasteners.jpg" /></a></p>
<p>1st Prototype of Opto-Isolated Parallel Breakout Board &#8211; Sadly this prototype failed and didn&#8217;t make it ): [2nd Prototype in Progress (:]</p>
<p><a href="http://www.ocfreaks.com/imgs/projects/parallel-breakout-board-cnc/1.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/projects/parallel-breakout-board-cnc/s/1.jpg" /></a></p>
<p>2nd Prototype of DRV8825 based stepper motor driver &#8211; This too didn&#8217;t make it since it had a few bugs ): [3rd Prototype in Progress (:]</p>
<p><a href="http://www.ocfreaks.com/imgs/projects/cnc-drv8825-stepper-driver-controller/1.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/projects/cnc-drv8825-stepper-driver-controller/s/1.jpg" /></a></p>
<p>5mm Thick Aluminum Angles for reinforcement:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/12-5mm-aluminum-angles.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/12-5mm-aluminum-angles.jpg" /></a></p>
<p>Anti-backlash Lead Nut Housing:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/13-anti-backlash-lead-nut.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/13-anti-backlash-lead-nut.jpg" /></a></p>
<p>Lead Nut where it should be: When the Lead Screw rotates the Lead Nut moves back-n-forth i.e it converts the rotational motion of stepper motors into linear motion.</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/14-ab-lead-nut-mounted.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/14-ab-lead-nut-mounted.jpg" /></a></p>
<p>X-axis Base on which Z-axis base is mounted:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/15.1-x-axis-base.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/15.1-x-axis-base.jpg" /></a></p>
<p>Y-axis Base:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/15.2-y-axis-base.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/15.2-y-axis-base.jpg" /></a></p>
<p>Z-axis Base :</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/15.3-z-axis-base.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/15.3-z-axis-base.jpg" /></a></p>
<p>Z-axis Lead Screw Assembly:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/16-z-axis-lead-screw.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/16-z-axis-lead-screw.jpg" /></a></p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/17.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/17.jpg" /></a></p>
<p>Thrust Bearings to secure Lead Screws in place:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/18-thrust-bearings.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/18-thrust-bearings.jpg" /></a></p>
<p>Z-axis Assembly:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/19-z-axis.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/19-z-axis.jpg" /></a></p>
<p>Z-axis Stepper Motor:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/20-z-axis-motor.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/20-z-axis-motor.jpg" /></a></p>
<p>Y-axis Stepper Motor:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/21-y-axis-motor.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/21-y-axis-motor.jpg" /></a></p>
<p>X-axis Stepper Motor:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/22-x-axis-motor.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/22-x-axis-motor.jpg" /></a></p>
<p>Y-axis Limit/Home Switches:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/23.1-y-axis-leadscrew-limit-switches.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/23.1-y-axis-leadscrew-limit-switches.jpg" /></a></p>
<p>X-axis Limit/Home Switches:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/23.2-x-axis-leadscrew-limit-switches.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/23.2-x-axis-leadscrew-limit-switches.jpg " /></a></p>
<p>Z-axis Limit/Home Switches:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/23.3-z-axis-leadscrew-limit-switches.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/23.3-z-axis-leadscrew-limit-switches.jpg" /></a></p>
<p>CNC Base assembly:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/24-cnc-base-frame.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/24-cnc-base-frame.jpg" /></a></p>
<p>The Gantry:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/25.1-cnc-main-assembly.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/25.1-cnc-main-assembly.jpg" /></a></p>
<p>CNC almost complete! :</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/25.2-cnc-almost-complete.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/25.2-cnc-almost-complete.jpg" /></a></p>
<p>CNC on Wheels! :</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/26-cnc-on-wheels.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/26-cnc-on-wheels.jpg" /></a></p>
<p>The final setup for Test Runs:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/27-cnc-test-prints.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/27-cnc-test-prints.jpg" /></a></p>
<p>Test Print(after calibration) Result:</p>
<p><a href="http://www.ocfreaks.com/imgs/diy-cnc/28-cnc-print-result.jpg"><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc/s/28-cnc-print-result.jpg" /></a></p>
<p>And its Made in India. (:</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocfreaks.com/diy-cnc-router-mill/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DIY CNC &#8211; LM Bearings, Motor &amp; Coupling Selection</title>
		<link>http://www.ocfreaks.com/diy-cnc-lm-bearings-motor-coupling-selection/</link>
		<comments>http://www.ocfreaks.com/diy-cnc-lm-bearings-motor-coupling-selection/#comments</comments>
		<pubDate>Sun, 17 Mar 2013 13:36:59 +0000</pubDate>
		<dc:creator>Power_user_EX</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://www.ocfreaks.com/?p=990</guid>
		<description><![CDATA[This is DIY CNC Interval 2B &#8211; Linear Motion Bearings, Motor &#038; Coupling Selection. Linear Motion Bearings , Shafts and Support Blocks For linear translation support I decided to go with 20mmm (dia.) Linear Motion Ball Bearings mounted on 20mm chrome shafts. Per axis 4 Linear Motion Bearings will be used. Open Type Linear Motion [...]]]></description>
			<content:encoded><![CDATA[<p><img onload="NcodeImageResizer.createOn(this);" src="http://www.ocfreaks.com/imgs/diy-cnc-series/int-2b.jpg" class="aligncenter" /></p>
<h4>This is DIY CNC Interval 2B &#8211; Linear Motion Bearings, Motor &#038; Coupling Selection.</h4>
<p><span class="shead"><span class="sheadin">Linear Motion Bearings , Shafts and Support Blocks</span></span><br />
For linear translation support I decided to go with 20mmm (dia.) Linear Motion Ball Bearings mounted on 20mm chrome shafts. Per axis 4 Linear Motion Bearings will be used. </p>
<p>Open Type Linear Motion Bearing:</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/3.jpg" /></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/4.jpg" /></p>
<p>Closed Type Linear Motion Bearing:</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/5.jpg" /></p>
<p>The Linear Motion Bearing Stock:</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/6.jpg" /></p>
<p>To support shafts I have got some Shaft End support blocks:</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/7.jpg" /></p>
<p>Shaft End Support Stock:</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/9.jpg" /></p>
<p>20mm Chrome Shafts:</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/10.jpg" /></p>
<p><span class="shead"><span class="sheadin">Stepper Motors</span></span></p>
<p>I&#8217;ve also purchased 3x Nema-23 18.9 Kg-cm Torque Stepper motors which provides enough torque to mill metals like Aluminum given a proper lead screw is used.</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/1.jpg" /></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/2.jpg" /></p>
<p><span class="shead"><span class="sheadin">Couplings</span></span><br />
A Nema 23 Standard Stepper motor shaft has a diameter of 1/4&#8243; i.e 6.35mm. On the other hand my Lead Screws are 10mm in diameter. Hence I wanted a coupling which can couple the 10mm lead screw with 6.35mm stepper shaft. Once such type of coupling was available on Ebay &#8211; HongKong but then I found a fabricator who could flexible shaft couplings at almost the same price. Within 5 days I got it fabricated from Excella electronics &#8211; Ghatkopar , Mumbai.</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/coupling.jpg" /> </p>
<p><span class="shead"><span class="sheadin">Misc</span></span></p>
<p>Also got a sample of pillow block bearing which I had originally thought of using as end support for Lead Screw. This might or might not go into the actual CNC.</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-intro/s/11.jpg" /></p>
<p>Interval 1 Post is @ <a href="http://www.ocfreaks.com/diy-cnc-interval-1/">Here</a><br />
Interval 2A Post is @ <a href="http://www.ocfreaks.com/diy-cnc-leadscrew-leadnut-bearing-selection/">Here</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocfreaks.com/diy-cnc-lm-bearings-motor-coupling-selection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY Lead Screw End support for CNC</title>
		<link>http://www.ocfreaks.com/diy-lead-screw-end-support-for-cnc/</link>
		<comments>http://www.ocfreaks.com/diy-lead-screw-end-support-for-cnc/#comments</comments>
		<pubDate>Sun, 17 Mar 2013 12:08:35 +0000</pubDate>
		<dc:creator>Power_user_EX</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://www.ocfreaks.com/?p=976</guid>
		<description><![CDATA[Introduction Hey Folks! Lets make our own Lead Screw End support for our DIY CNCs! I&#8217;ll let images do all the talking since therez nothing much to write about xD. So this was my situation : I was having Bearings with ID=10mm , OD=19mm and same kind Flange type bearing with Flange dia=21mm along with [...]]]></description>
			<content:encoded><![CDATA[<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/final.jpg" /></p>
<p><span class="shead"><span class="sheadin">Introduction</span></span><br />
Hey Folks! Lets make our own Lead Screw End support for our DIY CNCs! I&#8217;ll let images do all the talking since therez nothing much to write about xD. </p>
<p>So this was my situation : I was having Bearings with <strong>ID=10mm , OD=19mm</strong> and same kind Flange type bearing with <strong>Flange dia=21mm</strong> along with a <strong>20mm Shaft End Support</strong>. Using those bearings one could easily convert a &#8216;Shaft End Support&#8217; into a &#8216;Lead Screw End Support&#8217;. Lets see how.</p>
<p><span class="shead"><span class="sheadin">Parts required:</span></span><br />
<strong>1) 20mm Shaft End Support Block :</strong></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/1.jpg" /></p>
<p><strong>2) Normal + Flange type Bearings :<br />
</strong><br />
<img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/2a.jpg" /></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/2b.jpg" /></p>
<p><strong>3) Paper Tape :</strong></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/3.jpg" /></p>
<p><strong>4) Small Hammer</strong></p>
<p><span class="shead"><span class="sheadin">Building Steps:</span></span><br />
<strong>Step 1 : </strong>Stack the normal bearing over the flange type bearing. Start &#8216;rolling&#8217; the paper tape over it. Keep on checking the Outer diameter after each full/half revolution. It must not go beyond the Shaft end support&#8217;s ID which is 20mm in our case.</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/4.jpg" /></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/5.jpg" /></p>
<p><strong>Step 2 : </strong>Once the Outer diameter barely reaches 20mm its time to cut the tape. Trim the excess tape.</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/7.jpg" /></p>
<p><strong>Step 3 :</strong> Its time to put the bearing stack into Shaft end support&#8217;s 20mm slot. Apply pressure using thumbs to force it in. When its mid-way inside u&#8217;ll need a small hammer to force it completely in. If it still wont go inside then a peel of a small section of the paper tape and try again. When its completely inside the slot lock it using Shaft end support&#8217;s lock screws.</p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/8.jpg" /></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/9.jpg" /></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/diy-cnc-series/diy-lead-screw-end-support-cnc/s/10.jpg" /></p>
<p>And thats it! We&#8217;r Done!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocfreaks.com/diy-lead-screw-end-support-for-cnc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Devil May Cry Review</title>
		<link>http://www.ocfreaks.com/devil-may-cry-review/</link>
		<comments>http://www.ocfreaks.com/devil-may-cry-review/#comments</comments>
		<pubDate>Wed, 20 Feb 2013 06:59:02 +0000</pubDate>
		<dc:creator>Abhisek Sethi ( Aka : groovypanda )</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[devil may cry]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://www.ocfreaks.com/?p=960</guid>
		<description><![CDATA[Introduction Hack and Slash is the only genre in which PC is deprived of quality games. Consoles have some excellent hack and slash titles like God of war, bayonetta, Ninja Gaiden , Heavenly swords, Onimusha etc. But when it comes to PC the only worth mentioning title till date is &#8211; Devil May Cry (and [...]]]></description>
			<content:encoded><![CDATA[<p><!--pagetitle:Introduction--><br />
<img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/game-reviews/devil-may-cry/s/cover_p.jpg" /></p>
<p><span class="shead"><span class="sheadin">Introduction</span></span></p>
<p>Hack and Slash is the only genre in which PC is deprived of quality games. Consoles have some excellent hack and slash titles like God of war, bayonetta, Ninja Gaiden , Heavenly swords, Onimusha etc. But when it comes to PC the only worth mentioning title till date is &#8211; Devil May Cry (and Darksiders too but still for me DMC3 > Darksiders). Though the 1st 2 games of the title were also console exclusive and the third title was a bad port still many PC gamers have loved and enjoyed the game as well as being in the boots of the protag DANTE and are playing it till date (me being one of them). DMC3 was very messy on a controller and keyboard controls weren&#8217;t great either but still many gamers loving it is the proof enough for a good game. DMC4 was a mild disappointment for many but still much better on PC with a full and proper controller support. </p>
<p>Then after 2 years of the release of DMC4 came the announcement of Devil May Cry aka DmC. The promo thus released on E3 didnt only irk many of the old and hardcore fans but also earned Ninja Theory lot of hatred from the lifelong fans of the series. Facing all of that the 1st thing Ninja Theory did was to change the face model of the new Dante and release interviews which talked about how this game was nt a sequel but more of a prequel/origin game. Undoubtedly Ninja Theory &#038; DmC was surrounded with loads of critcism throughout the year since the day the new game&#8217;s trailer was released to the day the game released and somewhat even after that. No doubts its the most controversial and yet 1st major game release of the year 2013 on PC. The game released for consoles on 15th of January and as a common practice now 10 days later for the PC. </p>
<p>Now before i begin the review i would just like to share that i am a HUGE fan of the series and the protag DANTE and in the following review i wont only elaborate about the new game but also compare it to the older games of the franchise. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocfreaks.com/devil-may-cry-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GSkill Phoenix III SSD review</title>
		<link>http://www.ocfreaks.com/gskill-pheonix-iii-ssd-review/</link>
		<comments>http://www.ocfreaks.com/gskill-pheonix-iii-ssd-review/#comments</comments>
		<pubDate>Thu, 14 Feb 2013 18:23:58 +0000</pubDate>
		<dc:creator>Sumon Pathak</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[SSD]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[240GB]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[G-skill]]></category>
		<category><![CDATA[pheonix III]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://www.ocfreaks.com/?p=895</guid>
		<description><![CDATA[Introduction Among all PC components none gives more sense of performance than the SSD.The general snappiness of the system brings a smile and satisfaction to anyone. Today we have such a component on the test bench.presenting the Phoenix III SSD from the stable of Gskill. The SSD was on my radar for a long time [...]]]></description>
			<content:encoded><![CDATA[<p><!--pagetitle:Introduction--></p>
<p><span class="shead"><span class="sheadin">Introduction</span></span></p>
<p><img onload="NcodeImageResizer.createOn(this);" class="aligncenter" src="http://www.ocfreaks.com/imgs/G-skill-ssd/s/24.jpg" alt="" width="600" height="450" /></p>
<p>Among all PC components none gives more sense of performance than the SSD.The general snappiness of the system brings a smile and satisfaction to anyone.</p>
<p>Today we have such a component on the test bench.presenting the <a href="http://www.gskill.com/products.php?index=538" target="_blank">Phoenix III SSD</a> from the stable of Gskill.</p>
<p style="text-align: left;">The SSD was on my radar for a long time and finally i got it in my hands to play..so lets see how good it is..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocfreaks.com/gskill-pheonix-iii-ssd-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
