<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Ngô Hải Bắc</title>
	
	<link>http://www.ngohaibac.net</link>
	<description>Hãy chia sẻ để được chia sẻ.</description>
	<pubDate>Sat, 06 Sep 2008 10:39:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/ngohaibac_entries" type="application/rss+xml" /><item>
		<title>Site học tiếng Hàn Quốc khá hay</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/384936493/</link>
		<comments>http://www.ngohaibac.net/site-hoc-tieng-han-quoc-kha-ha/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 10:38:29 +0000</pubDate>
		<dc:creator>ngohaibac</dc:creator>
		
		<category><![CDATA[Học tiếng Hàn Quốc]]></category>

		<category><![CDATA[Korean]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=214</guid>
		<description />
			<content:encoded><![CDATA[<p>Chào các bạn.</p>
<p>Sang đây quen được thằng bạn nó chỉ cho trang học tiếng Hàn quốc dành cho người nước ngoài khá hay bằng tiếng Anh.</p>
<p>Các bạn vào xem nhé: <a href="http://www.arirang.co.kr/"  target="_blank">http://www.arirang.co.kr/</a></p>
<p>Chúc anh em thành công.<br />
<h3>Các bài viết ngẫu nhiên:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/bai-hoc-ve-nghien-cuu-cua-anh-hie/"  title="Stepper motor: Bài học về nghiên cứu của anh Hiệp">Stepper motor: Bài học về nghiên cứu của anh Hiệp</a></li>
<li><a href="http://www.ngohaibac.net/do-an-tot-nghiep-thiet-ke-he-thong-xu-ly-anh-so-tren-nen-fpga/"  title="Đồ &aacute;n tốt nghiệp: Thiết kế hệ thống xử l&yacute; ảnh số tr&ecirc;n nền FPGA">Đồ &aacute;n tốt nghiệp: Thiết kế hệ thống xử l&yacute; ảnh số tr&ecirc;n nền FPGA</a></li>
<li><a href="http://www.ngohaibac.net/hien-thi-led-7-thanh-tren-gui-matlab/"  title="Hiển thị Led 7 thanh tr&ecirc;n GUI Matlab">Hiển thị Led 7 thanh tr&ecirc;n GUI Matlab</a></li>
<li><a href="http://www.ngohaibac.net/tao-file-exe-cho-giao-dien-gui-matlab/"  title="Tạo file .exe cho giao diện GUI Matlab">Tạo file .exe cho giao diện GUI Matlab</a></li>
<li><a href="http://www.ngohaibac.net/using-kde-or-xfce-instead-of-the-gnome-desktop/"  title="Using KDE or Xfce instead of the GNOME desktop">Using KDE or Xfce instead of the GNOME desktop</a></li>
<li><a href="http://www.ngohaibac.net/phan-mem-mo-phong-mach-dien-tu-proteus-72-sp6/"  title="Phần mềm mô phỏng mạch điện tử: Proteus 7.2 SP6">Phần mềm mô phỏng mạch điện tử: Proteus 7.2 SP6</a></li>
<li><a href="http://www.ngohaibac.net/them-trang-nghe-nhac/"  title="Th&ecirc;m trang nghe nhạc">Th&ecirc;m trang nghe nhạc</a></li>
<li><a href="http://www.ngohaibac.net/upgrade-hosting/"  title="N&acirc;ng cấp host">N&acirc;ng cấp host</a></li>
<li><a href="http://www.ngohaibac.net/quan-ly-va-build-project-voi-trinh-dich-htpic-bang-visual-cnet-2005/"  title="Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005">Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005</a></li>
<li><a href="http://www.ngohaibac.net/circuit-design-with-vhdl-volnei-a-pedroni/"  title="Circuit design with VHDL, Volnei A. Pedroni">Circuit design with VHDL, Volnei A. Pedroni</a></li>
<li><a href="http://www.ngohaibac.net/lam-cho-chuong-trinh-tu-chay-khi-khoi-dong-trong-ubuntu-804-lts/"  title="Làm cho một chương trình tự chạy khi khởi động trong Ubuntu 8.04 LTS">Làm cho một chương trình tự chạy khi khởi động trong Ubuntu 8.04 LTS</a></li>
<li><a href="http://www.ngohaibac.net/longman-writing-coach-cd/"  title="Longman Writing Coach CD">Longman Writing Coach CD</a></li>
<li><a href="http://www.ngohaibac.net/hoc-visual-c-video-tutorials/"  title="Học Visual C++: Video Tutorials">Học Visual C++: Video Tutorials</a></li>
<li><a href="http://www.ngohaibac.net/lap-trinh-c-cho-vi-dieu-khien-van-de-khai-bao-bien/"  title="Lập tr&igrave;nh C cho vi điều khiển: vấn đề khai b&aacute;o biến">Lập tr&igrave;nh C cho vi điều khiển: vấn đề khai b&aacute;o biến</a></li>
<li><a href="http://www.ngohaibac.net/longman-exams-coach-cd/"  title="Longman Exams Coach CD">Longman Exams Coach CD</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=TWG8AN"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=TWG8AN" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/384936493" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/site-hoc-tieng-han-quoc-kha-ha/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/site-hoc-tieng-han-quoc-kha-ha/</feedburner:origLink></item>
		<item>
		<title>Bài học English về mẹ</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/378928287/</link>
		<comments>http://www.ngohaibac.net/bai-hoc-english-ve-me/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 13:48:09 +0000</pubDate>
		<dc:creator>ngohaibac</dc:creator>
		
		<category><![CDATA[Study English]]></category>

		<category><![CDATA[English]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=206</guid>
		<description><![CDATA[Đừng lười học English nhé. Hãy download bài học này. Bài học nói về mẹ nhân ngày Mother&#8217;s day. Theo mình thì khi chọn chủ điểm mà mình thích để nghe thì nó sẽ rất là dễ vào.
Sang Hàn nói English suốt, nên phải học nghe, nói cho cẩn thận hehe.
Link: BBC Learning English
Có vài [...]]]></description>
			<content:encoded><![CDATA[<p>Đừng lười học English nhé. Hãy download bài học này. Bài học nói về mẹ nhân ngày Mother&#8217;s day. Theo mình thì khi chọn chủ điểm mà mình thích để nghe thì nó sẽ rất là dễ vào.</p>
<p>Sang Hàn nói English suốt, nên phải học nghe, nói cho cẩn thận hehe.</p>
<p>Link: <a href="http://www.bbc.co.uk/worldservice/learningenglish/radio/specials/1549_weekender_extra/page7.shtml" >BBC Learning English</a></p>
<p>Có vài chủ điểm khác nữa đó. Bạn thử khám phá xem.</p>
<p><strong>Extras</strong><br />
<a href="http://downloads.bbc.co.uk/worldservice/learningenglish/weekender/scripts/weekender_070316_mothers.pdf" > <img src="http://www.bbc.co.uk/worldservice/learningenglish/images/furniture/ws_download_pdf.gif" border="0" alt="download script" vspace="4" width="21" height="16" align="absmiddle" />Programme script (pdf - 23 k)</a><br />
<a href="http://downloads.bbc.co.uk/worldservice/learningenglish/weekender/audio/weekender_070316_mothers.mp3" ><img src="http://www.bbc.co.uk/worldservice/learningenglish/images/furniture/ws_download_mp3.gif" border="0" alt="download audio" vspace="4" width="31" height="18" align="absmiddle" />Download this programme (mp3 - 2.1 MB) </a><br />
<a href="http://www.bbc.co.uk/videonation/feature/mothersday/" >Watch videos about Mother&#8217;s Day</a></p>
<p><strong>Vocabulary from the programme</strong></p>
<p><strong>to take after someone</strong><br />
to be very similar to them</p>
<p><strong>to reprimand someone</strong><br />
to tell them off for doing something bad or wrong</p>
<p><strong>to have a temper</strong><br />
to get angry very easily</p>
<p><strong>mannerisms</strong><br />
a certain way that a person does or says things which is typical of them</p>
<p><strong>to be independent </strong><br />
to be confident and able to do things on your own</p>
<p><strong>to be an individual</strong><br />
to be different from other people</p>
<p><strong>your attitude</strong><br />
the opinions and feelings you have about something<br />
<em>Example:</em> She has a negative attitude towards her work.</p>
<p><strong>to be caring</strong><br />
to want to help other people and make sure they are happy</p>
<p>Chúc mọi người thành công.<br />
<h3>Các bài viết liên quan:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/longman-dictionary-of-contemporary-skydriver/"  title="Longman Dictionary of Contemporary &ndash; Skydriver">Longman Dictionary of Contemporary &ndash; Skydriver</a></li>
<li><a href="http://www.ngohaibac.net/oxford-collocations-dictionary-for-students-of-english/"  title="Oxford Collocations Dictionary for Students of English">Oxford Collocations Dictionary for Students of English</a></li>
<li><a href="http://www.ngohaibac.net/thong-bao-tuyen-sinh-lop-ielts-moi-thang-52008/"  title="Th&ocirc;ng b&aacute;o tuyển sinh lớp IELTS mới, th&aacute;ng 5/2008">Th&ocirc;ng b&aacute;o tuyển sinh lớp IELTS mới, th&aacute;ng 5/2008</a></li>
<li><a href="http://www.ngohaibac.net/oxford-learners-grammar-checker/"  title="Oxford Learner&#8217;s Grammar Checker">Oxford Learner&#8217;s Grammar Checker</a></li>
<li><a href="http://www.ngohaibac.net/pronunciation-power/"  title="Pronunciation Power">Pronunciation Power</a></li>
<li><a href="http://www.ngohaibac.net/go-bo-quang-cao-o-phan-mem-paltalk/"  title="Gỡ bỏ quảng c&aacute;o ở phần mềm Paltalk">Gỡ bỏ quảng c&aacute;o ở phần mềm Paltalk</a></li>
<li><a href="http://www.ngohaibac.net/english-sharing-and-learning-esl-and-quataoorg/"  title="English Sharing and Learning (ESL) and quatao.org">English Sharing and Learning (ESL) and quatao.org</a></li>
<li><a href="http://www.ngohaibac.net/tu-dien-cho-nguoi-viet-nhung-tu-dien-vao-firefox-cua-ban/"  title="Từ điển cho người Việt -nhúng từ điển vào trình duyệt Firefox của bạn">Từ điển cho người Việt -nhúng từ điển vào trình duyệt Firefox của bạn</a></li>
<li><a href="http://www.ngohaibac.net/dia-chi-hoc-english-chat-luong-va-hieu-qua/"  title="Địa chỉ học IELTS chất lượng">Địa chỉ học IELTS chất lượng</a></li>
<li><a href="http://www.ngohaibac.net/hoc-nghe-noi-tieng-anh-hieu-qua-voi-phan-mem-paltalk-va-dien-dan-dethicom/"  title="Học nghe, nói tiếng Anh hiệu quả với phần mềm Paltalk và diễn đàn dethi.com">Học nghe, nói tiếng Anh hiệu quả với phần mềm Paltalk và diễn đàn dethi.com</a></li>
<li><a href="http://www.ngohaibac.net/myword-dia-chi-hoc-english-rat-hay/"  title="MY WORLD - địa chỉ học English rất hay">MY WORLD - địa chỉ học English rất hay</a></li>
<li><a href="http://www.ngohaibac.net/cambridge-advanced-grammar-in-use-cd-rom/"  title="Cambridge Advanced Grammar in use - CD ROM">Cambridge Advanced Grammar in use - CD ROM</a></li>
<li><a href="http://www.ngohaibac.net/longman-dictionary-of-contemporary-english-updated-version/"  title="Longman Dictionary of Contemporary English, Updated Version">Longman Dictionary of Contemporary English, Updated Version</a></li>
<li><a href="http://www.ngohaibac.net/longman-writing-coach-cd/"  title="Longman Writing Coach CD">Longman Writing Coach CD</a></li>
<li><a href="http://www.ngohaibac.net/longman-exams-coach-cd/"  title="Longman Exams Coach CD">Longman Exams Coach CD</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=uC1EZ3"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=uC1EZ3" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/378928287" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/bai-hoc-english-ve-me/feed/</wfw:commentRss>
<enclosure url="http://downloads.bbc.co.uk/worldservice/learningenglish/weekender/audio/weekender_070316_mothers.mp3" length="2161685" type="audio/mpeg" />
		<feedburner:origLink>http://www.ngohaibac.net/bai-hoc-english-ve-me/</feedburner:origLink></item>
		<item>
		<title>Stepper motor: Bài học về nghiên cứu của anh Hiệp</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/378572644/</link>
		<comments>http://www.ngohaibac.net/bai-hoc-ve-nghien-cuu-cua-anh-hie/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 02:04:01 +0000</pubDate>
		<dc:creator>ngohaibac</dc:creator>
		
		<category><![CDATA[Thông báo]]></category>

		<category><![CDATA[Stepper motor]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=200</guid>
		<description><![CDATA[Chào các bạn.
Sáng nay tìm tài liệu thêm về động cơ bước, search ngay ra blog yahoo của anh Hiêp (Falleaf.net) đọc thấy rất hay nên muốn post lên cho các bạn. Theo mình nghĩ thì đó quả là bài học hay chúng ta nên học.

Link đến blog: http://blog.360.yahoo.com/blog-NZLTSEw3eqq4mtOZsDRN7w&#8211;?cq=1&#38;tag=microchip
Anh Hiệp đã dịch tài liệu về [...]]]></description>
			<content:encoded><![CDATA[<p>Chào các bạn.</p>
<p>Sáng nay tìm tài liệu thêm về động cơ bước, search ngay ra blog yahoo của anh Hiêp (Falleaf.net) đọc thấy rất hay nên muốn post lên cho các bạn. Theo mình nghĩ thì đó quả là bài học hay chúng ta nên học.</p>
<p><img class="alignnone" title="stepper motor" src="http://www.cs.uiowa.edu/~jones/step/typesf/1anim.gif" alt="" width="366" height="153" /></p>
<p>Link đến blog: <a href="http://blog.360.yahoo.com/blog-NZLTSEw3eqq4mtOZsDRN7w--?cq=1&amp;tag=microchip"  target="_blank">http://blog.360.yahoo.com/blog-NZLTSEw3eqq4mtOZsDRN7w&#8211;?cq=1&amp;tag=microchip</a></p>
<p>Anh Hiệp đã dịch tài liệu về Stepper motor của giáo sư Jones ở trường IWOA. Các bạn có thể tham khảo: <a href="http://www.picvietnam.com/download/Stepping/part0_step.pdf"  target="_blank">Part 1</a>, <a href="http://www.picvietnam.com/download/Stepping/part2_0.pdf"  target="_blank">Part 2</a></p>
<p>Website của giáo sư Jones: <a href="http://www.cs.uiowa.edu/~jones/"  target="_blank">http://www.cs.uiowa.edu/~jones/</a></p>
<p>Và về Stepper Motor: <a href="http://www.cs.uiowa.edu/~jones/step/"  target="_blank">http://www.cs.uiowa.edu/~jones/step/</a></p>
<p>Tài liệu English của giáo sư này quá đầy đủ về về Stepper Motor. Theo mình, bạn nào đã biết English thì nên đọc tài liệu English này để có cái nhìn đầy đủ và sâu sắc về Stepper Motor.</p>
<p>Chúc các bạn thành công.<br />
<h3>Các bài viết ngẫu nhiên:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/usb-complete-everything-you-need-to-develop-custom-usb-peripherals-third-edition-by-jan-axelson/"  title="USB Complete Everything You Need to Develop Custom USB Peripherals Third Edition by Jan Axelson">USB Complete Everything You Need to Develop Custom USB Peripherals Third Edition by Jan Axelson</a></li>
<li><a href="http://www.ngohaibac.net/oxford-collocations-dictionary-for-students-of-english/"  title="Oxford Collocations Dictionary for Students of English">Oxford Collocations Dictionary for Students of English</a></li>
<li><a href="http://www.ngohaibac.net/thu-thuat-firefox-css-voi-firefox/"  title="Thủ thuật Firefox: CSS với Firefox">Thủ thuật Firefox: CSS với Firefox</a></li>
<li><a href="http://www.ngohaibac.net/myword-dia-chi-hoc-english-rat-hay/"  title="MY WORLD - địa chỉ học English rất hay">MY WORLD - địa chỉ học English rất hay</a></li>
<li><a href="http://www.ngohaibac.net/kidcad-phan-mem-ve-mach-mien-phi-tren-ubuntu/"  title="Kicad: phần mềm vẽ mạch in miễn phí">Kicad: phần mềm vẽ mạch in miễn phí</a></li>
<li><a href="http://www.ngohaibac.net/phim-hoat-hinh-inuyash/"  title="Phim hoạt hình: Inuyasha">Phim hoạt hình: Inuyasha</a></li>
<li><a href="http://www.ngohaibac.net/phan-tich-thuat-toan-thuc-hien-lenh-dieu-khien-pc-qua-rs232/"  title="Ph&acirc;n t&iacute;ch thuật to&aacute;n: thực hiện lệnh điều khiển từ PC qua RS232">Ph&acirc;n t&iacute;ch thuật to&aacute;n: thực hiện lệnh điều khiển từ PC qua RS232</a></li>
<li><a href="http://www.ngohaibac.net/windows-genuine-advance/"  title="Biến hệ điều hành Windows của Microsoft thành bản quyền">Biến hệ điều hành Windows của Microsoft thành bản quyền</a></li>
<li><a href="http://www.ngohaibac.net/ve-do-thi-trong-matla/"  title="Vẽ đồ thị trong Matlab ">Vẽ đồ thị trong Matlab </a></li>
<li><a href="http://www.ngohaibac.net/gui-matlab-h%e1%bb%99p-tho%e1%ba%a1i-m%e1%bb%9f-file-nh%c6%b0-open-c%e1%bb%a7a-windows/"  title="GUI Matlab: Hộp thoại mở file như Open của Windows">GUI Matlab: Hộp thoại mở file như Open của Windows</a></li>
<li><a href="http://www.ngohaibac.net/them-thu-vien-rar-cho-trinh-giai-nen-cua-ubuntu-804-lts/"  title="Thêm thư viện rar cho trình giải nén của Ubuntu 8.04 LTS">Thêm thư viện rar cho trình giải nén của Ubuntu 8.04 LTS</a></li>
<li><a href="http://www.ngohaibac.net/skydrive-live-luu-tru-du-lieu-5g-cua-microsoft/"  title="Skydrive Live - Lưu trữ dữ liệu 5G của Microsoft">Skydrive Live - Lưu trữ dữ liệu 5G của Microsoft</a></li>
<li><a href="http://www.ngohaibac.net/windows-live-hotmail/"  title="H&#242;m thư Windows Live Hotmail">H&#242;m thư Windows Live Hotmail</a></li>
<li><a href="http://www.ngohaibac.net/phuong-phap-quet-keypad-ma-tran-ban-phim-dung-ngat-timer/"  title="Phương ph&aacute;p qu&eacute;t keypad &ndash; ma trận ph&iacute;m bấm d&ugrave;ng ngắt Timer">Phương ph&aacute;p qu&eacute;t keypad &ndash; ma trận ph&iacute;m bấm d&ugrave;ng ngắt Timer</a></li>
<li><a href="http://www.ngohaibac.net/hinh-anh-chup-buoi-le-tot-nghiep-04-06-2008/"  title="C&aacute;c h&igrave;nh ảnh chụp buổi lễ bảo vệ tốt nghiệp 04/06/2008">C&aacute;c h&igrave;nh ảnh chụp buổi lễ bảo vệ tốt nghiệp 04/06/2008</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=SmhBGC"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=SmhBGC" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/378572644" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/bai-hoc-ve-nghien-cuu-cua-anh-hie/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/bai-hoc-ve-nghien-cuu-cua-anh-hie/</feedburner:origLink></item>
		<item>
		<title>27/08/2008 Đã sang Hàn Quốc</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/377706429/</link>
		<comments>http://www.ngohaibac.net/27_08_2008-da-sang-han-quoc/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 03:11:17 +0000</pubDate>
		<dc:creator>ngohaibac</dc:creator>
		
		<category><![CDATA[Thông báo]]></category>

		<category><![CDATA[announcement]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=195</guid>
		<description><![CDATA[Chào các bạn.
Vậy là sau khi bay 4h đồng hồ và nhiều giờ đi xe bus mình đã đến trường KUT(Korea University of Technology and Education) và Lab của mình.  Lab của mình là KUT BioRobotics Lab.
Website của Lab mình nè: http://robot.kut.ac.kr/
Cuộc sống ở đây rất tốt, mọi người rất thân thiện và giúp đỡ [...]]]></description>
			<content:encoded><![CDATA[<p>Chào các bạn.</p>
<p>Vậy là sau khi bay 4h đồng hồ và nhiều giờ đi xe bus mình đã đến trường KUT(Korea University of Technology and Education) và Lab của mình.  Lab của mình là KUT BioRobotics Lab.</p>
<p>Website của Lab mình nè: <a href="http://robot.kut.ac.kr/"  target="_blank">http://robot.kut.ac.kr/</a></p>
<p>Cuộc sống ở đây rất tốt, mọi người rất thân thiện và giúp đỡ nhau nhiều.Khoái nhất ở đây là tốc độ Internet không thể nào tưởng tượng dc. Hôm qua mình download tại site của Altera mà lên tới 8Mb/s, so với khoảng 600kb/s ở nhà (rất cao rồi, chỉ down dc ở host VN thôi) mà thấy thích thật. Download hơn 2Gb mà chỉ mất có vài chục phút.</p>
<p>Hiện bây giờ mình đang ở Lab để nghiên cứu và làm một project bằng KIT FPGA của Altera. Rảnh mình sẽ viết bài về việc dùng chip của Altera như dùng các công cụ Quartus II, &#8230;</p>
<p>Các bạn nên học English cho cẩn thận nhé. Mình bây giờ toàn phải nói tiếng Anh nên có lẽ phải bồi bổ lại thôi, học lâu lâu k dùng là quên nhiều quá, speak không được tốt nữa.</p>
<p>Chúc mọi người thành công.<br />
<h3>Các bài viết liên quan:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/tham-d-ki%e1%ba%bfn-v%e1%bb%81-ch%e1%ba%a5t-l%c6%b0%e1%bb%a3ng-bi-vi%e1%ba%bft/"  title="Thăm d&ograve; &yacute; kiến về chất lượng b&agrave;i viết">Thăm d&ograve; &yacute; kiến về chất lượng b&agrave;i viết</a></li>
<li><a href="http://www.ngohaibac.net/upgrade-hosting/"  title="N&acirc;ng cấp host">N&acirc;ng cấp host</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=yQh7Pw"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=yQh7Pw" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/377706429" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/27_08_2008-da-sang-han-quoc/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/27_08_2008-da-sang-han-quoc/</feedburner:origLink></item>
		<item>
		<title>Tạm thời không viết blog</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/356985296/</link>
		<comments>http://www.ngohaibac.net/tam-thoi-khong-viet-blog/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 03:07:28 +0000</pubDate>
		<dc:creator>ngohaibac</dc:creator>
		
		<category><![CDATA[Thông báo]]></category>

		<category><![CDATA[anouncement]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=192</guid>
		<description><![CDATA[Chào tất cả các bạn.
Hôm nay mình về quê nghỉ để chuẩn bị lấy VISA và đi Hàn Quốc nên thời gian này mình không viết thêm bài viết nào cả đến tận đầu tháng 9. Sang bên Hàn Quốc mình sẽ viết thêm cho các bạn nhé.
Mong các bạn thông cảm và không bỏ [...]]]></description>
			<content:encoded><![CDATA[<p>Chào tất cả các bạn.</p>
<p>Hôm nay mình về quê nghỉ để chuẩn bị lấy VISA và đi Hàn Quốc nên thời gian này mình không viết thêm bài viết nào cả đến tận đầu tháng 9. Sang bên Hàn Quốc mình sẽ viết thêm cho các bạn nhé.</p>
<p>Mong các bạn thông cảm và không bỏ rơi mình :D.</p>
<p>Chúc các bạn thành công.<br />
<h3>Các bài viết liên quan:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/hinh-anh-chup-buoi-le-tot-nghiep-04-06-2008/"  title="C&aacute;c h&igrave;nh ảnh chụp buổi lễ bảo vệ tốt nghiệp 04/06/2008">C&aacute;c h&igrave;nh ảnh chụp buổi lễ bảo vệ tốt nghiệp 04/06/2008</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=IFhhdg"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=IFhhdg" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/356985296" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/tam-thoi-khong-viet-blog/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/tam-thoi-khong-viet-blog/</feedburner:origLink></item>
		<item>
		<title>Kinh nghiệm làm Visa tại đại sứ quán Hàn Quốc</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/352415875/</link>
		<comments>http://www.ngohaibac.net/kinh-nghiem-lam-visa-tai-dai-su-quan-han-quoc/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 08:43:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Tin tức]]></category>

		<category><![CDATA[Embassy]]></category>

		<category><![CDATA[Korea]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=190</guid>
		<description><![CDATA[Chào các bạn.
Nay đi làm Visa sau khi đã yêu cầu trường bên Hàn gửi giấy tờ gốc. Vì thế đúc kết kinh nghiệm cho các anh em khi đi xin Visa ở đại sứ quán Hàn Quốc.
Vì thế anh em nào đi du học Hàn Quốc cần yêu cầu họ gửi cho các giấy [...]]]></description>
			<content:encoded><![CDATA[<p>Chào các bạn.</p>
<p>Nay đi làm Visa sau khi đã yêu cầu trường bên Hàn gửi giấy tờ gốc. Vì thế đúc kết kinh nghiệm cho các anh em khi đi xin Visa ở đại sứ quán Hàn Quốc.</p>
<p>Vì thế anh em nào đi du học Hàn Quốc cần yêu cầu họ gửi cho các giấy tờ gốc sau:</p>
<ul>
<li>Giấy nhập học có đóng dấu (mặc dù ng bên Hàn bảo là contact với đại sứ quán bảo là k cần dâu)</li>
<li>Giấy chứng nhận học bổng</li>
<li>Thư giới thiệu của giáo sư</li>
</ul>
<p>Còn các giấy tờ khác thì cứ theo <a href="http://hanquocngaynay.com/embassy_detail.php?key=5"  target="_blank">qui định</a> của đại sứ quán mà làm.</p>
<p>Để được làm nhanh thì cần như sau:</p>
<ul>
<li>Sáng dạy xếp hàng từ <strong>5h</strong>, để ghi tên vào danh sách chờ.</li>
<li>7h30, nhân viên ra đọc tên, đưa CMT vào. Đi đâu chơi.</li>
<li>9h, bắt đầu làm việc vào nhanh k có k thấy tên là ignore ngay.</li>
</ul>
<p>Chúc các bạn thành công.<br />
<h3>Các bài viết liên quan:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/giao-trinh-video-hoc-tieng-han-quoc-44-bai/"  title="Gi&aacute;o tr&igrave;nh Video học tiếng H&agrave;n Quốc 44 b&agrave;i">Gi&aacute;o tr&igrave;nh Video học tiếng H&agrave;n Quốc 44 b&agrave;i</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=TPHQaB"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=TPHQaB" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/352415875" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/kinh-nghiem-lam-visa-tai-dai-su-quan-han-quoc/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/kinh-nghiem-lam-visa-tai-dai-su-quan-han-quoc/</feedburner:origLink></item>
		<item>
		<title>TI is now in Vietnam - Contact us to get support</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/351267805/</link>
		<comments>http://www.ngohaibac.net/ti-is-now-in-vietnam-contact-us-to-get-support/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 07:02:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Tin tức]]></category>

		<category><![CDATA[Electric]]></category>

		<category><![CDATA[Texas Instrument]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=181</guid>
		<description><![CDATA[Chào các bạn.
Hôm nay mình nhận được newsletter của TI thông báo TI đã mở một office tại Vietnam nên thấy hay nên post cho các bạn xem. Mình nghĩ đây là tin mừng cho giới điện tử thường xuyên sử dụng các sản phẩm của TI, bây giờ có cơ hội mua hàng trực [...]]]></description>
			<content:encoded><![CDATA[<p>Chào các bạn.</p>
<p>Hôm nay mình nhận được newsletter của TI thông báo TI đã mở một office tại Vietnam nên thấy hay nên post cho các bạn xem. Mình nghĩ đây là tin mừng cho giới điện tử thường xuyên sử dụng các sản phẩm của TI, bây giờ có cơ hội mua hàng trực tiếp của hãng, cũng như sản phẩm Microchip tại PICVietnam.com. Trụ sở mới đặt tại Lý Thái Tổ ở Hà Nội. Các bạn khảo sát xem nha.</p>
<p>Không hiểu bây giờ TI có còn cho Vietnam sample các loại chip không khi họ đã có trụ sở ở Vietnam. Mình sẽ contact với bên sale của TI xem thế nào.</p>
<p>Dear Customer,<br />
To continuously serve you better and effortlessly. Texas Instruments (TI) opened a new office in Vietnam in July 2008 this year. Please feel free to contact us below. We look forward to supporting you.</p>
<p>TI Vietnam Office<br />
Address:<br />
Texas Instruments Singapore (Pte) Limited<br />
Hanoi Representative Office<br />
Suite 519, 5 Floor, Regus Hanoi Press Club<br />
59A Ly Thai To Street, Hoan Kiem District, Hanoi, Vietnam<br />
TEL: 84-04-936 7937<br />
FAX: 84-04-936 8069</p>
<p><span style="font-size: 12px; font-family: Verdana,Arial,Helvetica,sans-serif; color: #ff0000;"><strong> Sales Contact Information</strong></span></p>
<table style="font-size: 12px; font-family: Arial,Helvetica,sans-serif;" border="0" width="100%" align="center">
<tbody>
<tr>
<td width="24%"><img style="border: 1px solid #aaaaaa;" alt="Hong Quy, Ngo" hspace="2" width="68" height="95" /></td>
<td style="border-right: 0px solid #aaaaaa; padding: 15px;" width="76%">Name: Hong Quy, Ngo<br />
Title: Technical Business Development<br />
Engineer<br />
Email: <a href="mailto:+hongquy.ngo@ti.com" target="_blank">hongquy.ngo@ti.com</a><br />
TEL: 84-04-936 7937<br />
Mobile: 84-915 577 675</td>
</tr>
</tbody>
</table>
<p><span style="font-size: 12px; font-family: Verdana,Arial,Helvetica,sans-serif; color: #ff0000;"><strong> FAE Contact Information</strong></span></p>
<table style="font-size: 12px; font-family: Arial,Helvetica,sans-serif;" border="0" width="100%" align="center">
<tbody>
<tr>
<td width="23%"><img style="border: 1px solid #aaaaaa;" alt="Minh Nguyen" hspace="2" width="68" height="95" /></td>
<td style="border-right: 0px solid #aaaaaa; padding: 15px;" width="77%">Name: Minh Nguyen<br />
Title: Field Application Engineer<br />
Email: <a href="mailto:minhngoc.nguyen@ti.com" target="_blank">minhngoc.nguyen@ti.com</a><br />
TEL: 84-04-936 7938<br />
Mobile: 84-912 824 193</td>
</tr>
</tbody>
</table>
<table style="font-size: 12px; font-family: Arial,Helvetica,sans-serif;" border="0" width="100%" align="center">
<tbody>
<tr>
<td width="23%"><img style="border: 1px solid #aaaaaa;" alt="Alvin Chee" hspace="2" width="68" height="95" /></td>
<td style="border-right: 0px solid #aaaaaa; padding: 15px;" width="77%"><img alt="Alvin Chee" /><br />
Best regards,<br />
Sales Manager</td>
</tr>
</tbody>
</table>
<p>Chúc các bạn thành công.<br />
<h3>Các bài viết ngẫu nhiên:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/cai-d%e1%ba%b7t-p2p-emule-client-trong-ubuntu/"  title="Cài đặt P2P Emule Client trong Ubuntu">Cài đặt P2P Emule Client trong Ubuntu</a></li>
<li><a href="http://www.ngohaibac.net/tao-hinh-nen-cho-giao-dien-gui/"  title="Tạo h&igrave;nh nền cho giao diện GUI">Tạo h&igrave;nh nền cho giao diện GUI</a></li>
<li><a href="http://www.ngohaibac.net/thong-bao-tuyen-sinh-lop-ielts-moi-thang-52008/"  title="Th&ocirc;ng b&aacute;o tuyển sinh lớp IELTS mới, th&aacute;ng 5/2008">Th&ocirc;ng b&aacute;o tuyển sinh lớp IELTS mới, th&aacute;ng 5/2008</a></li>
<li><a href="http://www.ngohaibac.net/quan-ly-va-build-project-voi-trinh-dich-htpic-bang-visual-cnet-2005/"  title="Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005">Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005</a></li>
<li><a href="http://www.ngohaibac.net/cai-dat-ubuntu-bang-hinh-anh-co-su-dung-buoc-chia-o-bang-hiren-boot-c/"  title="Cài đặt Ubuntu bằng hình ảnh có sử dụng bước chia ổ bằng Hirenboot CD">Cài đặt Ubuntu bằng hình ảnh có sử dụng bước chia ổ bằng Hirenboot CD</a></li>
<li><a href="http://www.ngohaibac.net/phan-mem-mo-phong-mach-dien-tu-proteus-72-sp6/"  title="Phần mềm mô phỏng mạch điện tử: Proteus 7.2 SP6">Phần mềm mô phỏng mạch điện tử: Proteus 7.2 SP6</a></li>
<li><a href="http://www.ngohaibac.net/picoblaze-8-bit-embedded-microcontroller/"  title="PicoBlaze 8-bit Embedded Microcontroller">PicoBlaze 8-bit Embedded Microcontroller</a></li>
<li><a href="http://www.ngohaibac.net/longman-dictionary-of-contemporary-skydriver/"  title="Longman Dictionary of Contemporary &ndash; Skydriver">Longman Dictionary of Contemporary &ndash; Skydriver</a></li>
<li><a href="http://www.ngohaibac.net/mot-so-trang-chia-se-ebook-phan-mem-rat-hay/"  title="Một số trang web chia sẻ ebook, phần mềm rất là hay">Một số trang web chia sẻ ebook, phần mềm rất là hay</a></li>
<li><a href="http://www.ngohaibac.net/them-thu-vien-rar-cho-trinh-giai-nen-cua-ubuntu-804-lts/"  title="Thêm thư viện rar cho trình giải nén của Ubuntu 8.04 LTS">Thêm thư viện rar cho trình giải nén của Ubuntu 8.04 LTS</a></li>
<li><a href="http://www.ngohaibac.net/phim-hoat-hinh-inuyash/"  title="Phim hoạt hình: Inuyasha">Phim hoạt hình: Inuyasha</a></li>
<li><a href="http://www.ngohaibac.net/hinh-anh-chup-buoi-le-tot-nghiep-04-06-2008/"  title="C&aacute;c h&igrave;nh ảnh chụp buổi lễ bảo vệ tốt nghiệp 04/06/2008">C&aacute;c h&igrave;nh ảnh chụp buổi lễ bảo vệ tốt nghiệp 04/06/2008</a></li>
<li><a href="http://www.ngohaibac.net/login-error-homedmrc-error/"  title="Login error $home/.dmrc error">Login error $home/.dmrc error</a></li>
<li><a href="http://www.ngohaibac.net/hien-thi-led-7-thanh-tren-gui-matlab/"  title="Hiển thị Led 7 thanh tr&ecirc;n GUI Matlab">Hiển thị Led 7 thanh tr&ecirc;n GUI Matlab</a></li>
<li><a href="http://www.ngohaibac.net/khoi-phuc-lai-trang-thai-mac-dinh-cua-gnome-panel-trong-ubuntu-804-lts/"  title="Khôi phục lại trạng thái mặc định của gnome-panel trong Ubuntu 8.04 LTS">Khôi phục lại trạng thái mặc định của gnome-panel trong Ubuntu 8.04 LTS</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=gANXKx"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=gANXKx" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/351267805" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/ti-is-now-in-vietnam-contact-us-to-get-support/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/ti-is-now-in-vietnam-contact-us-to-get-support/</feedburner:origLink></item>
		<item>
		<title>Programming 32-bit Microcontrollers in C: Exploring the PIC32 by Lucio Di Jasio</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/345422418/</link>
		<comments>http://www.ngohaibac.net/programming-32-bit-microcontrollers-in-c-exploring-the-pic32-by-lucio-di-jasio/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 07:40:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Microchip PIC]]></category>

		<category><![CDATA[Microchip]]></category>

		<category><![CDATA[PIC32]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=179</guid>
		<description><![CDATA[Homepage: http://www.exploringpic32.com/index.html
Chào các bạn.
Vào trang support của Microchip thì thấy họ giới thiệu tài liệu này dành cho khám phá vi điều khiển 32 bit của Microchip PIC rất hay nên mình tìm kiếm và download ngay về, đỡ phải bỏ tiền ra. Các bạn sinh viên nhà mình không có nhiều tiền mà ham [...]]]></description>
			<content:encoded><![CDATA[<p>Homepage: <a href="http://www.exploringpic32.com/index.html"  target="_blank">http://www.exploringpic32.com/index.html</a></p>
<p>Chào các bạn.</p>
<p>Vào trang <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=2604"  target="_blank">support của Microchip</a> thì thấy họ giới thiệu tài liệu này dành cho khám phá vi điều khiển 32 bit của Microchip PIC rất hay nên mình tìm kiếm và download ngay về, đỡ phải bỏ tiền ra. Các bạn sinh viên nhà mình không có nhiều tiền mà ham học thì có thể download.</p>
<p>Lời giới thiệu về cuốn sách:</p>
<h1 style="text-align: center;"><span style="font-weight: bold;"><img src="http://www.exploringpic32.com/resources/PIC32+cover.GIF" border="0" alt="" width="193" height="240" /></span></h1>
<p><span style="color: #0000df;"><em>Excerpt from the back cover:</em><br />
&#8220;Experienced PIC users and newcomers to the field alike will benefit from the texts many thorough examples which demonstrate how to nimbly side-step common obstacles, solve real-world design problems efficiently and optimize code using the new PIC32 features and peripheral set.&#8221; </span></p>
<p>Phần mã nguồn đi kèm các bạn có thể vào trong homepage của tác giả để download nhé.</p>
<p><img src="http://i36.photobucket.com/albums/e46/ngohaibac/Blog%20Wordpress/download_img.gif" alt="" /></p>
<p><a href="http://cid-fde2b41588160e26.skydrive.live.com/self.aspx/Microchip|_PIC/Newnes.Programming.32-bit.Microcontrollers.in.C.Exploring.the.PIC32.Apr.2008.eBook-DDU.pdf"  target="_blank">Programming 32-bit Microcontrollers in C: Exploring the PIC32 by Lucio Di Jasio</a><br />
<h3>Các bài viết liên quan:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/phuong-phap-quet-keypad-ma-tran-ban-phim-dung-ngat-timer/"  title="Phương ph&aacute;p qu&eacute;t keypad &ndash; ma trận ph&iacute;m bấm d&ugrave;ng ngắt Timer">Phương ph&aacute;p qu&eacute;t keypad &ndash; ma trận ph&iacute;m bấm d&ugrave;ng ngắt Timer</a></li>
<li><a href="http://www.ngohaibac.net/phan-tich-thuat-toan-thuc-hien-lenh-dieu-khien-pc-qua-rs232/"  title="Ph&acirc;n t&iacute;ch thuật to&aacute;n: thực hiện lệnh điều khiển từ PC qua RS232">Ph&acirc;n t&iacute;ch thuật to&aacute;n: thực hiện lệnh điều khiển từ PC qua RS232</a></li>
<li><a href="http://www.ngohaibac.net/pic16f887-dieu-khien-thoi-gian-dong-cat-mot-led-tu-pc-qua-uart/"  title="PIC16F887 &ndash; Điều khiển thời gian đ&oacute;ng cắt một led từ PC qua UART">PIC16F887 &ndash; Điều khiển thời gian đ&oacute;ng cắt một led từ PC qua UART</a></li>
<li><a href="http://www.ngohaibac.net/ket-noi-usb-icd2-pickit2-voi-piklab-trong-ubuntu-os/"  title="Kết nối USB ICD2,PICKit,&#8230;  với Piklab trong Ubuntu OS">Kết nối USB ICD2,PICKit,&#8230;  với Piklab trong Ubuntu OS</a></li>
<li><a href="http://www.ngohaibac.net/quan-ly-va-build-project-voi-trinh-dich-htpic-bang-visual-cnet-2005/"  title="Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005">Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005</a></li>
<li><a href="http://www.ngohaibac.net/htpicc-960pl1-trnh-d%e1%bb%8bch-c-dnh-cho-pic16/"  title="HTPICC 9.60PL1 - Tr&igrave;nh dịch C d&agrave;nh cho PIC16">HTPICC 9.60PL1 - Tr&igrave;nh dịch C d&agrave;nh cho PIC16</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=47QU3c"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=47QU3c" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/345422418" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/programming-32-bit-microcontrollers-in-c-exploring-the-pic32-by-lucio-di-jasio/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/programming-32-bit-microcontrollers-in-c-exploring-the-pic32-by-lucio-di-jasio/</feedburner:origLink></item>
		<item>
		<title>Foxmarks Bookmark Synchronizer - Đồng bộ bookmark của bạn</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/342087413/</link>
		<comments>http://www.ngohaibac.net/foxmarks-bookmark-synchronizer-dong-bo-bookmark-cua-ban/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 01:42:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Thủ thuật, phần mềm linh tinh]]></category>

		<category><![CDATA[addons]]></category>

		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=173</guid>
		<description><![CDATA[Chào các bạn.
Mình dùng Internet rất nhiều nên lượng bookmark rất lớn, khổ cái là khi cài lại Win nếu mà quên không export cái bookmark.htm ra thì có ngồi mà khóc vì chẳng nhớ được hết những site mà mình bookmark vào. Đôi khi nhiều site rất quan trọng.
Hôm trước vào thử addons của [...]]]></description>
			<content:encoded><![CDATA[<p>Chào các bạn.</p>
<p>Mình dùng Internet rất nhiều nên lượng bookmark rất lớn, khổ cái là khi cài lại Win nếu mà quên không export cái bookmark.htm ra thì có ngồi mà khóc vì chẳng nhớ được hết những site mà mình bookmark vào. Đôi khi nhiều site rất quan trọng.</p>
<p>Hôm trước vào thử addons của firefox thì thấy cái addons<strong> Foxmarks Bookmark Synchronizer</strong> rất hay. Khi cài đặt và đăng ký tài khoản thì addons sẽ tự động đồng bộ bookmarks của firefox với dữ liệu trên server của <a href="http://www.foxmarks.com"  target="_blank">www.foxmarks.com</a> nên an tâm mà dùng nha. Có thể chuyển hệ điều hành liên tục mà chẳng sợ mất gì cả.</p>
<p>Giới thiệu dài quá ke ke. Không sao cái này rất đơn giản:</p>
<p>Cài đặt:<a href="https://addons.mozilla.org/en-US/firefox/addon/2410" > https://addons.mozilla.org/en-US/firefox/addon/2410</a> nhấn vào nút <strong>Add to firefox</strong> là xong.</p>
<p>Khi khởi động lại firefox sẽ hiện ra bảng hướng dẫn các bạn tạo một account và nó sẽ tự đồng bộ bookmarks của bạn. Có thể login vào site foxmarks.com để quản lý bookmarks của bạn.</p>
<p>Chúc các bạn thành công.<br />
<h3>Các bài viết liên quan:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/thu-thuat-firefox-css-voi-firefox/"  title="Thủ thuật Firefox: CSS với Firefox">Thủ thuật Firefox: CSS với Firefox</a></li>
<li><a href="http://www.ngohaibac.net/toi-uu-trinh-duyet-firefox-de-giam-bo-nho-ram-ma-no-su-dung/"  title="Tối ưu trình duyệt Firefox - giảm bộ nhớ RAM sử dụng">Tối ưu trình duyệt Firefox - giảm bộ nhớ RAM sử dụng</a></li>
<li><a href="http://www.ngohaibac.net/tu-dien-cho-nguoi-viet-nhung-tu-dien-vao-firefox-cua-ban/"  title="Từ điển cho người Việt -nhúng từ điển vào trình duyệt Firefox của bạn">Từ điển cho người Việt -nhúng từ điển vào trình duyệt Firefox của bạn</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=zSdeam"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=zSdeam" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/342087413" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/foxmarks-bookmark-synchronizer-dong-bo-bookmark-cua-ban/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/foxmarks-bookmark-synchronizer-dong-bo-bookmark-cua-ban/</feedburner:origLink></item>
		<item>
		<title>Phương pháp quét keypad – ma trận phím bấm dùng ngắt Timer</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/338991081/</link>
		<comments>http://www.ngohaibac.net/phuong-phap-quet-keypad-ma-tran-ban-phim-dung-ngat-timer/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 13:17:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Lập trình]]></category>

		<category><![CDATA[Microchip PIC]]></category>

		<category><![CDATA[keypad]]></category>

		<category><![CDATA[Microchip]]></category>

		<category><![CDATA[PIC]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/phuong-phap-quet-keypad-ma-tran-ban-phim-dung-ngat-timer/</guid>
		<description><![CDATA[Chào các bạn.
Mình không biết phương pháp này các bạn biết chưa, hoặc đã ai post chưa. Nhưng đó là mình suy nghĩ và code ra chứ không hề copy ý tưởng hay code của ai khác :D.
Phương pháp dựa trên dùng ngắt Timer0 dùng cho PIC16F887 do đó sẽ rất là tối ưu, tất [...]]]></description>
			<content:encoded><![CDATA[<p>Chào các bạn.</p>
<p>Mình không biết phương pháp này các bạn biết chưa, hoặc đã ai post chưa. Nhưng đó là mình suy nghĩ và code ra chứ không hề copy ý tưởng hay code của ai khác :D.</p>
<p>Phương pháp dựa trên dùng ngắt Timer0 dùng cho PIC16F887 do đó sẽ rất là tối ưu, tất nhiên có thể dùng cho tất cả các loại PIC và vi điều khiển khác.</p>
<p>Cấu tạo của Keypad:</p>
<p><a href="http://esd.cs.ucr.edu/labs/calc/keypad.gif"  target="_blank" rel="lightbox[171]"><img src="http://esd.cs.ucr.edu/labs/calc/keypad.gif" alt="" /></a></p>
<p>Nội dung của phương pháp này như sau, rất đơn giản giống tư tưởng của các phương pháp scan truyền thống:</p>
<p>B1. Cho các cột = 1</p>
<p>B2. Đọc các hàng, nếu hàng nào = 1, thì sau khoảng 10 đến 15ms thì lại đọc tiếp. Nếu vẫn = 1 thì à, đúng là phím bấm rồi, ke ke. Như vậy xác định được hàng nào rồi nha. Cho vào biến row_num.</p>
<p>B3. Cho row_num = 1, đọc các cột xem, cột nào = 1 thì đó là cột bấm đó, gán vào biến col_num. Chờ khi phím nhả thì gọi hàm thực hiện theo từng phím key_function();</p>
<p>Rất đơn giản như thế nhưng mình thực hiện rất tối ưu, các bạn có thể tham khảo:</p>
<table border="1" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td width="400" valign="top">void scanKeypad(void){<br />
unsigned char i;        // Define i as register later<br />
// if state 0 then set column to 1, and see the change of row<br />
switch(progress){<br />
case 0:<br />
// set all column (4 low bit) as output, and row as input, and write &#8216;1&#8242; to column<br />
tris_keypad    =  0xF0;<br />
port_keypad |= 0&#215;0F;<br />
// if value of row diffirent than 0,then set progress to 1<br />
// and set Tcycle = 10<br />
if ((port_keypad &amp; 0xF0) != 0) {<br />
// Determine next state<br />
progress = 1;<br />
cycle_1  = 10;<br />
}else{<br />
progress = 0;<br />
};<br />
break;</p>
<p>// Progress 1, check after 10 ms<br />
case 1:<br />
cycle_1&#8211;;<br />
// when cycle_1 = 0,then check again<br />
if(cycle_1 == 0){<br />
if ((port_keypad &amp; 0xF0) != 0) {<br />
// Determine which row equal 1<br />
for(i = 7; i&gt;3; i&#8211;){<br />
if ( (port_keypad &amp; (1&lt;&lt;i)) != 0){<br />
row_num = i-3;<br />
break;<br />
};<br />
};<br />
//Determine next state<br />
progress = 2;<br />
}else{<br />
progress = 0;        // Start state<br />
};<br />
};<br />
break;<br />
// Progress 2, to determind the column<br />
case 2:<br />
//Set row tris to 0,<br />
// row_num corespond to (row_num + 3) bit in port_keypad<br />
tris_keypad ^= 1&lt;&lt;(row_num + 3);        // clear tris bit of row to 0, as output<br />
tris_keypad    |= 0&#215;0F;                    // Set all pin of column as input(0 to 3)<br />
port_keypad != 1&lt;&lt;(row_num + 3);<br />
for(i = 0;i&lt;4;i++){<br />
if ( (port_keypad &amp; (1&lt;&lt;i)) != 0){<br />
col_num = i+1;<br />
break;<br />
};<br />
};<br />
// Wait for user release key<br />
while ((port_keypad &amp; (1&lt;&lt;i)) != 0);<br />
// Do all function of keypad after scan sucessfully<br />
key_function();<br />
//Determind the next state<br />
progress = 0;<br />
//cycle_2  = 0xFF;<br />
break;<br />
default:<br />
break;<br />
};<br />
};</td>
</tr>
</tbody>
</table>
<p>Bài toán của mình chỉ thực hiện sau khi nhấn phím nên mình mới chờ khi nhả phím. Còn để xác định phím hold hay là nhấn thì dùng thêm process thứ 3, sau thời gian khoảng 250ms nữa hoặc hơn tùy bạn, kiểm tra lại trạng thái của phím bấm đó, nếu thấy vẫn = 1 thì tức là trạng thái hold, còn lại là trạng thái nhấn phím.</p>
<p>Các biến được dùng trong hàm quét phím có thể được khai báo bằng Macro và khai báo biến global.Mình dùng các thanh ghi làm biến, các bạn chú ý dùng để không trùng vào các module đang dùng.</p>
<table border="1" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td width="400" valign="top">//Define for keypad on PORTD<br />
#define port_keypad PORTD<br />
#define tris_keypad TRISD</p>
<p>#define progress    TXREG        //process variable<br />
#define row_num        TMR1L        // Index of row<br />
#define col_num        CCPR2L        // Index of column</p>
<p>#define cycle_1        CCPR2H        // 10ms</td>
</tr>
</tbody>
</table>
<p>Vậy chỉ cần thay PORTD bằng bất kì port nào khác mà keypad nối vào là được.</p>
<p>Còn hàm key_function() dùng để thực hiện các lệnh của phím, tùy các bạn.</p>
<table border="1" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td width="400" valign="top">void key_function(void){<br />
switch(row_num){<br />
case 1:<br />
switch(col_num){<br />
case 1:        //Key 1<br />
case 2:        // Key 2<br />
case 3:        // Key 3</p>
<p>………………….<br />
}</td>
</tr>
</tbody>
</table>
<p>Chú ý: các bạn gọi hàm này trong hàm ngắt của Timer, bao nhiêu ms hay ns là tùy bạn.</p>
<p>Chúc các bạn thành công.<br />
<h3>Các bài viết liên quan:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/phan-tich-thuat-toan-thuc-hien-lenh-dieu-khien-pc-qua-rs232/"  title="Ph&acirc;n t&iacute;ch thuật to&aacute;n: thực hiện lệnh điều khiển từ PC qua RS232">Ph&acirc;n t&iacute;ch thuật to&aacute;n: thực hiện lệnh điều khiển từ PC qua RS232</a></li>
<li><a href="http://www.ngohaibac.net/quan-ly-va-build-project-voi-trinh-dich-htpic-bang-visual-cnet-2005/"  title="Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005">Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005</a></li>
<li><a href="http://www.ngohaibac.net/htpicc-960pl1-trnh-d%e1%bb%8bch-c-dnh-cho-pic16/"  title="HTPICC 9.60PL1 - Tr&igrave;nh dịch C d&agrave;nh cho PIC16">HTPICC 9.60PL1 - Tr&igrave;nh dịch C d&agrave;nh cho PIC16</a></li>
<li><a href="http://www.ngohaibac.net/programming-32-bit-microcontrollers-in-c-exploring-the-pic32-by-lucio-di-jasio/"  title="  Programming 32-bit Microcontrollers in C: Exploring the PIC32 by Lucio Di Jasio">  Programming 32-bit Microcontrollers in C: Exploring the PIC32 by Lucio Di Jasio</a></li>
<li><a href="http://www.ngohaibac.net/pic16f887-dieu-khien-thoi-gian-dong-cat-mot-led-tu-pc-qua-uart/"  title="PIC16F887 &ndash; Điều khiển thời gian đ&oacute;ng cắt một led từ PC qua UART">PIC16F887 &ndash; Điều khiển thời gian đ&oacute;ng cắt một led từ PC qua UART</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=pZoNfK"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=pZoNfK" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/338991081" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/phuong-phap-quet-keypad-ma-tran-ban-phim-dung-ngat-timer/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/phuong-phap-quet-keypad-ma-tran-ban-phim-dung-ngat-timer/</feedburner:origLink></item>
		<item>
		<title>Wordpress 2.6</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/336975682/</link>
		<comments>http://www.ngohaibac.net/wordpress-26/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 11:06:38 +0000</pubDate>
		<dc:creator>ngohaibac</dc:creator>
		
		<category><![CDATA[Thông báo]]></category>

		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=169</guid>
		<description><![CDATA[Chào các bạn.
Hôm qua, thấy Wordpress thông báo có bản 2.6 nên update ngay he he. Mấy hôm nay đang bận làm một dự án nên k có time để viết bài. Các bạn thông cảm nha.
Chúc các bạn thành công.
Các bài viết ngẫu nhiên:

MY WORLD - địa chỉ học English rất hay
Th&#244;ng b&#225;o tuyển [...]]]></description>
			<content:encoded><![CDATA[<p>Chào các bạn.</p>
<p>Hôm qua, thấy Wordpress thông báo có bản 2.6 nên update ngay he he. Mấy hôm nay đang bận làm một dự án nên k có time để viết bài. Các bạn thông cảm nha.</p>
<p>Chúc các bạn thành công.<br />
<h3>Các bài viết ngẫu nhiên:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/cai-dat-mot-file-bin-trong-ubuntu-804-lt/"  title="Cài đặt một file .bin trong Ubuntu 8.04 LTS">Cài đặt một file .bin trong Ubuntu 8.04 LTS</a></li>
<li><a href="http://www.ngohaibac.net/english-sharing-and-learning-esl-and-quataoorg/"  title="English Sharing and Learning (ESL) and quatao.org">English Sharing and Learning (ESL) and quatao.org</a></li>
<li><a href="http://www.ngohaibac.net/bai-hoc-ve-nghien-cuu-cua-anh-hie/"  title="Stepper motor: Bài học về nghiên cứu của anh Hiệp">Stepper motor: Bài học về nghiên cứu của anh Hiệp</a></li>
<li><a href="http://www.ngohaibac.net/get-data-from-scope-and-display-in-plot/"  title="Thủ thuật Matlab - Lấy lại số liệu tr&ecirc;n Scope v&agrave; hiển thị tr&ecirc;n đồ thị">Thủ thuật Matlab - Lấy lại số liệu tr&ecirc;n Scope v&agrave; hiển thị tr&ecirc;n đồ thị</a></li>
<li><a href="http://www.ngohaibac.net/learn-visual-c-video-tutorials/"  title="Learn Visual C#: Video Tutorials">Learn Visual C#: Video Tutorials</a></li>
<li><a href="http://www.ngohaibac.net/kidcad-phan-mem-ve-mach-mien-phi-tren-ubuntu/"  title="Kicad: phần mềm vẽ mạch in miễn phí">Kicad: phần mềm vẽ mạch in miễn phí</a></li>
<li><a href="http://www.ngohaibac.net/cambridge-advanced-grammar-in-use-cd-rom/"  title="Cambridge Advanced Grammar in use - CD ROM">Cambridge Advanced Grammar in use - CD ROM</a></li>
<li><a href="http://www.ngohaibac.net/giao-trinh-video-hoc-tieng-han-quoc-44-bai/"  title="Gi&aacute;o tr&igrave;nh Video học tiếng H&agrave;n Quốc 44 b&agrave;i">Gi&aacute;o tr&igrave;nh Video học tiếng H&agrave;n Quốc 44 b&agrave;i</a></li>
<li><a href="http://www.ngohaibac.net/cach-doc-tin-bang-rss-la-gi/"  title="C&aacute;ch đọc tin bằng RSS l&agrave; g&igrave; ?">C&aacute;ch đọc tin bằng RSS l&agrave; g&igrave; ?</a></li>
<li><a href="http://www.ngohaibac.net/cong-chung-ban-dich-tieng-anh-danh-cho-cac-sinh-vien-bkhn/"  title="Công chứng bản dịch tiếng Anh dành cho các sinh viên BKHN">Công chứng bản dịch tiếng Anh dành cho các sinh viên BKHN</a></li>
<li><a href="http://www.ngohaibac.net/tao-hinh-nen-cho-giao-dien-gui/"  title="Tạo h&igrave;nh nền cho giao diện GUI">Tạo h&igrave;nh nền cho giao diện GUI</a></li>
<li><a href="http://www.ngohaibac.net/tam-thoi-ngung-viet-blog/"  title="Tạm thời ngừng viết blog">Tạm thời ngừng viết blog</a></li>
<li><a href="http://www.ngohaibac.net/phan-mem-mo-phong-mach-dien-tu-proteus-72-sp6/"  title="Phần mềm mô phỏng mạch điện tử: Proteus 7.2 SP6">Phần mềm mô phỏng mạch điện tử: Proteus 7.2 SP6</a></li>
<li><a href="http://www.ngohaibac.net/mot-so-cach-de-download-tu-rapidsharecom-va-megaupload/"  title="Một số cách để download từ rapidshare.com và megaupload.com">Một số cách để download từ rapidshare.com và megaupload.com</a></li>
<li><a href="http://www.ngohaibac.net/xilinx-ise-91i-full-version-dvd/"  title="Xilinx ISE 9.1i Full Version DVD">Xilinx ISE 9.1i Full Version DVD</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=VwBQl6"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=VwBQl6" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/336975682" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/wordpress-26/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/wordpress-26/</feedburner:origLink></item>
		<item>
		<title>Phân tích thuật toán: thực hiện lệnh điều khiển từ PC qua RS232</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/333570526/</link>
		<comments>http://www.ngohaibac.net/phan-tich-thuat-toan-thuc-hien-lenh-dieu-khien-pc-qua-rs232/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 14:52:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Microchip PIC]]></category>

		<category><![CDATA[Microchip]]></category>

		<category><![CDATA[Microprocessing]]></category>

		<category><![CDATA[PIC]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/phan-tich-thuat-toan-thuc-hien-lenh-dieu-khien-pc-qua-rs232/</guid>
		<description><![CDATA[Chào các bạn. 
Không biết ai đã đọc bài viết của mình PIC16F887 – Điều khiển thời gian đóng cắt một led từ PC qua UART chưa. Trong này, mình có thực hiện đặt thời gian đóng cắt từ PC bằng lệnh với cú pháp.
Txyzt#: trong đó&#160; xyzt là thời gian tính theo hệ hexa.
Đây [...]]]></description>
			<content:encoded><![CDATA[<p>Chào các bạn. </p>
<p>Không biết ai đã đọc bài viết của mình <a href="http://www.ngohaibac.net/pic16f887-dieu-khien-thoi-gian-dong-cat-mot-led-tu-pc-qua-uart/"  target="_blank">PIC16F887 – Điều khiển thời gian đóng cắt một led từ PC qua UART</a> chưa. Trong này, mình có thực hiện đặt thời gian đóng cắt từ PC bằng lệnh với cú pháp.</p>
<p>Txyzt#: trong đó&#160; xyzt là thời gian tính theo hệ hexa.</p>
<p>Đây là đoạn chương trình xử lý ngắt UART:</p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="400">
<p>void RxIntFcn(void){           <br />&#160;&#160;&#160; UART_Data = UART_Read();            <br />&#160;&#160;&#160; UART_PrChar(UART_Data);            <br />&#160;&#160;&#160; // Detect set time command            <br />&#160;&#160;&#160; // as format: Txy#            <br />&#160;&#160;&#160; switch (progress){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 0:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //Initialize            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(UART_Data == &#8216;T&#8217;)            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; switch(UART_Data){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;1&#8242;:             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB6&#160;&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;6F; // 1/9 s = 111 ms            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;2&#8242;:             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB6&#160;&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0xDE; // 2/9            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;3&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;4D;&#160;&#160;&#160; // 1s = 1000 = 0&#215;03E8            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;4&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0xBC;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;01;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;5&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;2B;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;02;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;6&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;9A;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;02;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;7&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;09;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;03;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;8&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;78;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;03;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;9&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0xE7;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;03;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;0&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0xE8;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;03;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; default:            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; PORTB&#160;&#160; &amp;= 0&#215;80;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 1:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Received &#8216;T&#8217; character            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Determind next state            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (ishexa(UART_Data) == 1){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 2;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Write data to acc1            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; acc1&#160;&#160;&#160;&#160; = ascii2num(UART_Data);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Command error&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 2:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Received &#8216;x&#8217; character            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (ishexa(UART_Data) == 1){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 3;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Write data to acc2            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; acc2&#160;&#160;&#160;&#160; = ascii2num(UART_Data);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Command error&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 3:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Received &#8216;x&#8217; character            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (ishexa(UART_Data) == 1){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 4;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Write data to acc2            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; acc3&#160;&#160;&#160;&#160; = ascii2num(UART_Data);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Command error&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 4:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Received &#8216;x&#8217; character            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (ishexa(UART_Data) == 1){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 5;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Write data to acc2            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; acc4&#160;&#160;&#160;&#160; = ascii2num(UART_Data);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Command error&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 5:            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (UART_Data == &#8216;#&#8217;){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Write &#8216;OK&#8217; statement            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Timer is set&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Update data from ACC to led1_counter_acc            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cnt_acc1 = (acc1&lt;&lt;4) | acc2;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cnt_acc2 = (acc3&lt;&lt;4) | acc4;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Command error&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; default: progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160; }; </p>
<p>&#160;&#160;&#160; // On, off command           <br />&#160;&#160;&#160; switch(UART_Data){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;P&#8217;:&#160;&#160;&#160;&#160;&#160;&#160;&#160; // On led            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Update led1_counter            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = led1_cnt_acc1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = led1_cnt_acc2;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;S&#8217;:            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Clear led1_counter content            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160; };            <br />}</p>
</td>
</tr>
</tbody>
</table>
</p>
<p>Thuật toán mình sử dụng rất đơn giản: dùng một biến progress là biến quá trình. Mặc định giá trị này là 0, khi nhận dc đúng kí tự T thì biến sẽ có giá trị = 1. Khi đó, nó sẽ kiểm tra tiếp theo có phải gõ vào là chữ số từ 0 đến 9, và từ A đến F hay không.Mỗi trạng thái, khi nhận đúng đều chuyển từ giá trị string sang giá trị số, ví dụ: kí tự ‘0’ chuyển thành giá trị unsigned char là 1. Xem hàm này trong hàm system.h. Nếu đúng thì progress tiếp tục tăng đến trạng thái kiểm tra tiếp theo, nếu không nó sẽ báo lỗi “Command Error” gửi lên PC.</p>
<p>Tiếp tục, đến cuối cùng khi nhận xong kí tự # thì tức là đã nhận đúng lệnh và thực hiện gán dữ liệu để lấy ra byte cao và byte thấp của giá trị nhập vào.</p>
<p>Đây là hàm system.h</p>
</p>
</p>
</p>
</p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="400">
<p>bit ishexa(unsigned char a){            <br />&#160;&#160;&#160; if ((a &gt;= ‘0′ &amp;&amp; a&lt;= ‘9′) || (a&gt;= ‘A’ &amp;&amp; a&lt;= ‘F’))             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return 1;             <br />&#160;&#160;&#160; else return 0;             <br />}; </p>
<p>// Convert from ASCII to number            <br />unsigned char ascii2num(unsigned char a){             <br />&#160;&#160;&#160; if( a &gt;= ‘0′ &amp;&amp; a&lt;= ‘9′)             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return (a-’0′);             <br />&#160;&#160;&#160; else             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return (a-’A’ + 0×0A);             <br />}</p>
</td>
</tr>
</tbody>
</table>
<p>Hi vọng phân tích của mình làm các bạn hiểu được cách để thực hiện các lệnh điều khiển từ PC hiệu quả. </p>
<p>Chúc các bạn thành công.</p>
<h3>Các bài viết liên quan:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/phuong-phap-quet-keypad-ma-tran-ban-phim-dung-ngat-timer/"  title="Phương ph&aacute;p qu&eacute;t keypad &ndash; ma trận ph&iacute;m bấm d&ugrave;ng ngắt Timer">Phương ph&aacute;p qu&eacute;t keypad &ndash; ma trận ph&iacute;m bấm d&ugrave;ng ngắt Timer</a></li>
<li><a href="http://www.ngohaibac.net/quan-ly-va-build-project-voi-trinh-dich-htpic-bang-visual-cnet-2005/"  title="Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005">Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005</a></li>
<li><a href="http://www.ngohaibac.net/htpicc-960pl1-trnh-d%e1%bb%8bch-c-dnh-cho-pic16/"  title="HTPICC 9.60PL1 - Tr&igrave;nh dịch C d&agrave;nh cho PIC16">HTPICC 9.60PL1 - Tr&igrave;nh dịch C d&agrave;nh cho PIC16</a></li>
<li><a href="http://www.ngohaibac.net/programming-32-bit-microcontrollers-in-c-exploring-the-pic32-by-lucio-di-jasio/"  title="  Programming 32-bit Microcontrollers in C: Exploring the PIC32 by Lucio Di Jasio">  Programming 32-bit Microcontrollers in C: Exploring the PIC32 by Lucio Di Jasio</a></li>
<li><a href="http://www.ngohaibac.net/pic16f887-dieu-khien-thoi-gian-dong-cat-mot-led-tu-pc-qua-uart/"  title="PIC16F887 &ndash; Điều khiển thời gian đ&oacute;ng cắt một led từ PC qua UART">PIC16F887 &ndash; Điều khiển thời gian đ&oacute;ng cắt một led từ PC qua UART</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=2K4ORV"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=2K4ORV" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/333570526" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/phan-tich-thuat-toan-thuc-hien-lenh-dieu-khien-pc-qua-rs232/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/phan-tich-thuat-toan-thuc-hien-lenh-dieu-khien-pc-qua-rs232/</feedburner:origLink></item>
		<item>
		<title>Longman Dictionary of Contemporary – Skydriver</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/332781810/</link>
		<comments>http://www.ngohaibac.net/longman-dictionary-of-contemporary-skydriver/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 15:43:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Study English]]></category>

		<category><![CDATA[English]]></category>

		<category><![CDATA[Longman]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/longman-dictionary-of-contemporary-skydriver/</guid>
		<description><![CDATA[
Chào mọi người.
Đã upload xong 2 đĩa Longman Dictionary of Contemporary gồm 2 CD lên skydriver. Mời mọi người download nhé.
Địa chỉ: http://cid-6eb956faea77192b.skydrive.live.com/browse.aspx/English
Pass để giải nén: ngohaibac.net
Chúc mọi người thành công.
Các bài viết liên quan:

Longman Dictionary of Contemporary English, Updated Version
Longman Writing Coach CD
Longman Exams Coach CD
Bài học English về mẹ
Oxford Collocations Dictionary for Students [...]]]></description>
			<content:encoded><![CDATA[</p>
<p>Chào mọi người.</p>
<p>Đã upload xong 2 đĩa Longman Dictionary of Contemporary gồm 2 CD lên skydriver. Mời mọi người download nhé.</p>
<p>Địa chỉ: <a title="http://cid-6eb956faea77192b.skydrive.live.com/browse.aspx/English" href="http://cid-6eb956faea77192b.skydrive.live.com/browse.aspx/English" >http://cid-6eb956faea77192b.skydrive.live.com/browse.aspx/English</a></p>
<p>Pass để giải nén: ngohaibac.net</p>
<p>Chúc mọi người thành công.</p>
<h3>Các bài viết liên quan:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/longman-dictionary-of-contemporary-english-updated-version/"  title="Longman Dictionary of Contemporary English, Updated Version">Longman Dictionary of Contemporary English, Updated Version</a></li>
<li><a href="http://www.ngohaibac.net/longman-writing-coach-cd/"  title="Longman Writing Coach CD">Longman Writing Coach CD</a></li>
<li><a href="http://www.ngohaibac.net/longman-exams-coach-cd/"  title="Longman Exams Coach CD">Longman Exams Coach CD</a></li>
<li><a href="http://www.ngohaibac.net/bai-hoc-english-ve-me/"  title="Bài học English về mẹ">Bài học English về mẹ</a></li>
<li><a href="http://www.ngohaibac.net/oxford-collocations-dictionary-for-students-of-english/"  title="Oxford Collocations Dictionary for Students of English">Oxford Collocations Dictionary for Students of English</a></li>
<li><a href="http://www.ngohaibac.net/thong-bao-tuyen-sinh-lop-ielts-moi-thang-52008/"  title="Th&ocirc;ng b&aacute;o tuyển sinh lớp IELTS mới, th&aacute;ng 5/2008">Th&ocirc;ng b&aacute;o tuyển sinh lớp IELTS mới, th&aacute;ng 5/2008</a></li>
<li><a href="http://www.ngohaibac.net/oxford-learners-grammar-checker/"  title="Oxford Learner&#8217;s Grammar Checker">Oxford Learner&#8217;s Grammar Checker</a></li>
<li><a href="http://www.ngohaibac.net/pronunciation-power/"  title="Pronunciation Power">Pronunciation Power</a></li>
<li><a href="http://www.ngohaibac.net/go-bo-quang-cao-o-phan-mem-paltalk/"  title="Gỡ bỏ quảng c&aacute;o ở phần mềm Paltalk">Gỡ bỏ quảng c&aacute;o ở phần mềm Paltalk</a></li>
<li><a href="http://www.ngohaibac.net/english-sharing-and-learning-esl-and-quataoorg/"  title="English Sharing and Learning (ESL) and quatao.org">English Sharing and Learning (ESL) and quatao.org</a></li>
<li><a href="http://www.ngohaibac.net/tu-dien-cho-nguoi-viet-nhung-tu-dien-vao-firefox-cua-ban/"  title="Từ điển cho người Việt -nhúng từ điển vào trình duyệt Firefox của bạn">Từ điển cho người Việt -nhúng từ điển vào trình duyệt Firefox của bạn</a></li>
<li><a href="http://www.ngohaibac.net/dia-chi-hoc-english-chat-luong-va-hieu-qua/"  title="Địa chỉ học IELTS chất lượng">Địa chỉ học IELTS chất lượng</a></li>
<li><a href="http://www.ngohaibac.net/hoc-nghe-noi-tieng-anh-hieu-qua-voi-phan-mem-paltalk-va-dien-dan-dethicom/"  title="Học nghe, nói tiếng Anh hiệu quả với phần mềm Paltalk và diễn đàn dethi.com">Học nghe, nói tiếng Anh hiệu quả với phần mềm Paltalk và diễn đàn dethi.com</a></li>
<li><a href="http://www.ngohaibac.net/myword-dia-chi-hoc-english-rat-hay/"  title="MY WORLD - địa chỉ học English rất hay">MY WORLD - địa chỉ học English rất hay</a></li>
<li><a href="http://www.ngohaibac.net/cambridge-advanced-grammar-in-use-cd-rom/"  title="Cambridge Advanced Grammar in use - CD ROM">Cambridge Advanced Grammar in use - CD ROM</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=DX2Wrq"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=DX2Wrq" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/332781810" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/longman-dictionary-of-contemporary-skydriver/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/longman-dictionary-of-contemporary-skydriver/</feedburner:origLink></item>
		<item>
		<title>PIC16F887 – Điều khiển thời gian đóng cắt một led từ PC qua UART</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/332754853/</link>
		<comments>http://www.ngohaibac.net/pic16f887-dieu-khien-thoi-gian-dong-cat-mot-led-tu-pc-qua-uart/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 15:10:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Microchip PIC]]></category>

		<category><![CDATA[Microchip]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/pic16f887-dieu-khien-thoi-gian-dong-cat-mot-led-tu-pc-qua-uart/</guid>
		<description><![CDATA[Chào các bạn.
Nay ngồi code cho con PIC16F887 để điều khiển đèn halogen, thực ra chính là điều khiển một chân rồi qua TIP122 và relay để điều khiển đèn thôi (vì dòng tải lên tới 10A).
Mình thấy cách viết hay nên chia sẻ với các bạn. Dùng để lưu trữ luôn.
Để điều khiển thời [...]]]></description>
			<content:encoded><![CDATA[<p>Chào các bạn.</p>
<p>Nay ngồi code cho con PIC16F887 để điều khiển đèn halogen, thực ra chính là điều khiển một chân rồi qua TIP122 và relay để điều khiển đèn thôi (vì dòng tải lên tới 10A).</p>
<p>Mình thấy cách viết hay nên chia sẻ với các bạn. Dùng để lưu trữ luôn.</p>
<p>Để điều khiển thời gian dùng lệnh:</p>
<blockquote><p>Txyzt# : trong đó: xyzt là thời gian viết theo hệ hexa. Đơn vị là ms</p>
<p>S: stop led</p>
<p>P: play led</p>
</blockquote>
<p>Đầu tiền là file UART.c và UART.h có chứa các định nghĩa và thực thi dành cho cổng UART. Tất nhiên có thể áp dụng cho mọi loại PIC16.</p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="400">
<p>// UART.h            <br />//=======================================================================================             <br />#ifndef _UART_H             <br />#define _UART_H             <br />//========================================================================================             <br />#include &quot;pic.h&quot;             <br />#include &quot;sysdef.h&quot; </p>
<p>//========================================================================================            <br />// Declare sosme functions             <br />void UART_Init(unsigned int BaudRate);&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Initialize for UART             <br />void UART_PrChar(unsigned char a);             <br />void UART_PrString(const char* str);             <br />unsigned char UART_Read(void);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Read data from UART Port             <br />//void UART_detectBaudRate(void);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Auto detect baud rate             <br />#endif</p>
</td>
</tr>
</tbody>
</table>
<p>Tiếp theo là hàm thực thi UART.c    </p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="400">
<p>// UART.h            <br /># include &quot;UART.h&quot;             <br /># include &quot;pic.h&quot;             <br /># include &quot;sysdef.h&quot; </p>
<p>//========================================================================================            <br />// Initialize UART             <br />void UART_Init(unsigned int BaudRate){             <br />&#160;&#160;&#160; unsigned int n; </p>
<p>// Configure BaudRate            <br />&#160;&#160;&#160; BRGH = 0;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Low speed.             <br />&#160;&#160;&#160; BRG16 = 1;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // 16-Bit Baud Rate Generator - SPBRGH and SPBRG </p>
<p>&#160;&#160;&#160; // Baudrate = Fosc/[16(n+1)]&#160; =&gt; n = ((Fosc/Baudrate)&gt;&gt;4) - 1;&#160; n = SPBRGH: SPBRG;            <br />&#160;&#160;&#160; n = ((Fosc/BaudRate)&gt;&gt;4) - 1;             <br />&#160;&#160;&#160; SPBRG = n;             <br />&#160;&#160;&#160; SPBRGH = n&gt;&gt;8;             <br />// Enable the asyncchronous serial port.             <br />&#160;&#160;&#160; SYNC = 0 ;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Asynchronous mode&#160;&#160;&#160; <br />&#160;&#160;&#160; SPEN = 1;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Serial port enable.             <br />&#160;&#160;&#160; TRIS_TX = 0;             <br />&#160;&#160;&#160; TRIS_RX = 1; </p>
<p>//Configure for Transmitter mode.&#160;&#160;&#160; <br />&#160;&#160;&#160; TXEN&#160; = 1;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Transmit enable </p>
<p>//Configure for Receiver mode            <br />&#160;&#160;&#160; CREN = 1;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Enable the reception </p>
<p>&#160;&#160;&#160; RCIF = 0;            <br />&#160;&#160;&#160; RCIE = 1;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Reception Interrupt Enable             <br />&#160;&#160;&#160; GIE = 1;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Global Interrupt Enable             <br />&#160;&#160;&#160; PEIE = 1;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Perapheral Interrupt Enable             <br />}&#160;&#160;&#160; </p>
<p>//=====================================================================================            <br />void UART_PrChar(unsigned char a){             <br />&#160;&#160;&#160; while(!TRMT);             <br />&#160;&#160;&#160; TXREG = a;             <br />}&#160;&#160;&#160; </p>
<p>//=====================================================================================            <br />void UART_PrString(const char* str){             <br />&#160;&#160;&#160; while(*str)             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrChar(*str ++);             <br />}&#160;&#160;&#160; </p>
<p>//=====================================================================================            <br />unsigned char UART_Read(void){             <br />&#160;&#160;&#160; return (RCREG);             <br />}&#160;&#160;&#160; </p>
<p>//====================================================================================            <br />// Only avaiable for PIC18             <br />/*             <br />void UART_detectBaudRate(void){             <br />&#160;&#160;&#160; TXSTA&#160;&#160;&#160;&#160; = 0b00100100;             <br />&#160;&#160;&#160; RCSTA&#160;&#160;&#160;&#160; = 0b10010000;             <br />&#160;&#160;&#160; BAUDCON = 0b00001001;             <br />&#160;&#160;&#160; while(ABDEN){             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(ABDOVF == 1) ABDOVF = 0;             <br />&#160;&#160;&#160; };             <br />}             <br />*/</p>
</td>
</tr>
</tbody>
</table>
<p>Tiếp theo là sysdef.h dùng để định nghĩa các biến dành cho hệ thống:    </p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="400">
<p>// Define some useful values </p>
<p>#define&#160;&#160;&#160; Fosc&#160;&#160;&#160; 20000000&#160;&#160;&#160; //&#160; Frequency of Crystal </p>
<p>// Define some temp signals            <br />#define led1&#160;&#160;&#160;&#160;&#160;&#160;&#160; RB7//RD2//RB7 </p>
<p>#define&#160;&#160;&#160; led1_cntL&#160;&#160;&#160; TMR2&#160;&#160;&#160; // Led1 counter as 16 bit,            <br />#define led1_cntH&#160;&#160;&#160; ADRESH </p>
<p>#define&#160;&#160;&#160; UART_Data&#160;&#160;&#160; CCPR2H&#160;&#160;&#160; // UART Data temporary&#160;&#160;&#160; </p>
<p>// Define 8 bit acc            <br />#define acc1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TMR1L             <br />#define acc2&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TMR1H             <br />#define acc3&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ANSELH             <br />#define acc4&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; EEADRL             <br />#define led1_cnt_acc1&#160;&#160;&#160; CCPR1H             <br />#define led1_cnt_acc2&#160;&#160;&#160; CCPR1L </p>
<p>#define progress&#160;&#160;&#160;&#160;&#160;&#160;&#160; SSPADD            <br />// Define for UART Module             <br />#define TX&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RC6             <br />#define RX&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; RC7             <br />#define TRIS_TX&#160;&#160;&#160;&#160;&#160;&#160;&#160; TRISC6             <br />#define TRIS_RX&#160;&#160;&#160;&#160;&#160;&#160;&#160; TRISC7</p>
</td>
</tr>
</tbody>
</table>
<p>Tiếp theo là system.h định nghĩa các hàm hệ thống: </p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="400">
<p>bit ishexa(unsigned char a){            <br />&#160;&#160;&#160; if ((a &gt;= &#8216;0&#8242; &amp;&amp; a&lt;= &#8216;9&#8242;) || (a&gt;= &#8216;A&#8217; &amp;&amp; a&lt;= &#8216;F&#8217;))             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return 1;             <br />&#160;&#160;&#160; else return 0;             <br />}; </p>
<p>// Convert from ASCII to number            <br />unsigned char ascii2num(unsigned char a){             <br />&#160;&#160;&#160; if( a &gt;= &#8216;0&#8242; &amp;&amp; a&lt;= &#8216;9&#8242;)             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return (a-&#8217;0&#8242;);             <br />&#160;&#160;&#160; else             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return (a-&#8217;A&#8217; + 0&#215;0A);             <br />}</p>
</td>
</tr>
</tbody>
</table>
<p>Cuối cùng là hàm Main.c là hàm chính:    </p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="400">
<p>/*;========================================================            <br />/*; Ten chuong trinh&#160;&#160;&#160; : Test IO             <br />; Nguoi thuc hien&#160;&#160;&#160; : Ngo Hai Bac (NOHB)             <br />; Ngay thuc hien&#160;&#160;&#160; : 27/06/07             <br />; Phien ban&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 1.0&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />; Mo ta phan cung&#160;&#160;&#160; : Dung PIC18F2525/2620/4525/4620 - thach anh 20MHz             <br />; Trinh dich&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : HTPIC 18V9.50&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-             <br />; Ngay hoan thanh&#160;&#160;&#160; :             <br />; Ngay kiem tra&#160;&#160;&#160; :             <br />; Nguoi kiem tra&#160;&#160;&#160; :             <br />;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-             <br />; Chu thich&#160;&#160;&#160; :&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />;========================================================*/             <br />// Include             <br /># include &quot;pic.h&quot;             <br /># include &quot;sysdef.h&quot;             <br /># include &quot;UART.h&quot;             <br /># include &quot;system.h&quot; </p>
<p>// configuration            <br />__CONFIG(HS &amp; PWRTEN &amp; BOREN &amp; LVPDIS &amp; WDTDIS ); </p>
<p>// Receiver Interrupt Function            <br />void RxIntFcn(void);             <br />void Timer0IntFcn(void);             <br />// Interrupt Function             <br />void interrupt MyInt&#160; (void) {             <br />&#160;&#160;&#160; if (RCIE &amp;&amp; RCIF){             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RCIF = 0;             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RxIntFcn();&#160;&#160;&#160; <br />&#160;&#160;&#160; };             <br />&#160;&#160;&#160; if (T0IE &amp;&amp; T0IF){             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; T0IF&#160;&#160;&#160;&#160; = 0;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Clear interrupt flag             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; TMR0&#160;&#160;&#160; = 100;             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Timer0IntFcn();             <br />&#160;&#160;&#160; };             <br />}             <br />// Init function             <br />void System_Init(void);             <br />/*=====================================================================================             <br />&#160;&#160;&#160; Main function             <br />=====================================================================================*/             <br />void main(){             <br />&#160;&#160;&#160; System_Init();&#160;&#160;&#160; <br />&#160;&#160;&#160; UART_Init(9600);             <br />&#160;&#160;&#160; //UART_detectBaudRate(); </p>
<p>&#160;&#160;&#160; while(1);            <br />} </p>
<p>//=====================================================================================            <br />// Implementation of some functions             </p>
<p>void RxIntFcn(void){           <br />&#160;&#160;&#160; UART_Data = UART_Read();            <br />&#160;&#160;&#160; UART_PrChar(UART_Data);            <br />&#160;&#160;&#160; // Detect set time command            <br />&#160;&#160;&#160; // as format: Txy#            <br />&#160;&#160;&#160; switch (progress){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 0:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //Initialize            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(UART_Data == &#8216;T&#8217;)            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; switch(UART_Data){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;1&#8242;:             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB6&#160;&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;6F; // 1/9 s = 111 ms            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;2&#8242;:             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB6&#160;&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0xDE; // 2/9            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;3&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;4D;&#160;&#160;&#160; // 1s = 1000 = 0&#215;03E8            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;4&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0xBC;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;01;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;5&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;2B;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;02;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;6&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;9A;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;02;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;7&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;09;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;03;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;8&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0&#215;78;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;03;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;9&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0xE7;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;03;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;0&#8242;:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //RB5&#160;&#160;&#160;&#160;&#160; = 1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0xE8;&#160;&#160;&#160; // 5s = 5000 = 0&#215;1388            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0&#215;03;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; default:            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; PORTB&#160;&#160; &amp;= 0&#215;80;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 1:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Received &#8216;T&#8217; character            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Determind next state            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (ishexa(UART_Data) == 1){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 2;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Write data to acc1            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; acc1&#160;&#160;&#160;&#160; = ascii2num(UART_Data);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Command error&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 2:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Received &#8216;x&#8217; character            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (ishexa(UART_Data) == 1){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 3;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Write data to acc2            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; acc2&#160;&#160;&#160;&#160; = ascii2num(UART_Data);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Command error&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 3:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Received &#8216;x&#8217; character            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (ishexa(UART_Data) == 1){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 4;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Write data to acc2            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; acc3&#160;&#160;&#160;&#160; = ascii2num(UART_Data);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Command error&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 4:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Received &#8216;x&#8217; character            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (ishexa(UART_Data) == 1){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 5;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Write data to acc2            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; acc4&#160;&#160;&#160;&#160; = ascii2num(UART_Data);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Command error&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case 5:            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (UART_Data == &#8216;#&#8217;){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Write &#8216;OK&#8217; statement            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Timer is set&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Update data from ACC to led1_counter_acc            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cnt_acc1 = (acc1&lt;&lt;4) | acc2;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cnt_acc2 = (acc3&lt;&lt;4) | acc4;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else{            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; UART_PrString(&quot; Command error&quot;);            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; default: progress = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160; }; </p>
<p>&#160;&#160;&#160; // On, off command           <br />&#160;&#160;&#160; switch(UART_Data){            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;P&#8217;:&#160;&#160;&#160;&#160;&#160;&#160;&#160; // On led            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Update led1_counter            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = led1_cnt_acc1;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = led1_cnt_acc2;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; case &#8216;S&#8217;:            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Clear led1_counter content            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL = 0;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; break;            <br />&#160;&#160;&#160; };            <br />}</p>
<p>// Timer0 interrupt function            <br />void Timer0IntFcn(void){&#160;&#160;&#160; <br />&#160;&#160;&#160; // Control led1&#160;&#160;&#160; <br />&#160;&#160;&#160; led1 = 1;             <br />&#160;&#160;&#160; if (led1_cntL == 0){             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (led1_cntH == 0)             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1 = 0;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; else {             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntH &#8211;;             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; led1_cntL &#8211;;             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; };             <br />&#160;&#160;&#160; }             <br />&#160;&#160;&#160; else&#160;&#160;&#160; led1_cntL&#8211;;&#160;&#160;&#160; <br />}             <br />// Initialize the system             <br />void System_Init(void){             <br />// Init for ports             <br />&#160;&#160;&#160; // PortA as output             <br />&#160;&#160;&#160; OPTION = 0b00000000;             <br />&#160;&#160;&#160; ADCON1&#160;&#160;&#160; = 0&#215;07;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; /*Configure all ADC pins&#160; to be digital inputs*/             <br />&#160;&#160;&#160; TRISA&#160;&#160;&#160; = 0&#215;00;             <br />&#160;&#160;&#160; PORTA&#160;&#160;&#160; = 0xFF; </p>
<p>&#160;&#160;&#160; // PortB as output            <br />&#160;&#160;&#160; TRISB&#160;&#160;&#160; = 0&#215;00;             <br />&#160;&#160;&#160; PORTB&#160;&#160;&#160; = 0&#215;00;             <br />&#160;&#160;&#160; // PortD as input             <br />&#160;&#160;&#160; TRISD&#160;&#160; = 0&#215;00;             <br />&#160;&#160;&#160; TRISD&#160;&#160; = 0&#215;00;             <br />// Init for Timer0             <br />&#160;&#160;&#160; //Init TCON Register             <br />&#160;&#160;&#160; /* </p>
<p>&#160;&#160;&#160; T0CS&#160;&#160;&#160; = 0;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Internal instruction cycle clock (CLKO)            <br />&#160;&#160;&#160; TOSE&#160;&#160;&#160; = 0;             <br />&#160;&#160;&#160; PSA&#160;&#160;&#160;&#160;&#160;&#160;&#160; = 0;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Timer0 is assigned. Timer0 clock input comes from prescaler output             <br />&#160;&#160;&#160; T0PS2&#160;&#160; = 1;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Scale value = 100 -&gt; 32             <br />&#160;&#160;&#160; T0PS1&#160;&#160; = 0;             <br />&#160;&#160;&#160; T0PS0&#160;&#160; = 0;             <br />&#160;&#160;&#160; */             <br />&#160;&#160;&#160; OPTION&#160;&#160;&#160; = 0b00000100;             <br />&#160;&#160;&#160; // Init timer0             <br />&#160;&#160;&#160; TMR0&#160;&#160;&#160; = 100;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //1000 us = 0.2us * 5000 = 0.2us * 32(pre) * 156&#160;&#160;&#160; <br />&#160;&#160;&#160; T0IE&#160;&#160;&#160; = 1;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // enable Timer0 interrupt             <br />&#160;&#160;&#160; T0IF&#160;&#160;&#160; = 0;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Clear Timer0 interrupt flag </p>
<p>// Init for counters            <br />&#160;&#160;&#160; led1_cntH = 0;             <br />&#160;&#160;&#160; led1_cntL = 0;             <br />&#160;&#160;&#160; led1_cnt_acc1 = 0;             <br />&#160;&#160;&#160; led1_cnt_acc2 = 0;             <br />&#160;&#160;&#160; progress&#160;&#160;&#160;&#160;&#160; = 0;             <br />} </p>
</td>
</tr>
</tbody>
</table>
<p>Chúc các bạn thành công.</p>
<h3>Các bài viết liên quan:</h3>
<ul class="related_post">
<li><a href="http://www.ngohaibac.net/programming-32-bit-microcontrollers-in-c-exploring-the-pic32-by-lucio-di-jasio/"  title="  Programming 32-bit Microcontrollers in C: Exploring the PIC32 by Lucio Di Jasio">  Programming 32-bit Microcontrollers in C: Exploring the PIC32 by Lucio Di Jasio</a></li>
<li><a href="http://www.ngohaibac.net/phuong-phap-quet-keypad-ma-tran-ban-phim-dung-ngat-timer/"  title="Phương ph&aacute;p qu&eacute;t keypad &ndash; ma trận ph&iacute;m bấm d&ugrave;ng ngắt Timer">Phương ph&aacute;p qu&eacute;t keypad &ndash; ma trận ph&iacute;m bấm d&ugrave;ng ngắt Timer</a></li>
<li><a href="http://www.ngohaibac.net/phan-tich-thuat-toan-thuc-hien-lenh-dieu-khien-pc-qua-rs232/"  title="Ph&acirc;n t&iacute;ch thuật to&aacute;n: thực hiện lệnh điều khiển từ PC qua RS232">Ph&acirc;n t&iacute;ch thuật to&aacute;n: thực hiện lệnh điều khiển từ PC qua RS232</a></li>
<li><a href="http://www.ngohaibac.net/quan-ly-va-build-project-voi-trinh-dich-htpic-bang-visual-cnet-2005/"  title="Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005">Quản l&yacute; v&agrave; build Project với tr&igrave;nh dịch HTPIC bằng Visual C++.Net 2005</a></li>
<li><a href="http://www.ngohaibac.net/htpicc-960pl1-trnh-d%e1%bb%8bch-c-dnh-cho-pic16/"  title="HTPICC 9.60PL1 - Tr&igrave;nh dịch C d&agrave;nh cho PIC16">HTPICC 9.60PL1 - Tr&igrave;nh dịch C d&agrave;nh cho PIC16</a></li>
</ul>

<p><a href="http://feeds.feedburner.com/~a/ngohaibac_entries?a=kTJ7F5"><img src="http://feeds.feedburner.com/~a/ngohaibac_entries?i=kTJ7F5" border="0"></img></a></p><img src="http://feeds.feedburner.com/~r/ngohaibac_entries/~4/332754853" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.ngohaibac.net/pic16f887-dieu-khien-thoi-gian-dong-cat-mot-led-tu-pc-qua-uart/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.ngohaibac.net/pic16f887-dieu-khien-thoi-gian-dong-cat-mot-led-tu-pc-qua-uart/</feedburner:origLink></item>
		<item>
		<title>Hiệu ứng Compiz Fusion trong Ubuntu 8.04</title>
		<link>http://feeds.feedburner.com/~r/ngohaibac_entries/~3/331443775/</link>
		<comments>http://www.ngohaibac.net/hieu-ung-compiz-fusion-trong-ubuntu-804/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 05:49:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Thông báo]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.ngohaibac.net/?p=165</guid>
		<description><![CDATA[Chào các bạn.
Trang chủ: http://www.compiz-fusion.org/
Các bạn có thể làm theo hướng dẫn bên dưới hay ở trong chính website: https://help.ubuntu.com/community/CompositeManager/CompizFusion
Hiệu ứng Compiz Fusion rất đẹp trong Ubuntu. Để cài đặt, chúng ta cần cài 2 gói sau bằng Synaptic:

compizconfig-settings-manager
emerald

1.Cấu hình Compiz Fusion
Bạn có thể dùng CompizConfig Settings Manager để cấu hình cho Compiz Fusion. Vào [...]]]></description>
			<content:encoded><![CDATA[<p>Chào các bạn.</p>
<p>Trang chủ: <a href="http://www.compiz-fusion.org/"  target="_blank">http://www.compiz-fusion.org/</a></p>
<p>Các bạn có thể làm theo hướng dẫn bên dưới hay ở trong chính website:<a href="https://help.ubuntu.com/community/CompositeManager/CompizFusion"  target="_blank"> https://help.ubuntu.com/community/CompositeManager/CompizFusion</a></p>
<p>Hiệu ứng Compiz Fusion rất đẹp trong Ubuntu. Để cài đặt, chúng ta cần cài 2 gói sau bằng Synaptic:</p>
<ul>
<li class="system">compizconfig-settings-manager</li>
<li class="system">emerald</li>
</ul>
<h3>1.Cấu hình Compiz Fusion</h3>
<p>Bạn có thể dùng CompizConfig Settings Manager để cấu hình cho Compiz Fusion. Vào menu <strong><span class="system">System &gt; Preferences &gt; Advanced Desktop Effects Settings</span></strong>:</p>
<p><a href="http://images.howtoforge.com/images/compiz_fusion_ubuntu_hardy_heron_nvidia/big/19.jpg"  rel="lightbox[165]"><img src="http://images.howtoforge.com/images/compiz_fusion_ubuntu_hardy_heron_nvidia/19.jpg" alt="" width="550" height="440" /></a><noscript style="font-size: 7pt;"></noscript></p>
<p>This is how the <span class="system">CompizConfig Settings Manager</span> looks. You can now configure Compiz Fusion to your likings:</p>
<p><a href="http://images.howtoforge.com/images/compiz_fusion_ubuntu_hardy_heron_nvidia/big/20.jpg"  rel="lightbox[165]"><img src="http://images.howtoforge.com/images/compiz