tag:blogger.com,1999:blog-64173748266649777182024-02-19T05:13:39.152-08:00ngô viết phúcPhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.comBlogger232125tag:blogger.com,1999:blog-6417374826664977718.post-145704329899187442017-05-08T20:20:00.002-07:002017-05-08T20:20:32.452-07:00active windows 10 <span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;">:info:</span><br style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;" /><span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;">Nếu bạn sử dụng ISO cài đặt và Format ổ C thì tức là Windows 10 cài xong sẽ không có bản quyền.</span><br style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;" /><span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;">- Mở CMD quyền Admin bằng cách ấn tổ hợp phím Windows + X và ấn A.</span><br style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;" /><span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;">- Sử dụng các lệnh này theo thứ tự từ trên xuống, từng lệnh rồi enter nhé:</span><br style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;" /><span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;">slmgr /ipk XXXXX-XXXX-XXXX-XXXX-XXXX</span><br style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;" /><span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;">slmgr /skms kms.xspace.in</span><br style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;" /><span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;">slmgr /ato</span><br style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;" /><span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;">Trong đó, XXXXX-XXXX-XXXX-XXXX-XXXX là key cho bản Windows 10 tương ứng bạn đang dùng</span><br />
<span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;"><br /></span>
<span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;"><br /></span>
<span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;"><br /></span>
<span style="background-color: white; color: #2c2c2c; font-family: "Open Sans"; font-size: 14.6667px;"><br /></span>
<pre style="white-space: pre-wrap; word-wrap: break-word;">☛ Win 10 RTM Professional Retail
BJGVB-BNC9R-FBMJM-FYDWY-8FG6T
BKCNC-GRTKR-DQ9VD-TVDDH-G6PKG
BQ2NT-B37XX-FKGPK-XFD6W-RX8XG
BW9KK-2NXX6-79XJW-K62G3-49CKG
CMBRN-P7Q3J-TJKWY-TQPBH-X766T
CN94X-8R4QD-B9PFW-932X2-8XCKG
CQ4D7-NTQRM-FYPRR-TCGM7-WK8XG
CR7J6-48NJ6-QDYW3-V2Q9Q-GF4C6
CRNHK-6M2R6-YCXD4-P23W8-WB49G
CRNMY-QQQ39-QV44T-HWW3C-D69TT
CXQH2-KNC9G-6GBG4-3YXFK-BKMP6
D3XCX-NQYMQ-VQDTP-7FBC8-MTDGT
D8TMM-N7B8C-QW4K2-WXJ6G-WXCKG
DKXHN-YVJWP-P7HR4-C4283-H22KG
DQWYH-NRXQP-HDTMB-4VC68-TQ726
FG46C-NKBPB-43XQC-9PJTQ-FM49G
FJND7-F3XYQ-FV4KF-JX2KH-B7V26
FNQKX-DPBBT-DFTTB-6XXXJ-RX8XG
GHB2C-N3YG3-F2BPD-B4C24-WFG6T
GRVVK-GJNT6-TQHJJ-8W2RK-YDWXG
GX3B2-BWNR8-7RPY2-CDWR9-RM49G
GYQN7-6Y4YX-8G8VJ-VFDJF-R3KTT
HC69Y-DN8JV-PV4YR-WV7P2-7CFC6
HHRR9-Y3N8P-X4R3D-BX72T-HFR9G
HMY6B-QYNCB-HJKFK-QGB46-QYH26
J9292-9N2FM-67DWF-9QVV8-7FR9G
JJN9D-3BDQG-XHXVP-TYQYP-DDBP6
JN43H-BD8D9-XT9PQ-GBTRX-CDKTT
JNHDY-96KCC-8M2BV-Y8RXM-6VJXG
JNWPT-BMRQB-TBMC2-XX6HJ-BWRC6
JY8NM-2DGD7-PDD94-8Y463-GF4C6
K4JN8-QT8GY-VY9PP-DHJBR-WFG6T
KN622-PB9BC-6X44C-HK4XR-MWRC6
KQNY3-P8V86-M2YBV-GJKP2-RVV26
KQPF4-PDNHW-3TBXK-XT743-WQKTT
KR3NB-F384T-MTMW7-M8XHC-4RG6T
M4JX9-BN4G4-2J8YJ-FWVV4-K4R9G
MFM9R-WWN67-W3FPC-2BTRR-DJ3GT
MT84N-PYRMP-WKHRY-B92KX-9HJXG
N4GKM-KHXTR-MCYWC-D42XK-YDWXG
N4GY4-86W6R-F6VTJ-K8QRK-JXCKG
N9CR9-CFVBG-XPPDQ-6KB6X-YDWXG
NH494-82232-JR4B8-YJKVG-Y98XG
NPPBX-DC7CB-F7F3R-6BQ6P-DDBP6
NXQ6P-C4PM7-9CD3G-J98F9-66PKG
P22MT-DN6QH-C2MTM-VFGY8-JFG6T
P4NDQ-Y4WDJ-7VFDH-HWVXM-WHV26
PT874-QQN8R-4FCGM-PBTK3-C3726
R6FGB-3NFBT-BP3H2-GBT2R-844C6
R6JJN-6Y4TQ-V2PHQ-8BF6V-YY49G
R9KRN-B2DPQ-7VY7W-RP3TF-KBT6T
RNBH6-7YTTV-R697J-MXYQF-W8F9G
RNJCT-VJ393-PB7WT-8282G-GMT6T
RT7NG-CTTBY-YK9V2-WBJ9Y-3GPKG
RVHFT-QN8PP-M9W6V-J2R3X-RM49G
T3KBN-7QPTB-VJC3G-FR2XG-H8RC6
T627Y-DPN82-T23BB-GCX8Y-X4R9G
TRNHC-9HYFV-3M4JB-9R6VR-F6YP6
V3HQ8-FXN8K-J2Y2F-G4QTR-Q9MP6
V9NVD-FYG3M-XRDXG-2MRKJ-29XTT
VKNT9-P399Q-RHCYF-CQX44-X2FC6
WBYPW-XN72Q-H89JH-GTW48-QDBP6
WPV8N-D3GKD-HQ7RJ-98WRX-Y7V26
WTNYW-PX92M-3G22F-P96XP-PGYP6
WWGGN-W677D-DFTMR-PXG6Q-PYT6T
WXNRC-3YRQB-4XF24-CVQP2-MP2KG
X4W98-QTN7V-WXHPD-39TGM-F9CKG
XJJ7J-4NYTT-MFK6Q-MVYW8-K2FC6
XKF27-DNCPW-D3Y99-V2XRR-7H66T
XXN2C-YHRHQ-MCKH8-GWGC3-JTYP6
YB4V2-WQNPK-PK7GF-GRMMW-29XTT
YG8QQ-YN2X7-TBHXY-HQGGF-4X8XG</pre>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com2tag:blogger.com,1999:blog-6417374826664977718.post-88958853276077892692014-09-25T05:45:00.001-07:002014-10-01T09:58:31.909-07:00Dowload HFSS 2015 crack<a href="https://kickass.to/ansoft-hfss-win64-15-0-2-t9436821.html">Dowload HFSS 2015 crack</a>PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com4tag:blogger.com,1999:blog-6417374826664977718.post-11660335671685418172014-09-18T23:02:00.003-07:002014-09-18T23:02:50.340-07:00 TRY, CATCH, FINALLY TRONG JAVA<h1 style="border-bottom-color: rgb(221, 221, 221); border-bottom-width: 3px; border-style: none none solid; color: #333333; font-family: 'Yanone Kaffeesatz', sans-serif; font-size: 40px; font-weight: 400; line-height: 40px; list-style: none; margin: 0px 0px 18px; outline: none; padding: 0px 0px 6px; text-transform: uppercase;">
<br /></h1>
<div class="post-body" style="font-family: 'Droid Sans', Arial, verdana; font-size: 16px; line-height: 26px; margin: 0px 0px 18px;">
<br /><div align="center" style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; margin: 0px; padding: 0px;">
<img alt="20111020_Java-Xulyngoaile-p2_2" class="bbCodeImage LbImage" src="http://android.vn/attachments/20111020_java-xulyngoaile-p2_2-gif.18105/" style="border: 0px; list-style: none; margin: 0px; max-width: 100%; outline: none; padding: 0px;" /></div>
<div align="center" style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; margin: 0px; padding: 0px;">
<br /></div>
<span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">Trước khi vào chi tiết, mình sẽ nêu 1 tình huống như này, đó là lỗi chia cho 0.</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">Bình thường theo các bài trước, các bạn sẽ dùng if, else để loại bỏ, in ra lỗi. (tất nhiên nếu bạn đã biết try catch rồi thì không nói </span><img alt=":D" class="mceSmilieSprite mceSmilie8" src="http://android.vn/styles/default/xenforo/clear.png" style="background-color: white; background-image: url(http://android.vn/styles/default/xenforo/xenforo-smilies-sprite.png); background-position: -20px 0px; background-repeat: no-repeat; border: 0px; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; height: 18px; line-height: 21px; list-style: none; margin: 0px 1px; max-width: 620px; outline: none; padding: 0px; vertical-align: text-bottom; width: 18px;" title="Big Grin :D" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">). Đọc xong bài này, các bạn sẽ có thêm 1 cách khác, và tất nhiên nó còn sử dụng để bắt và xử lý nhiều loại lỗi hơn!</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;">Ví dụ:</b><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;"> Các bạn xem đoạn code này trước khi đọc lý thuyết, chạy thử nó, có thể nó cũng khá dễ hiểu!</span><br /><div class="bbCodeBlock bbCodePHP" style="background-color: white; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; border: 1px solid rgb(228, 228, 228); color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; margin: 1em 0px; padding: 0px; position: relative;">
<div class="type" style="background-color: #009b00; background-image: url(http://android.vn/styles/soft_responsive_green/xenforo/gradients/category-23px-light.png); background-position: 50% 0%; background-repeat: repeat-x; border-bottom-color: rgb(228, 228, 228); border-bottom-style: solid; border-bottom-width: 1px; border-top-left-radius: 4px; border-top-right-radius: 4px; color: white; font-size: 11px; margin: 0px; padding: 3px 8px;">
PHP:</div>
<div class="code" style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; direction: ltr; font-family: Consolas, 'Courier New', Courier, monospace; font-size: 10pt; line-height: 1.24; margin: 0px; max-height: 500px; min-height: 30px; overflow: auto; padding: 10px; white-space: nowrap; word-wrap: normal;">
<code style="font-style: inherit; font-weight: inherit; line-height: 13px; margin: 0px; padding: 0px;"><span style="border: none; color: black; list-style: none; margin: 0px; outline: none; padding: 0px;"><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">package javaandroidvn</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">;<br /><br />public class </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">JavaAndroidVn </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">{<br /><br /> public static </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">void main</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">String</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">[] </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">args</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">) {<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">int a </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">= </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">5</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">;<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">int b </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">= </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">0</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">;<br /><br /> </span><span style="border: none; color: #ff8000; list-style: none; margin: 0px; outline: none; padding: 0px;">//Cách các bài trước thường làm, dùng if, else:<br /> </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">if (</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">b </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">== </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">0</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">) {<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">System</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">out</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">println</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #dd0000; list-style: none; margin: 0px; outline: none; padding: 0px;">"Lỗi chia cho 0"</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">);<br /> } else {<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">System</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">out</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">println</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #dd0000; list-style: none; margin: 0px; outline: none; padding: 0px;">"a/b = " </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">+ </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">a </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">/ </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">b</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">);<br /> }<br /><br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">System</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">out</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">println</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #dd0000; list-style: none; margin: 0px; outline: none; padding: 0px;">"\nCách dùng try - catch - finally \n"</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">);<br /><br /> </span><span style="border: none; color: #ff8000; list-style: none; margin: 0px; outline: none; padding: 0px;">//Sử dụng try, catch để bắt lỗi:<br /> </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">try {<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">System</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">out</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">println</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #dd0000; list-style: none; margin: 0px; outline: none; padding: 0px;">"a/b = " </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">+ </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">a </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">/ </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">b</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">);<br /> } catch (</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">Exception e1</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">) {<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">System</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">out</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">println</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #dd0000; list-style: none; margin: 0px; outline: none; padding: 0px;">"Có lỗi gì đó xảy ra "</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">);<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">System</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">out</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">println</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #dd0000; list-style: none; margin: 0px; outline: none; padding: 0px;">"Tên lỗi là: " </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">+ </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">e1</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">);<br /> } </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">finally </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">{<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">System</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">out</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">println</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #dd0000; list-style: none; margin: 0px; outline: none; padding: 0px;">"Có lỗi hay không thì cái dòng cuối cùng này vẫn được in ra!"</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">);<br /> }<br /><br /> }<br />}</span></span></code></div>
</div>
<span style="background-color: white; border: none; color: red; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;"><span style="border: none; font-size: small; list-style: none; margin: 0px; outline: none; padding: 0px;">1, Try - catch:</span></span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">- Trong ví dụ trên, trong khối</span><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;"> try{}</b><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;"> là những dòng lệnh chúng ta cần thực hiện!</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">Khối </span><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;">catch (Exception e1) {}</b><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;"> là nơi chứa các dòng lệnh thực hiện khi phát hiện lỗi!</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">- Ở đây, ta cần hiểu rõ khái niệm </span><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;">Exception:</b><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;">Exception</b><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;"> (Ngoại lệ) là sự kiện xảy ra khi một chương trình đang chạy mà phát sinh ra lỗi. Nó sẽ làm gián đoạn chương trình!</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;">(Exception e1)</b><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;"> trong đó </span><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;">"e1"</b><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;"> là tên của được gán nếu đối tượng bị lỗi, các bạn có thể đặt tên này bằng các từ khác.</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">- Bạn có thể in </span><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;">"e1"</b><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;"> ra ngoài, sẽ thấy được lỗi cụ thể!</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">-</span><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;"> Exception</b><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;"> là lớp cha, nó nói chung, và in ra các lỗi, ngoài ra còn có lớp con cụ thể và các ngoại lệ khác như sau:</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">Exception | Lớp nền của run-time</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">NullPointerException | Một đối tượng không tồn tại</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">ClassNotFoundException | Không tìm thấy Class</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">FileNotFoundException | Không tìm thấy file</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">SecurityException | Exception liên quan đến bảo mật</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">ArrayIndexOutOfBoundsException | Vượt quá chỉ mục của mảng</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">IllegalAccessException | Truy cập không hợp lệ</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">IllegalArgumentException | Đối số hàm</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">ArithmeticException | Lỗi thực thi một phép toán</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">NumberFormatException | Định dạng số không đúng</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">IOException | Lỗi nhập xuất</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">EOFException | Kết thúc một tập tin</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">NoSuchMethodException | Sai tên phương thức</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">InterruptedException | Ngắt luồng đang được thực thi</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;">Ví dụ:</b><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;"> In ra lỗi cụ thể vượt quá chỉ mục của mảng.</span><br /><div class="bbCodeBlock bbCodePHP" style="background-color: white; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; border: 1px solid rgb(228, 228, 228); color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; margin: 1em 0px; padding: 0px; position: relative;">
<div class="type" style="background-color: #009b00; background-image: url(http://android.vn/styles/soft_responsive_green/xenforo/gradients/category-23px-light.png); background-position: 50% 0%; background-repeat: repeat-x; border-bottom-color: rgb(228, 228, 228); border-bottom-style: solid; border-bottom-width: 1px; border-top-left-radius: 4px; border-top-right-radius: 4px; color: white; font-size: 11px; margin: 0px; padding: 3px 8px;">
PHP:</div>
<div class="code" style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; direction: ltr; font-family: Consolas, 'Courier New', Courier, monospace; font-size: 10pt; line-height: 1.24; margin: 0px; max-height: 500px; min-height: 30px; overflow: auto; padding: 10px; white-space: nowrap; word-wrap: normal;">
<code style="font-style: inherit; font-weight: inherit; line-height: 13px; margin: 0px; padding: 0px;"><span style="border: none; color: black; list-style: none; margin: 0px; outline: none; padding: 0px;"><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">package javaandroidvn</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">;<br /><br />public class </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">JavaAndroidVn </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">{<br /><br /> public static </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">void main</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">String</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">[] </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">args</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">) {<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">int arrInt</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">[] = {</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">1</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">, </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">2</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">, </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">4</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">, </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">7</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">, </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">10</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">};<br /> try {<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">System</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">out</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">println</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #dd0000; list-style: none; margin: 0px; outline: none; padding: 0px;">"arrInt[6] = " </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">+ </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">arrInt</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">[</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">6</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">]);<br /><br /> } catch (</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">ArrayIndexOutOfBoundsException e2</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">) {<br /> </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">System</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">out</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">.</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">println</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">(</span><span style="border: none; color: #dd0000; list-style: none; margin: 0px; outline: none; padding: 0px;">"Lỗi! Vượt quá chỉ mục của mảng! " </span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">+ </span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">e2</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">);<br /> }<br /><br /> }<br />}</span></span></code></div>
</div>
<span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">Ngoài ra, để in nhiều Exception thì ra làm như sau:</span><br /><div class="bbCodeBlock bbCodePHP" style="background-color: white; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; border: 1px solid rgb(228, 228, 228); color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; margin: 1em 0px; padding: 0px; position: relative;">
<div class="type" style="background-color: #009b00; background-image: url(http://android.vn/styles/soft_responsive_green/xenforo/gradients/category-23px-light.png); background-position: 50% 0%; background-repeat: repeat-x; border-bottom-color: rgb(228, 228, 228); border-bottom-style: solid; border-bottom-width: 1px; border-top-left-radius: 4px; border-top-right-radius: 4px; color: white; font-size: 11px; margin: 0px; padding: 3px 8px;">
PHP:</div>
<div class="code" style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; direction: ltr; font-family: Consolas, 'Courier New', Courier, monospace; font-size: 10pt; line-height: 1.24; margin: 0px; max-height: 500px; min-height: 30px; overflow: auto; padding: 10px; white-space: nowrap; word-wrap: normal;">
<code style="font-style: inherit; font-weight: inherit; line-height: 13px; margin: 0px; padding: 0px;"><span style="border: none; color: black; list-style: none; margin: 0px; outline: none; padding: 0px;"><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;"></span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">try {<br /> </span><span style="border: none; color: #ff8000; list-style: none; margin: 0px; outline: none; padding: 0px;">//Nội dung muốn bẫy lỗi</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">} catch (</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">ExceptionType1 e</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">) {<br /> </span><span style="border: none; color: #ff8000; list-style: none; margin: 0px; outline: none; padding: 0px;">//Khối lệnh cho lỗi</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">}catch (</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">ExceptionType2 e1</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">) {<br /> </span><span style="border: none; color: #ff8000; list-style: none; margin: 0px; outline: none; padding: 0px;">//Khối lệnh cho lỗi</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">} catch (</span><span style="border: none; color: #0000bb; list-style: none; margin: 0px; outline: none; padding: 0px;">Exception ex</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">) {<br /> </span><span style="border: none; color: #ff8000; list-style: none; margin: 0px; outline: none; padding: 0px;">//Exception cho những cái còn lại</span><span style="border: none; color: #007700; list-style: none; margin: 0px; outline: none; padding: 0px;">}</span></span></code></div>
</div>
<span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">Trong đó ExceptionType là những loại Exception cụ thể đã nêu ở phía trên!</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: small; list-style: none; margin: 0px; outline: none; padding: 0px;"><span style="border: none; color: red; list-style: none; margin: 0px; outline: none; padding: 0px;">2, Finally?</span></span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">Nó nằm ở cuối cùng của khối lệnh try - catch - finally, nó luôn luôn được thực hiện ngay cả khi chương trình có bắt được lỗi</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">hay không!</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">Trong khối lệnh đầy đủ như ví dụ ở đầu bài, dòng System.out.println("Có lỗi hay không thì cái dòng cuối cùng này vẫn được in ra!");</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><span style="background-color: white; border: none; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px; list-style: none; margin: 0px; outline: none; padding: 0px;">Luôn luôn được thực hiện và in ra khi bạn gán bất giá trị nào cho b!</span><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><br style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;" /><b style="background-color: white; color: #141414; font-family: Roboto, arial, sans-serif; font-size: 15px; line-height: 21px;">Xem thêm video nói khá đầy đủ về try - catch - finally của Blog StudyAndShare</b></div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com1tag:blogger.com,1999:blog-6417374826664977718.post-79235640733630070542014-09-10T08:36:00.000-07:002014-09-10T08:36:13.798-07:00Thực hành về Toast Notification và Alert Dialog<h1 class="entry-title">
</h1>
<div class="byline">
</div>
<div class="entry-content">
Vì trong tất cả các ứng dụng Tôi thấy rằng chúng ta hay sử dụng Toast và Alert Dialog để kiểm tra một điều gì đó, hay đơn giản chỉ là xuất thông báo. Vì vậy bài tập này Tôi sẽ hướng dẫn các bạn làm quen với Toast & Alert Dialog, sau đó các bạn sẽ được thực hành với các control cơ bản và nâng cao.<br />
- Cả Toast và Alert Dialog khi hiển thị lên thì các tiến trình (hay các lệnh) khác <span style="color: red;">vẫn cứ tiếp tục làm việc</span>.<br />
<span style="color: red;"><strong>1) Toast:</strong></span><br />
- Toast có thể được tạo và hiển thị trong Activity hoặc trong Servive.<br />
- Không cho phép người sử dụng tương tác<br />
- Khi hiển thị sau khoảng thời gian nào đó sẽ tự đóng lại<br />
- Có 2 giá trị mặc định (ta nên sử dụng 2 giá trị này, không nên gõ con số cụ thể vào): hằng số <span style="color: red;"><strong>Toast.LENGTH_SHORT</strong></span> hiển thị trong <span style="color: red;">2</span> giây, <span style="color: red;"><strong>Toast.LENGTH_LONG</strong> </span>hiển thị trong <span style="color: red;">3.5</span> giây.<br />
<span style="text-decoration: underline;">Cách tạo Toast:</span><br />
<div style="background: whitesmoke;">
<span style="color: blue;"><strong>Toast</strong> </span>toast=<span style="color: blue;"><strong>Toast</strong></span>.makeText(<span style="color: red;"><strong>YourActivity</strong></span>.<span style="color: blue;"><strong>this</strong></span>, “Hiển thị gì thì ghi ở đây”, <span style="color: red;"><strong>Toast.LENGTH_SHORT</strong></span>);</div>
<div style="background: whitesmoke;">
<span class="skimlinks-unlinked">toast.show</span>();</div>
<strong>- Khi nào bạn nên sử dụng Toast?</strong><br />
Theo Tôi thì tùy bạn, bạn có thể sử dụng trong trường hợp hiển thông báo trong các mục thiết lập thông số cấu hình, hay đơn giản chỉ là hiển thị lên để xem thông tin tạm thời nào đó (giống như để kiểm tra một vấn đề sảy ra chẳng hạn).<br />
- Hình dưới đây cho bạn biết 1 Toast đang hiển thị:<br />
<a href="http://duythanhcse.files.wordpress.com/2013/04/9_dialog_0.png" sl-processed="1"><img alt="9_dialog_0" class="aligncenter size-full wp-image-1376" height="216" originalw="620" scale="1.5" src="http://duythanhcse.files.wordpress.com/2013/04/9_dialog_0.png?w=620" width="305" /></a><span style="color: red;"><strong>2) Alert Dialog:</strong></span><br />
- Hiển thị và cho phép người dùng tương tác, ví dụ bạn nhìn hình Tôi chụp bên dưới, khi nhấn nút “Cancel”, chương trình sẽ hiển thị Alert Dialog hỏi xem có chắc chắn muốn xóa hay không? Bấm No thì không, bấm Yes thì tắt chương trình.<br />
<a href="http://duythanhcse.files.wordpress.com/2013/04/9_dialog_1.png" sl-processed="1"><img alt="9_dialog_1" class="aligncenter size-full wp-image-1378" height="584" originalw="620" scale="1.5" src="http://duythanhcse.files.wordpress.com/2013/04/9_dialog_1.png?w=620" width="454" /></a>- Cách tạo Alert Dialog:<br />
<div style="background: whitesmoke;">
<span style="color: red;"><strong>AlertDialog</strong></span>.Builder b=<b>new</b> <span style="color: red;"><strong>AlertDialog</strong></span>.Builder(<span style="color: red;"><strong>YourActivity</strong></span>.<b>this</b>);</div>
<div style="background: whitesmoke;">
</div>
<div style="background: whitesmoke;">
b.setTitle(“Question”);</div>
<div style="background: whitesmoke;">
b.setMessage(“Are you sure you want to exit?”);</div>
<div style="background: whitesmoke;">
b.setPositiveButton(“Yes”, <b>new</b> <span style="color: red;"><strong>DialogInterface</strong></span>. OnClickListener() {</div>
<div style="background: whitesmoke;">
@Override</div>
<div style="background: whitesmoke;">
<b>public</b> <b>void</b> onClick(DialogInterface dialog, <b>int</b> which)</div>
<div style="background: whitesmoke;">
{</div>
<div style="background: whitesmoke;">
finish();</div>
<div style="background: whitesmoke;">
}}); b.setNegativeButton(“No”, <b>new</b> DialogInterface.OnClickListener() {<br />
@Override<br />
<b>public</b> <b>void</b> onClick(DialogInterface dialog, <b>int</b> which)<br />
{<br />
dialog.cancel();<br />
}<br />
});<br />
b.create().show();</div>
<span style="text-decoration: underline;"><strong>Ý nghĩa của các hàm :</strong></span><br />
- <strong>setTitle</strong> : thiết lập tiêu đề cho Dialog<br />
- <strong>setMessage</strong>: Thiết lập nội dung cho Dialog<br />
-<strong>setIcon</strong> : để thiết lập Icon<br />
-<strong>setPositiveButton</strong>, <strong>setNegativeButton</strong> thiết lập hiển thị Nút chọn cho Dialog (ở đây bạn không quan tâm Nút chấp nhận hay Nút hủy nó thuộc PositiveButton hay NegativeButton vì đó là tùy thuộc bạn chọn. Chú ý là ở đối số thứ 2 của các hàm này sẽ là <span style="color: red;"><strong>DialogInterface</strong>. OnClickListener</span> chứ không phải <span style="color: red;"><strong>View.</strong> OnClickListener</span><br />
- <strong>create</strong>() để tạo Dialog<br />
- <strong>show</strong>() để hiển thị Dialog.</div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-5211607013100537382014-08-28T01:57:00.000-07:002014-08-28T02:14:06.429-07:00Formatting String<h2 class="post-title entry-title" style="color: #333333; font-family: Arial, Tahoma; font-size: 18px; line-height: 1.2em; margin: 0px; padding: 0px 0px 5px;">
<a href="http://vhlong.blogspot.com/2014/04/huong-dan-su-dung-stringformat.html" style="color: black; display: block; text-decoration: none;">Hướng dẫn sử dụng String.Format</a></h2>
<div class="post-body entry-content" id="post-body-402011706744879529" style="font-family: Arial, Tahoma, Verdana; font-size: 16px; line-height: 19.5px; margin: 10px 0px 0px; padding: 0px;">
<div class="horizontalsocial social-buttons" id="horizontalsocial">
<div id="MBBSocialPlaceholder" style="height: 70px;">
<div class="MBBSocialFloat MBBFloatSocial" id="MBBSocialFloat" style="-webkit-box-shadow: rgba(0, 0, 0, 0.14902) 0px 1px 1px; background: rgb(255, 255, 255); border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; box-shadow: rgba(0, 0, 0, 0.14902) 0px 1px 1px; clear: both; padding: 6px 0px; position: fixed; top: 0px; width: 720px; z-index: 9999999;">
<br /></div>
</div>
</div>
<div style="background-color: white; border: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 15.454545021057129px; line-height: 20.454544067382813px; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="color: red; font-family: inherit; font-size: 20px; font-style: inherit; font-weight: inherit; line-height: 1.35;">Video hướng dẫn sử dụng string.Format: <a href="http://youtu.be/qDyMmjb8w0E" style="color: #0d17ff; text-decoration: none;" target="_blank">Click here</a></span><br />
<a href="https://www.blogger.com/null" name="more"></a><br />
<div style="color: #404040;">
<span style="color: #333399; font-family: inherit; font-size: 20px; font-style: inherit; font-weight: inherit; line-height: 1.35;">Formatting String</span></div>
</div>
<table border="0" cellpadding="0" style="background-color: white; border-bottom-color: rgb(221, 221, 221); border-bottom-style: solid; border-collapse: collapse; border-spacing: 0px; border-width: 0px 0px 1px; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 15.454545021057129px; line-height: 20.454544067382813px; margin: 0px 0px 1.5em; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline; width: 620px;"><tbody style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">example</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">output</strong></div>
</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">String.Format(“–{0,10}–”, “test”);</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">– test–</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">String.Format(“–{0,-10}–”, “test”);</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">–test –</td></tr>
</tbody></table>
<h2 style="background-color: white; border: 0px; clear: both; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 2rem; font-weight: normal; line-height: 1.35; margin: 25px 0px 10px; outline: 0px; padding: 0px 0px 5px; vertical-align: baseline;">
<span style="border: 0px; color: #333399; font-family: inherit; font-size: 20px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Formatting number</span></h2>
<table border="0" cellpadding="0" style="background-color: white; border-bottom-color: rgb(221, 221, 221); border-bottom-style: solid; border-collapse: collapse; border-spacing: 0px; border-width: 0px 0px 1px; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 15.454545021057129px; line-height: 20.454544067382813px; margin: 0px 0px 1.5em; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline; width: 620px;"><tbody style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">specifier</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">type</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">format</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">output<br />(double 1.2345)</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">output<br />(int -12345)</strong></div>
</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">c</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">currency</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:c}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">£1.23</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">-£12,345.00</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">d</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">decimal<br />
(whole number)</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:d}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">System.FormatException</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">-12345</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">e</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">exponent / scientific</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:e}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1.234500e+000</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">-1.234500e+004</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">f</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">fixed point</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:f}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1.23</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">-12345.00</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">g</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">general</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:g}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1.2345</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">-12345</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">n</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">number</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:n}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1.23</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">-12,345.00</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">r</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">round trippable</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:r}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1.23</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">System.FormatException</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">x</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">hexadecimal</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:x4}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">System.FormatException</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">ffffcfc7</td></tr>
</tbody></table>
<h2 style="background-color: white; border: 0px; clear: both; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 2rem; font-weight: normal; line-height: 1.35; margin: 25px 0px 10px; outline: 0px; padding: 0px 0px 5px; vertical-align: baseline;">
<span style="border: 0px; color: #333399; font-family: inherit; font-size: 20px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> Custom number formatting</span></h2>
<table border="0" cellpadding="0" style="background-color: white; border-bottom-color: rgb(221, 221, 221); border-bottom-style: solid; border-collapse: collapse; border-spacing: 0px; border-width: 0px 0px 1px; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 15.454545021057129px; line-height: 20.454544067382813px; margin: 0px 0px 1.5em; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline; width: 620px;"><tbody style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">specifier</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">type</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">format</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">output<br />(double 1234.56)</strong></div>
</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">0</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">zero placeholder</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:00.000}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1234.560</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">#</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">digit placeholder</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:#.##}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1234.56</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">.</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">decimal point placeholder</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:0.0}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1234.6</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">,</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">thousand separator</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:0,0}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1,235</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">%</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">percentage</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">{0:0%}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">123456%</td></tr>
</tbody></table>
<div style="background-color: white; border: 0px; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 15.454545021057129px; line-height: 20.454544067382813px; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="color: #333399; font-family: inherit; font-size: 20px; font-style: inherit; font-weight: inherit; line-height: 1.35;">Date formatting</span></div>
<table border="0" cellpadding="0" style="background-color: white; border-bottom-color: rgb(221, 221, 221); border-bottom-style: solid; border-collapse: collapse; border-spacing: 0px; border-width: 0px 0px 1px; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 15.454545021057129px; line-height: 20.454544067382813px; margin: 0px 0px 1.5em; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline; width: 620px;"><tbody style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">specifier</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">type</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">output<br />(June 8, 1970 12:30:59)</strong></div>
</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">d</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Short Date</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">08/06/1970</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">D</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Long Date</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">08 June 1970</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">t</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Short Time</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">12:30</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">T</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Long Time</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">12:30:59</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">f</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Full date and time</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">08 June 1970 12:30</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">F</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Full date and time (long)</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">08 June 1970 12:30:59</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">g</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Default date and time</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">08/06/1970 12:30</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">G</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Default date and time (long)</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">08/06/1970 12:30:59</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">M</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Day / Month</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">8 June</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">r</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">RFC1123 date string</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Mon, 08 Jun 1970 12:30:59 GMT</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">s</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Sortable date/time</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1970-06-08T12:30:59</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">u</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Universal time, local timezone</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1970-06-08 12:30:59Z</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Y</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Month / Year</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">June 1970</td></tr>
</tbody></table>
<h2 style="background-color: white; border: 0px; clear: both; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 2rem; font-weight: normal; line-height: 1.35; margin: 25px 0px 10px; outline: 0px; padding: 0px 0px 5px; vertical-align: baseline;">
<span style="border: 0px; color: #333399; font-family: inherit; font-size: 20px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Custom date formatting</span></h2>
<table border="0" cellpadding="0" style="background-color: white; border-bottom-color: rgb(221, 221, 221); border-bottom-style: solid; border-collapse: collapse; border-spacing: 0px; border-width: 0px 0px 1px; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 15.454545021057129px; line-height: 20.454544067382813px; margin: 0px 0px 1.5em; outline: 0px; padding: 0px; text-align: center; vertical-align: baseline; width: 620px;"><tbody style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">specifier</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">type</strong></div>
</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;"><div align="center" style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<strong style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">output<br />(June 8, 1970 12:30:59)</strong></div>
</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">dd</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Day</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">08</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">ddd</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Short Day Name</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Mon</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">dddd</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Full Day Name</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Monday</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">hh</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">2 digit hour</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">12</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">HH</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">2 digit hour (24 hour)</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">12</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">mm</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">2 digit minute</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">30</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">MM</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Month</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">06</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">MMM</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Short Month name</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Jun</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">MMMM</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">Month name</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">June</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">ss</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">seconds</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">59</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">tt</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">AM/PM</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">PM</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">yy</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">2 digit year</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">70</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">yyyy</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">4 digit year</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">1970</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">:</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">seperator, e.g. {0:hh:mm:ss}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">12:30:59</td></tr>
<tr style="border: 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">/</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">seperator, e.g. {0:dd/MM/yyyy}</td><td style="border-color: rgb(221, 221, 221) rgb(244, 244, 241) rgb(244, 244, 241); border-style: solid; border-width: 1px 0px 0px; font-family: inherit; font-size: 15.454545021057129px; font-style: inherit; margin: 0px; outline: 0px; padding: 6px 10px 6px 0px; vertical-align: baseline;">08/06/1970</td></tr>
</tbody></table>
<div style="background-color: white; border: 0px; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 15.454545021057129px; line-height: 20.454544067382813px; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="color: #333399; font-family: inherit; font-size: 20px; font-style: inherit; font-weight: inherit; line-height: 1.35;">Culture information</span></div>
<div style="background-color: white; border: 0px; color: #404040; font-family: Arial, Helvetica, sans-serif; font-size: 15.454545021057129px; line-height: 20.454544067382813px; margin-bottom: 1.5em; outline: 0px; padding: 0px; vertical-align: baseline;">
String.Format() cho phép overload chấp nhận tham số CultureInfo. Từ đó, giúp cho các lập trình viên có thể viết được các chương trình phù hợp với những vùng văn hóa khác nhau. Ví dụ, các tên tháng sẽ thay đổi theo thiết lập cục bộ trong máy của bạn. Thay vì gọi đơn giản gọi phương thức String.Format(), bạn nên chú ý đến việc dùng overload này. <span style="font-size: 15.454545021057129px;">Nếu bạn không muốn xác định culture, bạn có thể dùng System.Globalization.CultureInfo.InvariantCulture. Điều này sẽ đặt thiết lập định dạng mặc định là English, và sẽ thay thế cho culture trong thread hiện tại.</span></div>
</div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-58750413834784024982014-08-06T07:41:00.004-07:002014-08-06T07:41:34.535-07:00Hướng dẫn sử dụng AVR Studio<h1 class="f5 f6">
</h1>
<hr />
<h2>
<span style="font-size: small;"></span> </h2>
<strong>1. Giới thiệu:</strong><br />
<table border="0" cellpadding="1" cellspacing="1"><tbody>
<tr><td>AVR Studio là một bộ phần mềm do hãng ATmel phát triển sử dụng cho việc <o:p></o:p>soạn thảo và biên dịch chương trình dành cho các vi điều khiển thuộc họ AVR bằng ngôn ngữ C và Assembly. Hiện AVR Studio đã phát triển đến phiên bản 6 (gọi là ATmel Studio), trong phạm vi bài viết này, Embed VN giới thiệu về AVR Studio 4 (đây là phiên bản khá phổ biến trong giới lập trình AVR) và cách thức tạo project, soạn thảo, biên dịch mã nguồn.<br />
AVR Studio có thể tải về tại đây: <a href="http://www.mediafire.com/download/hieydgeynmy/astudio4b623.exe" target="_blank">http://www.mediafire.com/download/hieydgeynmy/astudio4b623.exe</a></td><td><img alt="AVR Studio 4" height="185" src="http://embed.vn/images/upload/Image/avr-studio.jpg" width="350" /></td></tr>
</tbody></table>
<strong>2. Tạo và biên dịch Project trên AVR Studio</strong><br />
Sau khi cài đặt AVR Studio, bạn khởi chạy chương trình từ “Start -> Programs -> Atmel AVR Tools -> AVR Studio 4”. Ở lần đầu chạy AVR Studio sẽ xuất hiện cửa sổ Welcome to AVR Studio 4, bỏ check ở Show dialog at startup và chọn Cancel để tiếp tục<br />
<div style="text-align: center;">
<img alt="Tạo project trong AVR Studio 4" height="377" src="http://embed.vn/images/upload/Image/avr-studio4-startup.jpg" title="Khởi động AVR Studio" width="600" /></div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
Tạo mới Project. Chọn menu Project và chọn New Project</div>
<div style="text-align: left;">
</div>
<div style="text-align: center;">
<img alt="Tạo một project trong AVR Studio 4" height="540" src="http://embed.vn/images/upload/Image/avr-studio-new-project.jpg" title="Tạo project mới bằng AVR Studio" width="720" /></div>
<div style="text-align: center;">
</div>
<div style="text-align: left;">
<div>
AVR Studio cho phép người lập trình tạo các Project bằng cả 2 ngôn ngữ C và Assembly. Để tạo Project bằng ngôn ngữ Assembly, trong vùng Project type chọn Atmel AVR Assembler và thực hiện các bước làm kế tiếp. Trong bài này sẽ ví dụ làm với 1 Project bằng ngôn ngữ C, để tạo Project viết bằng C hãy chọn AVR GCC.</div>
<div>
</div>
<div style="text-align: center;">
<img alt="Chọn AVR GCC hoặc AVR Assembly tùy ngôn ngữ bạn muốn lập trình" height="376" src="http://embed.vn/images/upload/Image/avr-gcc.jpg" title="Chọn ngôn ngữ để lập trình Assembly hoặc C" width="600" /></div>
<div style="text-align: center;">
</div>
<div style="text-align: left;">
<div>
Sau khi ghi đầy đủ thông tin Project như tên Project, file viết code, thư mục chứa Project, chọn Next để tiếp tục.</div>
<div>
Trong vùng Debug platform chọn AVR Simulator nếu muốn mô phòng chip AVR trên máy tính hoặc chọn <a href="http://embed.vn/danh-muc-19-0-mach-nap-avr.html">mạch nạp</a> tương ứng muốn sử dụng, trong vùng Device chọn</div>
<div>
chip cần lập trình, ví dụ chọn chip ATmega32</div>
<div>
</div>
<div style="text-align: center;">
<img alt="Chọn mạch nạp chip hoặc Simulator để mô phỏng và chip AVR cần lập trình" height="377" src="http://embed.vn/images/upload/Image/device-and-debug-platform.jpg" title="Chọn mạch nạp chip hoặc Simulator để mô phỏng và chip AVR cần lập trình" width="600" /></div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
<div>
Kết thúc việc tạo Project, chọn Finish.</div>
<div>
Thực hiện viết code và biên dịch bằng phím F7 hoặc chọn menu Build và chọn Build</div>
<div>
</div>
<div style="text-align: center;">
<img alt="Biên dịch project AVR" height="540" src="http://embed.vn/images/upload/Image/build-avr-studio-project.jpg" width="720" /></div>
<div style="text-align: center;">
</div>
<div style="text-align: left;">
<strong>3. Kết luận</strong></div>
</div>
</div>
</div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-28128043709744654252014-06-10T09:58:00.002-07:002014-06-10T09:58:56.129-07:001./. Các loại Biến áp Xung<span style="background-color: white; border: 0px; font-family: 'times new roman', times, serif; font-size: 12px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; text-align: justify; vertical-align: baseline;"><span style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 18px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;"><br />Loại khung hình chữ nhật<br /><img alt="" src="http://3-heroes.com/uploads/news/2013_01/untitled_104.png" style="background-color: transparent; border: 0px; height: 201px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline; width: 417px;" /><br /><br />Loại khung hình xuyến<br /><img alt="" src="http://3-heroes.com/uploads/news/2013_01/untitled_81.png" style="background-color: transparent; border: 0px; height: 94px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline; width: 133px;" /></span></span><br style="background-color: white; font-family: tahoma; font-size: 12px; text-align: justify;" /><br />
<div style="background-color: white; border: 0px; font-family: tahoma; font-size: 12px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; text-align: justify; vertical-align: baseline;">
<span style="background-color: transparent; border: 0px; font-family: 'times new roman', times, serif; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 18px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;"><strong style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 24px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">2./. Đặc điểm chung</span></strong><br />Cho dù với hình dạng nào hoặc với kích thước nào thì Hệ số vòng/volt của các biến áp xung đều giống nhau.<br />Nếu kích thước biến áp càng lớn thì công suất của biến áp càng lớn... Đồng thời tùy thuộc vào biến áp đó sử dụng cho Nguồn Blocking hay Nguồn Switching mà sẽ có công suất khác nhau mặc dù có cùng kích thước.<br />Cùng một loại Biến áp nhưng nếu sử dụng cho Nguồn Blocking thì Công suất của nó sẽ nhỏ hơn Công suất của chính biến áp này nhưng được sử dụng cho Nguồn Switching.<br />Đồng thời cũng cùng một biến áp xung nhưng nếu sử dụng cho Nguồn Switching được tạo bởi xung PWM bất đối xứng <em style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">(sử dụng IC 3842, 3845...) </em>thì sẽ chỉ đạt bằng 70-80% so với nếu sử dụng cho Nguồn Switching được tạo bởi Xung PWM đối xứng <em style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">(sử dụng IC TL494).</em><br /><br /><strong style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;"><span style="background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; font-size: 24px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">3./. Số vòng dây các cuộn biến áp xung</span></strong><br />Đối với số vòng dây của các cuộn:<br />Tùy vào việc nó sử dụng cho loại nguồn nào mà Hệ số Vòng/Volt giữa chúng cũng khác nhau.<br /><br /><em style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">3.1. Nguồn Blocking</em><br />Đối với Nguồn Blocking thì cuộn sơ cấp <em style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">(có điện áp vào trong khoảng 160VDC đến 280VDC)</em> thì thường được cuốn 90 - 110 vòng và các cuộn có điện áp ra sẽ được tính bởi hệ số vòng/volt là 1 vòng/1,5V.<br />Chính vì Hệ số Vòng/Volt của Biến áp Xung sử dụng cho Nguồn Blocking rất bé nên Hiệu suất cũng như Công suất của Nguồn Blocking chỉ bằng 40-55% so với nếu sử dụng cho Nguồn Switching.<br /><br /><em style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">3.2. Nguồn Switching bất đối xứng</em><br />Đối với Nguồn Switching bất đối xứng <em style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">(sử dụng các IC 3842...) </em>thì Hệ số là 1Vòng/2,5Volt. Vì thế, cuộn Sơ cấp <em style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">(cấp nguồn từ 90VDC đến 320VDC) </em>được cuốn 45 vòng. Các cuộn điện áp ra sẽ được cuốn là 5-6 vòng cho 12Volts, 2-3 vòng cho 5Volts.<br />Đặc biệt, đối với Nguồn Switching sử dụng IC 3842 thì cần phải cuốn cuộn phản hồi để nuôi IC là 6 vòng và phải cuốn đúng chiều thì Nguồn mới hoạt động ổn định, nếu cuốn ngược chiều thì nguồn sẽ bị kêu 'chuých chuých' và điện áp ra không đều...<br /><br /><em style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">3.3. Nguồn Switching đối xứng</em><br />Đối với Nguồn Switching đối xứng <em style="background-color: transparent; border: 0px; margin: 0px; outline: rgb(0, 0, 0); padding: 0px; vertical-align: baseline;">(sử dụng IC TL494)</em> thì Hệ số là 1 vòng/3Volts nên Cuộn Sơ cấp (cấp nguồn từ 70VDC đến 320VDC sẽ được cuốn khoảng 39 đến 42 vòng. Các cuộn điện áp ra khác sẽ được cuốn 2 vòng cho 5Volts và 4 vòng cho 12Volts...</span></span></div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-74070924904192969832014-06-08T01:16:00.002-07:002014-06-08T01:16:59.504-07:00Đồng hộ hóa thư mục trên máy tính với Google Drive, Skydrive và Dropbox<div align="center" class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"> Các dịch vụ lưu trữ trực tuyến hiện nay mà được người dùng nhắc đến với cái tên “ Điện toán đám mây” đã không còn xa lạ với những ai đã từng sử dụng 1 trong các dịch vụ này. Google Drive, Skydrive của Microsoft, Dropbox, CloudDrive Amazon,…là những dịch vụ lưu trữ hiện nay đã khá quen thuộc với nhiều người dùng Internet, từ máy tính đến các thiết bị di động. Và nếu bạn đang sử dụng và sở hữu tất cả những dịch vụ này thì có khi nào bạn nghĩ đến trường hợp đồng bộ hóa dữ liệu trên máy tính với các dịch vụ này lại với nhau không? Không phải dùng phần mềm từ hãng thứ 3, chỉ qua 1 số bước của thủ thuật dưới đây, bạn có thể sao chép và di chuyển 1 số tập tin cần thiết vào 1 thư mục đặc biệt của tài khoản.</span></div>
<div align="center" class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; word-wrap: break-word !important;">
<br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><span class="Apple-tab-span" style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; white-space: pre; word-wrap: break-word !important;"></span>Bạn có thể lưu trữ tại thư mục My Documents hoặc nơi nào trên máy tính mà đang làm nhiệm vụ đồng bộ hóa của bạn. Đơn giản bạn chỉ cần tạo ra 1 liên kết, 1 phím tắt cho 1 thư mục để đồng hộ hóa bất kỳ thư mục nào trên máy tính với các dịch vụ lưu trữ này mà không cần phải di chuyển nó. </span><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"></span><span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-decoration: underline; word-wrap: break-word !important;"><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-decoration: none; word-wrap: break-word !important;" /></span></span></div>
<div align="center" class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; font-weight: bold; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-decoration: underline; word-wrap: break-word !important;">Đồng bộ hóa thư mục đối với SkyDrive và Dropbox</span><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" />Để thực hiện phần đồng bộ hóa cho SkyDrive hoặc Dropbox, người viết tạo ra 1 ví dụ để hướng dẫn các bước thực hiện cho độc giả xem quá trình thực hiện sẽ như thế nào. Bạn hãy xem hình bên dưới và bên trái là 1 thư mục tài khoản SkyDrive tại ổ D (của người viết) và 1 thư mục SkyDrive Test trong My Document.</span></div>
<div class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
</div>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; text-align: center; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><img _fl="" src="http://xhtt.vn/files/v1/2012/09/25/dong-ho-hoa-thu-muc-tren-may-tinh-voi-google-drive-skydrive-va-dropbox-1.png" style="border: solid; display: block; height: auto !important; list-style-type: none; margin: 5px; max-width: 675px !important; outline: none; padding: 0px; width: 700px; word-wrap: break-word !important;" width="600" /></span></div>
<span style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 27px; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;"><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><span class="Apple-tab-span" style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; white-space: pre; word-wrap: break-word !important;"></span>Vì thế, tôi muốn đồng bộ hóa các thư mục trong SkyDrive Test vào thư mục tài khoản SkyDrive của tôi mà không cần phải di chuyển nó. Bạn cần phải sử dụng bảng lệnh CMD (vào Start/Run gõ lệnh CMD), và gõ lệnh như sau:<br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; font-weight: bold; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">mklink /J “D:\SkyDrive\Test” “C:\Users\USERNAME\Documents\SkyDrive Test”</span></span><br />
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
</div>
<div align="center" class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: center; word-wrap: break-word !important;">
</div>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; text-align: center; word-wrap: break-word !important;">
<div style="border: none; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><img _fl="" src="http://xhtt.vn/files/v1/2012/09/25/dong-ho-hoa-thu-muc-tren-may-tinh-voi-google-drive-skydrive-va-dropbox-2.png" style="border: 1px solid rgb(102, 102, 102) !important; display: block; height: auto !important; list-style-type: none; margin: 5px; max-width: 675px !important; outline: none; padding: 0px; word-wrap: break-word !important;" width="600" /></span></div>
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /></span></div>
<div style="border: none; color: #111111; font-family: Arial, Helvetica, sans-serif !important; font-size: 16px !important; line-height: 27px !important; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><span class="Apple-tab-span" style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; white-space: pre; word-wrap: break-word !important;"></span>Giải thích dòng lệnh trên như sau: người viết tạo ra 1 liên kết tượng trưng (sysmlink) bằng cách sử dụng lệnh <span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-decoration: underline; word-wrap: break-word !important;">mklink</span>. Ở đây có 2 tham số, đầu tiên là vị trí của liên kết tượng trưng bạn muốn tạo ra và thứ 2 là thư mục nguồn. Bạn có thể thấy rằng tôi không cần tạo thư mục thử nghiệm TEST trong thư mục SkyDrive mà lệnh mklink đã thực hiện đều đó, bạn có thể đặt tên nào tùy thích. Lệnh này đã khai báo cho Windows để tạo ra liên kết trong thư mục của thư mục SkyDrive và thư mục nguồn là thư mục thử nghiệm. Sau khi liên kết được tạo ra, bạn sẽ thấy bên trong thư mục SkyDrive có 1 biểu tượng Shortcut.</span></div>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
</div>
<div align="center" class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; word-wrap: break-word !important;">
<span class="Apple-tab-span" style="border: none; font-family: inherit !important; font-size: 18px !important; list-style-type: none; margin: 0px; outline: none; padding: 0px; white-space: pre; word-wrap: break-word !important;"><span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"></span></span></div>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; text-align: center; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><img _fl="" src="http://xhtt.vn/files/v1/2012/09/25/dong-ho-hoa-thu-muc-tren-may-tinh-voi-google-drive-skydrive-va-dropbox-3.png" style="border: 1px solid rgb(102, 102, 102) !important; display: block; height: auto !important; list-style-type: none; margin: 5px; max-width: 675px !important; outline: none; padding: 0px; word-wrap: break-word !important;" width="600" /></span></div>
<span style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 18px !important; line-height: 27px; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"></span><span style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 27px; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;"><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><span class="Apple-tab-span" style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; white-space: pre; word-wrap: break-word !important;"></span>Nếu bạn mở thư mục đó, đường dẫn sẽ hiển thị như được lưu trữ trong <span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">D:\SkyDrive</span>, nhưng thực chất là nó được nằm tại thư mục <span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">SkyDrive Test</span> trong <span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">My Documents</span>. Vì vậy, bạn có thể thêm các tập tin và thư mục từ 1 vị trí của 2 thư mục này và cả 2 đều có nội dung tương tự vì kết quả đó chỉ là 1 thư mục chứ không phải 2.<br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /></span><br />
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; text-align: center; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><img _fl="" src="http://xhtt.vn/files/v1/2012/09/25/dong-ho-hoa-thu-muc-tren-may-tinh-voi-google-drive-skydrive-va-dropbox-4.png" style="border: 1px solid rgb(102, 102, 102) !important; display: block; height: auto !important; list-style-type: none; margin: 5px; max-width: 675px !important; outline: none; padding: 0px; word-wrap: break-word !important;" width="600" /></span></div>
<span style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 27px; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;"><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /></span>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
</div>
<div align="center" class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"></span></div>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">Ví dụ trên người viết thực hiện cho SkyDrive, và cách thực hiện cho Dropbox cũng như trình tự trên.</span></div>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
</div>
<div class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
<br /></div>
<div class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-decoration: underline; word-wrap: break-word !important;"><span style="border: none; font-family: inherit !important; font-size: 18px !important; font-weight: bold; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-decoration: none; word-wrap: break-word !important;">Đồng bộ hóa thư mục đối với </span><st1:street style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-decoration: none; word-wrap: break-word !important;" w:st="on"><st1:address style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-decoration: none; word-wrap: break-word !important;" w:st="on"><span style="border: none; font-family: inherit !important; font-size: 18px !important; font-weight: bold; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-decoration: none; word-wrap: break-word !important;">Google Drive</span><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-decoration: none; word-wrap: break-word !important;" /></st1:address></st1:street></span><span class="Apple-tab-span" style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; white-space: pre; word-wrap: break-word !important;"></span>Đối với dịch vụ lưu trữ của Google thì hơi khác so với 2 dịch vụ trên, nó không hỗ trợ các thư mục liên kết tượng trưng vì nếu bạn tạo ra 1 liên kết nào đó thì sẽ không thể đồng bộ hóa lên dịch vụ lưu trữ của nó được. Tuy nhiên, ta vẫn có thể sử dụng liên kết tương trưng, nhưng hơi khác so và trái ngược với cách trên. Người viết sẽ đưa ra 1 ví dụ tham khảo sau đây.</span></div>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; text-align: center; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><img _fl="" src="http://xhtt.vn/files/v1/2012/09/25/dong-ho-hoa-thu-muc-tren-may-tinh-voi-google-drive-skydrive-va-dropbox-5.png" style="border: solid; display: block; height: auto !important; list-style-type: none; margin: 5px; max-width: 675px !important; outline: none; padding: 0px; width: 700px; word-wrap: break-word !important;" width="600" /></span></div>
<span style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 27px; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;"><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /></span>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
</div>
<div class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><span class="Apple-tab-span" style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; white-space: pre; word-wrap: break-word !important;"></span>Ở đây người viết có 1 thư mục của Google Drive ở bên trái và 1 thư mục tùy chọn lấy ở ổ D là <span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">Album Picture</span>, mà tôi muốn đồng bộ hóa thư mục đó với Google Drive. Để thực hiện điều này, đầu tiên ta hãy di chuyển thư mục đã chọn là <span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">Album Picture</span> vào thư mục của Google Drive. Và thư mục đó sẽ được đồng bộ hóa như bình thường. Vậy ta có thể thực hiện đồng bộ hóa bằng cách sử dụng giao diện dòng liên như trên.</span></div>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; text-align: center; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><img _fl="" src="http://xhtt.vn/files/v1/2012/09/25/dong-ho-hoa-thu-muc-tren-may-tinh-voi-google-drive-skydrive-va-dropbox-6.png" style="border: 1px solid rgb(102, 102, 102) !important; display: block; height: auto !important; list-style-type: none; margin: 5px; max-width: 675px !important; outline: none; padding: 0px; word-wrap: break-word !important;" width="600" /></span></div>
<span style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 27px; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;"><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><span class="Apple-tab-span" style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; white-space: pre; word-wrap: break-word !important;"></span>Bây giờ người viết sẽ tạo ra 1 liên kết tượng trưng với thư mục <span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">AlbumPicture001 </span> trong ổ D và trỏ đến thư mục <span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">AlbumPicture</span> trong thư mục của ổ Google. Điều này trái ngược với những gì mà người viết đã thực hiện ở trên với SkyDrive. Truy cập vào bảng lệnh CMD, và nhập dòng lệnh sau:</span><br />
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
</div>
<div class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 18px !important; font-weight: bold; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><span style="border: none; font-family: inherit !important; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">mklink /D D:\AlbumPicture001 “C:\Users\USERNAME\Google Drive\AlbumPicture”</span></span></span></div>
<div class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
</div>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; text-align: center; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><img _fl="" src="http://xhtt.vn/files/v1/2012/09/25/dong-ho-hoa-thu-muc-tren-may-tinh-voi-google-drive-skydrive-va-dropbox-7.png" style="border: 1px solid rgb(102, 102, 102) !important; display: block; height: auto !important; list-style-type: none; margin: 5px; max-width: 675px !important; outline: none; padding: 0px; word-wrap: break-word !important;" width="600" /></span></div>
<span style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 27px; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;"><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><span class="Apple-tab-span" style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; white-space: pre; word-wrap: break-word !important;"></span>Bây giờ người viết đã tạo ra 1 liên kết tượng trưng là thư mục<span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"> AlbumPicture001</span> tại ổ D, nơi lưu các dữ liệu của thư mục nguồn tại ổ Google. Ngoài ra bạn có thể đặt tên bất kỳ cho thư mục liên kết tượng trưng này, không cần thiết phải giống thư mục nguồn mặc dù nó vẫn là 1 Shortcut.</span><br />
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; text-align: center; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><img _fl="" src="http://xhtt.vn/files/v1/2012/09/25/dong-ho-hoa-thu-muc-tren-may-tinh-voi-google-drive-skydrive-va-dropbox-8.png" style="border: 1px solid rgb(102, 102, 102) !important; display: block; height: auto !important; list-style-type: none; margin: 5px; max-width: 675px !important; outline: none; padding: 0px; word-wrap: break-word !important;" width="600" /></span></div>
<span style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 27px; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;"><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /><span class="Apple-tab-span" style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; white-space: pre; word-wrap: break-word !important;"></span>Ở hình trên bạn có thể thấy thư mục <span style="border: none; font-family: inherit !important; font-size: 12pt; font-style: italic; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">AlbumPicture001</span> được tạo ra như 1 liên kết tượng trưng sẽ được chỉ đến thư mục nguồn trong <st1:street style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" w:st="on">Google Drive</st1:street>. Nó là 1 biểu tượng Shortcut, vì thế bạn có thể xác định đó là 1 thư mục liên kết tượng trưng. Khi bạn mở thư mục liên kết này thi thực sự nó được mở từ thư mục nguồn của Google. Và kể từ đây, khi bạn thêm bất cứ dữ liệu nào vào thư mục này đều sẽ được đồng bộ hóa với <st1:street style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" w:st="on">Google Drive</st1:street>.</span><br />
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin: 10px 0px !important; outline: none; padding: 0px; text-align: center; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><img _fl="" src="http://xhtt.vn/files/v1/2012/09/25/dong-ho-hoa-thu-muc-tren-may-tinh-voi-google-drive-skydrive-va-dropbox-9.png" style="border: 1px solid rgb(102, 102, 102) !important; display: block; height: auto !important; list-style-type: none; margin: 5px; max-width: 675px !important; outline: none; padding: 0px; word-wrap: break-word !important;" width="700" /></span></div>
<span style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 12pt; line-height: 27px; list-style-type: none; margin: 0px; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;"><br style="border: none; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;" /></span>
<div style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
</div>
<div class="MsoNormal" style="background-color: #fafafa; border: none; color: #111111; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; list-style-type: none; margin-bottom: 14px !important; outline: none; padding: 0px; text-align: justify; word-wrap: break-word !important;">
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;">Như vậy, với 2 ví dụ trên có thể giúp bạn đồng bộ hóa bất cứ thư mục nào trên máy tính của bạn với 3 dịch vụ lưu trữ trực tuyến này.</span></div>
<div>
<span style="border: none; font-family: inherit !important; font-size: 12pt; list-style-type: none; margin: 0px; outline: none; padding: 0px; word-wrap: break-word !important;"><br /></span></div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-15683938058464621352014-04-27T10:09:00.000-07:002014-04-27T10:09:21.517-07:00Khắc phục lỗi 0x800F0906 khi cài NET 3.5 trên windows 8<b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"><span style="color: royalblue;">PHƯƠNG PHÁP 1</span></b><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Cài đặt yêu cầu</b><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"> -. Khi một ứng dụng, tương thích với </span><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">NET Framework 3.5</b><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"> được thực thi, nó sẽ xuất hiện với một cửa sổ yêu cầu cài đặt phiên bản cho biết.</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Chạy tập tin thực thi của ứng dụng tương thích với </span><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">NET Framework 3.5</b><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">.</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Các ứng dụng sẽ không bắt đầu , đòi hỏi bạn phải cài đặt phiên bản này cụ thể của. net</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Trong hộp cùng một thông điệp, sẽ có một tùy chọn trong đó </span><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Get. NET Framework 3.5</b><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Trên nhấp vào tùy chọn này, bạn sẽ được chuyển hướng đến của trang web liên quan</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Bạn có thể dễ dàng tải về và cài đặt phiên bản này của khung lưới. từ các máy chủ của nó</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: royalblue; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"><b>Phương pháp 2</b></span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">THUẬN LỢI QUA CÀI ĐẶT HỆ THỐNG -. NET framwork 3.5</b><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"> cũng có thể được kích hoạt bằng tay thông qua Control Panel. Cho mục đích này,</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Tới </span><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Control Panel</b><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"> , xác định vị trí, và chọn để mở chương trình và tính năng đơn</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Trong khung bên trái, cài đặt bổ sung có thể được xem bằng cách nhấp chuột vào </span><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Turn Windows Features On or Off</b><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Trong danh sách xuất hiện, lựa chọn cho </span><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">NET FRAMEWORK</b><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">. là để được kiểm tra và lưu</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Điều này sẽ, </span><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">connect to the server</b><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"> để tải về các tập tin cần thiết.</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Bằng cách chọn một trong các phương pháp trên, người sử dụng có thể khắc phục được lỗi 0x800f0906.Điều này là do thất bại trong việc kết nối đến các máy chủ để sao chép các tập tin cài đặt điều kiện tiên quyết. Lý do có thể là một vấn đề thực sự trong các kết nối Internet hoặc cấu hình của máy tính của người dùng để sử dụng Windows Server Update Service (WSUS) trong một sự thay thế của Windows Update Service.</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: royalblue; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"><b>GIẢI PHÁP 1</b></span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Trong trường hợp này, người sử dụng ban đầu kích động để yêu cầu ban quản lý các cấu hình lại hệ thống để sử dụng Windows Update thay vì WSUS, và chuyển sang một chiến thuật hướng dẫn để cho phép </span><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">NET Framework 3.5</b><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">.. Để làm như vậy, Windows 8 DVD cần phải được chèn vào và hướng dẫn quy định cần phải được tuân thủ.</span><br />
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Chèn đĩa cài đặt Windows 8 vào ổ CD , hoặc dùng file ISO cho vào ổ đĩa ảo</li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Mở <b>Start Screen</b> bằng cách nhấn phím <b>Windows</b> trên bàn phím</li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Gõ '' <b>cmd</b> '' để thực hiện một tìm kiếm mới</li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Xác định vị trí <b>Command Prompt</b> , Right Click và click chọn '' <b>Run as Administrator</b> ''</li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Trong màn hình màu đen của <b>Command Prompt</b>, gõ</li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><b>“Dism /online /enable-feature /featurename:NetFx3 /All /Source: D:\sources\sxs/LimitAccess”</b></li>
</ul>
<br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><b style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Lưu ý</b><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"> : D: trong dòng lệnh đã nêu ở trên là ổ đĩa có chứa đĩa cài đặt.</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: royalblue; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"><b>GIẢI PHÁP 2</b></span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Như một giải pháp thay thế, bạn có thể xác định trước một vị trí của một thư mục chia sẻ hoặc một file WIM, có chứa các dữ liệu cần thiết để cài đặt. Điều này có thể được thực hiện bằng cách cho phép một thiết lập chính sách nhóm và sau đó cung cấp một con đường thay thế hoàn toàn đối với các dữ liệu cài đặt. Để thực hành phương pháp này.</span><br style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;" /><br />
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Nhấn phím <b>Windows + W</b> để tiến hành mới tìm kiếm</li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Gõ '' <b>gpedit.msc</b> '' trong hộp tìm kiếm, và xác định vị trí để mở <b>Edit Group Policy</b></li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Trong khung bên trái dưới cấu hình máy tính, mở rộng <b>Administrative Templates</b></li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Click vào <b>System</b> trong khung bên phải</li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Trong cửa sổ bên phải, xác định vị trí <b>Specify settings for optional component installation and component repair</b></li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Click chuột vào <b>Enable</b> để mở và kích hoạt</li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Trong cùng một hộp thoại, dưới <b>Alternative source file path</b> nhập vào đường dẫn cài đặt mạng đúng ( <b>ví dụ: \ \ server \ Win8InstlMedia \ sources \ SXS</b>)</li>
</ul>
<ul style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px; margin: 1em 1em 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;">Bấm vào <b>Ok</b> để lưu thay đổi và <b>Edit</b> Local Group Policy Editor</li>
</ul>
<span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;">Dưới đây là video clip cho thấy một ví dụ thực tế như thế nào để thực hiện các phương pháp và giải pháp một cách chính xác</span><br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/AfHnAvRMijk?feature=player_embedded' frameborder='0'></iframe></div>
<span style="background-color: #f2f2f2; color: #333333; font-family: Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif; font-size: 13px;"><br /></span>PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-34729048226791446932014-03-14T09:07:00.003-07:002014-03-14T09:07:28.206-07:00Làm quen với Altium, khởi tạo project<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Altium Designer cung cấp môi trường sản phẩm thống nhất, phục vụ cho tấc cả các khía cạnh của quá trình phát triển điện tử, bao gồm:</span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Thiết kế Front-End và capture.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Thiết kế vật lý mạch in.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Thiết kế phần cứng FPGA.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Thực hiện hệ thống FPGA và gỡ lỗi (khi làm việc với mạch phát triển FPGA phù hợp).</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Phát triển hệ thống nhúng.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Mô phỏng mạch.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Phân tích tín hiệu.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Thiết kế mạch in.</span></li>
</ul>
</li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Altium Designer bao gồm tấc cả các biên tập và các công cụ phần mền cần thiết để thực hiện tấc cả các khía cạnh của quá trình sản xuất sản phẩm điện tử. Altium Designer giao tiếp dễ dàng tới các công cụ hỗ trợ, giao tiếp với bên thứ 3, mô phỏng. Cơ bản thiết kế Altium là The Design Explorer (DXP) Intergration Platform. Cung cấp giao diện người dung nhất quán trên tấc cả các công cụ và thiết kế. Môi trường thiết kế Altium là hoàn toàn tùy biến, cho phép thiết lập không gian làm việc phù hợp. Một lựa chọn phù hợp và mô hình chỉnh sửa trên những người dùng khác nhau cho phép dễ dàng và thuận lợi chuyển đổi giữa các tác vụ thiết kế khác nhau trong môi trường thiết kế Altium.</span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Trong giao diện chính của Altium Designer có thể làm nhiều dự án cùng một lúc, hỗ trợ giao diện người dùng chuẩn, Chẳng hạn như các menu và các thanh công cụ. Các thanh menu và công cụ có thể sắp xếp tùy ý của người dùng để phù hợp nhất cho mỗi người dùng khác nhau.</span></li>
</ul>
<div style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px 0px 0px 30px;">
<div align="center" style="margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh6.googleusercontent.com/-0a987H26ou8/UhW3D3f4ioI/AAAAAAAAALg/o63EwNB_djs/w984-h553-no/21.jpg" style="border: 0px; max-width: 100%;" /></div>
</div>
<div style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px 0px 0px 30px;">
<br /></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Các vị trí của các Panel, các Menu hay shortcut có thể di chuyển hay thêm bớt vào trong Menu làm việc chính.</span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Có thể chuyển nhanh làm việc với các dự án khác nhau thông qua WorkSpace Panel.</span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Altium Designer hỗ trợ nhiều ngôn ngữ cho người thiết kế. Để cài đặt ngôn ngữ: Tab General trong hộp thoại Preferences (DXP->Option). Sauk hi thay đổi cần khởi động lại phần mềm.</span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Phần mềm cung cấp lượng lớn giá trị các phìm tắt, giúp thao tác nhanh trong việc thiết kế, làm việc dễ dàng và chuyên nghiệp không cần quá nhiều di chuyển và nhấn chuột trong các menubar.</span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Ngoài ra Altium Designer hỗ trợ làm việc nhiều màn hình để thuận lợi và thêm không gian cho thiết kế. Để di chuyển một tài liệu đến màn hình khác chỉ cần kéo Tab đó sang vị trí của màn hình khác. Hoặc nhấn chuột phải vào tab tài liệu và chọn Open In New Windown.</span></li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh4.googleusercontent.com/-LtYf950qEmE/UhW3ENsvU6I/AAAAAAAAALk/G4uC0005lJs/w1026-h407-no/22.jpg" style="border: 0px; max-width: 100%;" /></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Một số khái niệm và lưu ý:</span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Altium cung cấp một môi trường làm việc với số lượng phím tắt tương đối lớn và hoàn chỉnh. Để ý các phím tắt là cái kí tự có gạch chân trong các MenuBar. Tận dụng điều đó giúp thiết kế nhanh và chuyên nghiệp hơn.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Chú ý một số khái niệm đã nêu trong bài tổng quan về mạch in và các tiêu chuẩn khi thiết kế mạch in.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Để làm quen dần với phím tắt, các phím tắt được trình bày sau mỗi thao tác, xuất hiện trong dấu ngoặc đơn. Tập sử dụng các phím tắt và ghi nhớ, các mạch sau này thực hiện dễ dàng và thao tác nhanh hơn rất nhiều.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Mỗi linh kiện sẽ có hình dáng và kích thước riêng, tùy loại linh kiện mà cấu tạo Footprint sẽ khác nhau.Ví dụ linh kiện hàn xuyên mạch vẽ trên Multiplayer để hiện đầy đủ các lớp, kích thước lỗ khoan. Đối với linh kiện dán thì xuất hiện lớp Top Paster, được thực hiện trên một mặt của mạch.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Các layer:</span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="color: #333333;"><span style="font-family: 'Times New Roman';">Top layer: Lớp đường mạch ở mặt trên.</span></span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="color: #333333;"><span style="font-family: 'Times New Roman';">Bottom layer: Lớp đường mạch ở mặt dưới.</span></span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="color: #333333;"><span style="font-family: 'Times New Roman';">Top overlay: Hiển thị thông tin linh kiện ở mặt trên.</span></span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="color: #333333;"><span style="font-family: 'Times New Roman';">Bottom overlay: Hiển thị thông tin linh kiện ở mặt dưới.</span></span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="color: #333333;"><span style="font-family: 'Times New Roman';">Top paste: được tạo ra bởi các chân của linh kiển dán ở mặt trên.</span></span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="color: #333333;"><span style="font-family: 'Times New Roman';">Bottom paste: được tạo ra bởi các chân của linh kiển dán ở mặt dưới.</span></span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="color: #333333;"><span style="font-family: 'Times New Roman';">Top solder: Lớp Solder Mask ở mặt trên, xem thêm trong bài tổng quan về mạch in.</span></span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="color: #333333;"><span style="font-family: 'Times New Roman';">Bottom solder:Lớp Solder Mask ở mặt dưới, xem thêm trong bài tổng quan về mạch in.</span></span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="color: #333333;"><span style="font-family: 'Times New Roman';">Keep out layer: đường giới hạn board, board được cắt theo nhưng đường vẽ trên lớp này.</span></span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Các thủ thuật và phím tắt cơ bản:</span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Để nơi vẽ mạch về trung tâm, chọn View->Fit Document.</span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Để cuộn bản vẽ mạch lên xuống sử dụng nút cuộn chuột chuột.</span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Để phóng to nhỏ. Nhấn Ctril+ nút cuộn chuột.</span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Để chuyển bản vẽ mạch sang trái, phải, nhấn Shift+ nút cuộn chuột.</span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Để chọn nhiều đối tượng (linh kiện hay dây nối…) cùng lúc, nhấn Shift + nhấn chuột vào các đối tượng.</span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Ngoài ra để di chuyển bản vẽ, thực hiện nhấn chuột phải và di chuyển về vị trí mong muốn.</span></li>
<li style="list-style: square outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Để chuyển đổi nhanh đơn vị thiết kế (mm hay mil), ở cửa sổ làm việc chính, nhấn “Q”. 1mil=0,0254mm.</span></li>
</ul>
</li>
</ul>
</li>
</ul>
<span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><span style="font-family: 'Times New Roman';">Khởi tạo Project và tùy chỉnh giao diện làm việc</span></span></span><br />
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Để thiết kế mạch in với Altium cần khởi tạo các cơ bản như sau:</span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Khởi tạo một dự án PCB trong đó cơ bản bao gồm:</span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Schematic : Sơ đồ mạch nguyên lý</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">PCB : Sơ đồ mạch in</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Schematic Library : Thư viện dùng cho mạch nguyên lý</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">PCB Library: Thư viện dùng cho mạch in.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Để bắt đầu dễ dàng hơn hôm bài viết đi vào trực tiếp vẽ một mạch.Ở đây là mạch nguồn có ngõ ra 5V, 3A. Lưu project này là “PSU_5v_3a”.</span></li>
</ul>
</li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Từ giao diện chính của chương trình Chọn File->New->Project->PCB Project.</span></li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-Fb78ZYV5XyI/UhW3FNHhooI/AAAAAAAAALs/xY0LKlnMWLg/w778-h553-no/23.jpg" style="border: 0px; max-width: 100%;" /></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Trên Workspace nhấn chuột phải vào PCB_Project1 đã tạo chọn Save Project As…</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Tại đây chọn thư mục để lưu Project, ở đây lưu với mạch tên là “PSU 5V-3A”.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Lưu ý việc lưu tên và đường dẫn project sẽ thuận tiện làm việc sau này.</span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh3.googleusercontent.com/-Xsxhe38romI/UhW3GfWqygI/AAAAAAAAAL8/jWo44idIHEY/w778-h553-no/24.jpg" style="border: 0px; max-width: 100%;" /></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Tạo mới 1 schematic.</span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Nhấp chuột phải trong giao diện Workspace chọn Add New To Project -> Schematic.</span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh3.googleusercontent.com/-L7U0Xw2DpHw/UhW3F9IQAHI/AAAAAAAAAL4/hMUR9krWnLQ/w778-h553-no/25.jpg" style="border: 0px; max-width: 100%;" /></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Sau đó lưu lại file Schematic tương tự như Project, lưu trong cùng một thư mục để dễ quản lý. Nhấp chuột phải vào Sheet1.SchDoc trong giao diện WorkSpace chọn Save As, lưu lại, ở đây đặt tên là “PSU.SchDoc” .Lưu ý rằng nếu bạn không lưu để dễ quản lý thì sau này khó làm việc.</span></li>
</ul>
</li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Tạo mới 1 PCB (sơ đồ thực hiện trên mạch in).</span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Nhấp chuột phải trong giao diện Workspace chọn Add New To Project -> PCB.</span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh6.googleusercontent.com/-3LsK0Zzx2MY/UhW3HbmN2MI/AAAAAAAAAME/6e2xuzGugbM/w778-h553-no/26.jpg" style="border: 0px; max-width: 100%;" /></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Sau đó lưu lại file Schematic tương tự như Project, lưu trong cùng một thư mục để dễ quản lý. Nhấp chuột phải vào PCB1.PcbDoc trong giao diện WorkSpace chọn Save As, sau đó lưu lại, ở đây đặt tên là “PSU.PcbDoc”. Lưu ý là nếu chưa lưu các bạn sẽ không Update được từ sơ đồ mạch nguyên lý sang mạch in.</span></li>
</ul>
</li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Tạo thư viện để vẽ mạch Schematic.</span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Trong giao diện Workspace nhấp chuột phải chọn Add New To Project -> Schematic Libray.</span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-mpk7EC4i60Q/UhW3IOLBNiI/AAAAAAAAAMM/-pfTBCaZOIo/w778-h553-no/27.jpg" style="border: 0px; max-width: 100%;" /></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Sau đó các bạn lưu lại tên thư viện.Ở đây mình lưu thư viện là “PSU.SchLib”.</span></li>
</ul>
</li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Tạo thư viện vẽ Footprint để thực hiện trên mạch in.</span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Trong giao diện Workspace nhấp chuột phải chọn Add New To Project -> PCB Libray.</span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-muOmGcgONgA/UhW3I1TmS6I/AAAAAAAAAMU/uVJUU5ab0Ng/w778-h553-no/28.jpg" style="border: 0px; max-width: 100%;" /></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Sau đó các lưu lại thư viện . Ở đây lưu là “PSU.PcbLib”.</span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-family: 'Times New Roman';">Và đây là giao diện cuối cùng sau khi đã tạo xong một Project.</span></li>
</ul>
</li>
</ul>
<br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" />
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-c71C_BUoRoI/UhW3Jyzm0hI/AAAAAAAAAMc/JGQOo7_1pwE/w778-h553-no/29.jpg" style="border: 0px; max-width: 100%;" /></div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-34818554275928649092014-03-14T09:07:00.000-07:002014-03-14T09:07:00.465-07:00Thư viện vẽ schematic và footprint altium<span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; margin-top: 0px;"><span style="font-family: 'times new roman';"><span style="color: red;">Tạo thư viện vẽ Shematic từ DataSheet</span></span></span><br />
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tạo các thư viện cần thiết cho mạch Schematic sau:</span></span></li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh4.googleusercontent.com/-OPqmE5jlQ04/UhW_8SOEv2I/AAAAAAAAAM8/_kra28JZuZE/w1024-h333-no/31.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><div align="left" style="margin: 0px; padding: 0px;">
<span style="font-size: small;"><span style="font-family: 'times new roman';">Để ý và chọn đúng loại linh kiện, là linh kiện dán hay linh kiện thường. Nên tìm kiếm các linh kiện</span></span></div>
<div align="center" style="margin: 0px; padding: 0px;">
<span style="font-size: small;"><span style="font-family: 'times new roman';">nào dễ mua và phù hợp để thiết kế mạch.</span></span></div>
<div align="center" style="margin: 0px; padding: 0px;">
<br /></div>
</li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Mạch sử dụng các loại linh kiện:</span></span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Diode SSB44.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tụ điện 330uF/35V.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">IC nguồn LM2596S-ADJ.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Cuộn dây 330mH.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Điện trở (giá trị điện trở trong mạch cần tính toán lại để đáp ứng đúng yêu cầu ngõ ra của mạch).</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Các Diode, tụ điện, cuộn dây và điện trở đều là linh kiện 2 chân, cách tạo giống nhau trong thư viện Schematic. Còn Footprint khác nhau tùy vào loại linh kiện và kích thước linh kiện.</span></span></li>
</ul>
</li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tạo thư viện Schematic cho tụ điện, các linh kiện đã nói ở trên hoàn toàn tương tự.</span></span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Đầu tiên chọn loại linh kiện thỏa mãn yêu cầu.Ở đây chọn </span></span><b><span style="font-size: small;"><span style="font-family: 'times new roman';">“</span></span></b><span style="font-size: small;"><span style="font-family: 'times new roman';">330uF35V-SMD100102</span></span><b><span style="font-size: small;"><span style="font-family: 'times new roman';">”.</span></span></b></li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh6.googleusercontent.com/-zzjEQpUf6K8/UhW_9_4SRVI/AAAAAAAAANQ/nR5ekPJ0qO4/w883-h553-no/32.jpg" style="border: 0px; max-width: 100%;" /></div>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh3.googleusercontent.com/-Jt-HF6c6CXs/UhW_9lA5odI/AAAAAAAAANI/oSsoi1ktZvQ/w1038-h553-no/33.jpg" style="border: 0px; max-width: 100%;" /></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Chọn tab SCH library sau đó tạo thư viện cho linh kiện cần tạo</span></span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Nhấn vào Add để thêm linh kiên, sau đó xuất hiện ra hộp thoại, đặt tên cho linh kiện. Ở đây đặt là “Tu 330uF”.</span></span></li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh4.googleusercontent.com/-JIB-_y-nNaI/UhW_-QujpYI/AAAAAAAAANU/FfTAgHuLO2c/w1044-h259-no/34.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><div align="left" style="margin: 0px; padding: 0px;">
<span style="font-size: small;"><span style="font-family: 'times new roman';">Trong Place trên menubar có hoặc phím tắt P chọn các biểu tượng để vẽ ký hiệu cho linh kiện. Ở đây chọn Line, và Elliptical Arc để vẽ. Để ý rằng linh kiện tụ điện là linh kiện có 2 chân, vẽ nó như kí hiệu của tụ điện. Xem hình vẽ bên dưới.</span></span></div>
</li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Sau đó vẽ đường Pin (mục này là quan trong nhất, nó liên kết đến Footprint theo thứ tự chân tương ứng đã đặt). Trong Place chọn Pin.</span></span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Sau đó đặt Pin vào 2 đầu linh kiện đã vẽ, Chú ý đầu có dấu X (xuất hiên khi di chuyển Pin) sẽ là đầu được nối với các linh kiện khác nên xoay ra ngoài (Sử dụng phím SpaceBar).</span></span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Nhấp đúp vào Pin đã tạo ra sẽ xuất hiện hộp thoại Pin properties như hình.</span></span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Trong Display name: Tên hiển thị thứ tự chân linh kiện được kết nối với Footprint.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Trong Designator: thứ tự chân sẽ được kết nối với Footprint.</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh4.googleusercontent.com/-zLSaFGM5BR8/UhW__TDhEBI/AAAAAAAAANg/_HLBaqu_GDM/w1038-h553-no/35.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tạo thư viện Schematic cho IC-LM2596S-ADJ</span></span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Đầu tiên cần có Schematic cho IC-LM2596S-ADJ. Datasheet rất dễ kiếm trên mạng.</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-axDtT8H_EQM/UhW__4Eub8I/AAAAAAAAANk/QEqcf3NFjNU/w1043-h388-no/36.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tạo thư viện linh kiện có nhiều chân, có nhiều cách tạo. Có thể tạo theo kiểu truyền thống như tạo thư viện cho điện trở hay tụ điện hay ứng dụng Paster special, Pin sheet editor. Đối với các linh kiện nhiều chân nên tạo theo cách này.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;">Đối với LM2596S-ADJ chỉ có 5 chân tạo theo cách truyền thống cũng nhanh, không nhất thiết phải ứng dụng Paster special, Pin Sheet editor.Để làm quen với phương pháp này, phần tiếp theo trình bày tạo linh kiện cho một linh kiện phức tạp hơn PIC16F877A, loại rất thông dụng hiện nay.</li>
</ul>
</li>
</ul>
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh3.googleusercontent.com/-iuBFSkzfX-c/UhXAAmHHOVI/AAAAAAAAANs/_BhGK7d-iXg/w644-h553-no/37.jpg" style="background-color: #f6f6f6; border: 0px; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><br />
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><div align="center" style="margin: 0px; padding: 0px;">
<span style="font-size: small;"><span style="font-family: 'times new roman';">Đầu tiên mở thư viện Schematic và tạo mới 1 linh kiện. phần này đã được trình bày trong tạo tụ điện nên không trình bày lại nữa.</span></span></div>
</li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tạo 1 Pin để tham khảo. Sau đó thực hiện như hình vẽ.</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-XJzyXhX8Ap8/UhXAB9_yIiI/AAAAAAAAAN0/B-MAI8s9e7U/w859-h553-no/38.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tiếp theo mở Excel lên và Paste qua. Chỉnh sửa như sau :</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh6.googleusercontent.com/-s8kSIeCLxyQ/UhXAEamt4VI/AAAAAAAAAOA/NwJ53CQTDvA/w859-h553-no/39.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Nhấn Copy toàn bộ khung dữ liệu bên Excel sau đóc chuyển sang lại giao diện của Altium, Chọn Smart Gird Insert như hình vẽ:</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh4.googleusercontent.com/-xiJK9IDA9Vg/UhXAEh0ykbI/AAAAAAAAAOE/ihibuZYiwXM/w859-h553-no/391.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tìm chân tham khảo và xóa đi. Ta được như 40 chân như sau:</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-j59322cdmgw/UhXAFy0epWI/AAAAAAAAAOM/9HSFkOs0NdA/w859-h553-no/392.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Chọn 20 Chân bên dưới sau đó nhấn SpaceBar để xoay lại, và di chuyển đến vị trí như mong muốn như hình Datasheet. Lưu ý các vị đặt chân không nhất thiết phải đặt giống như DataSheet, nhưng các thứ tự Pin phải kí hiệu cho đúng tên.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Chọn Place->Rectangle (P->R) vẽ đường bao cho IC.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Chọn Edit->Move->Sent To Back, nhấn vào khung IC để hiển thị chữ lên trên.</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh6.googleusercontent.com/-DzK5qj_OIbc/UhXAHqb6BaI/AAAAAAAAAOc/5ejgf0ZNCPk/w859-h553-no/393.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Lưu lại linh kiện. Như vậy là đã tạo xong thư viện linh kiện trong Schematic. Tiếp đến vẽ và add Footprint cho linh kiện được trình bày ở phần sau.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Ngoài ra có thể sao chép thư viện từ thư viện khác về thư viện của bạn bằng cách thêm thư viện đó vào Project (Add Exiting To Project) sau đó chọn các loại linh kiện cần sao chép, sang thư viện của bạn và dán vào. Đa số các nhà sản xuất có sẵn các thư viện cho sản phẩm của họ, chỉ cần tải về sau đó thêm những linh kiện cần thiết để tránh mất thời gian, và sai sót khi tạo thư viện. Các linh kiện thiếu hoặc không có, có thể tự bổ sung như cách trên.</span></span></li>
</ul>
</li>
</ul>
<span style="background-color: #f6f6f6; color: #141414; font-family: 'times new roman'; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><span style="color: red;">Vẽ Footprint cho mạch in</span></span></span><br />
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Altium hỗ trợ cho việc cả tạo thư viện 2D và 3D. Trong bài này chỉ trình bày tạo thư viện 2D.</span></span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tạo Footprint cho tụ điện.</span></span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Trong WorkSpace chọn Project để hiện thị giao diện làm việc chính.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Nhấp đúp vào thư viện PSU.PcbLib để tạo thêm thư viện cho linh kiện.</span></span></li>
</ul>
</li>
</ul>
<span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh3.googleusercontent.com/-G5gHeK4UXGc/UhXAGnuNowI/AAAAAAAAAOU/cgT_DIBb0-0/w1044-h426-no/394.jpg" style="border: 0px; max-width: 100%;" /></span></span><br />
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Chọn Tab PCB Library để bắt đầu vẽ Footprint cho linh kiện. Thực hiện như hình vẽ bên dưới.</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh6.googleusercontent.com/-5QCB2j96vec/UhXAJAPHRNI/AAAAAAAAAOs/ctQy0rHfY4k/w1044-h399-no/395.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Dựa vào thông số của của linh kiện. Loại G có các kích thước như datasheet.</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh6.googleusercontent.com/-NwAwOHPJr5U/UhXAIvGvh6I/AAAAAAAAAOo/JbYaBTJQq4M/w993-h553-no/396.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Các Pad ,phần quan trọng nhất của Footprint, các đường đồng được hiển thị trên mạch in, nơi được hàn linh kiện và kết nối qua các đường đồng đến các linh kiện khác,các pad kết nối với các pin theo thứ tự chân tương ứng bên thư viện Schematic sau khi Add FootPrint sẽ được trình bày ở mục sau. 2 pad có cùng kích thước W*I=0.9mm*3.5mm. Khoảng cách giữa 2 Pad P=4.6mm.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Các Pad nên vẽ lớn hơn giá trị cho trong datasheet một tí dễ hàn linh kiện khi thi công mạch hơn.có thể vẽ W*I=1mm*3.6mm.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Chú ý: 1mm tương đương xấp xỉ 40mil.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Các Pad dùng trong mạch này là linh kiện dán được vẽ trên lớp Top Layer. Đối với linh kiện thông thường thì chọn vẽ trên MultiLayer để hiện thị thêm kích thước lỗ khoan.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Để thêm Pad chọn Place trên memu Tab hoặc nhấp đúp vào khoảng trống ở giữa của giao diện, chọn Pad, hoặc sử dụng phím tắt P->P.</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh4.googleusercontent.com/-kkgT3jLHq-o/UhXAJ3Pr2tI/AAAAAAAAAO0/vE44n0bIOdM/w1044-h378-no/397.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Nhấp đúp vào Pad để chọn thuộc tính cho Pad. Dùng phương pháp canh tọa độ đặt các Pad chính xác. Các linh kiện có thể xoay, đặt ở vị trí tùy ở. Vẽ ở gần trục tọa độ dễ canh khoảng cách hơn.</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh4.googleusercontent.com/-3qUyjoCcFt0/UhXAMKMQNDI/AAAAAAAAAPI/1n2xtWFLF0U/w1038-h553-no/398.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Pad 2 vẽ tương tự. Chọn lại tọa độ để đạt được khoảng cách giữa 2 Pad là P=4.6mm. Tương ứng có tọa độ Pad 2 (X= 0mm, Y= 4.1mm).Chú ý X,Y là tâm linh kiện. Để P=4.6mm, thì khoảng cách từ tâm đến mỗi Pad là 2.3 mm. Do đó tọa độ Y là I/2+P/2=4.6/2+3.6/2 = 4.1mm</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tiếp theo vẽ đường bao cho linh kiện. Các giá trị tương ứng trong Datasheet. Phần này hiển thị để biết rõ hơn linh kiện được in giống như chú thích trên mạch in nên chỉ cần tương đối. Lưu ý phần này được vẽ trên lớp Top Overlay.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Sau khi thực hiện xong lưu lại vào thư viện.</span></span></li>
</ul>
</li>
</ul>
<span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh3.googleusercontent.com/-I4Ced7Y1KV8/UhXALKdRpCI/AAAAAAAAAO8/bqM2lsZ6t9A/w1038-h553-no/399.jpg" style="border: 0px; max-width: 100%;" /></span></span><br />
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Đối với các linh kiện còn lại tạo hoàn toàn tương tự. Tuy nhiên đối với linh kiện nhiều chân thực hiện theo cách sau.Ở đây chọn Linh kiện PIC16F877A tương ứng với đã tạo Schematic ở trên.</span></span></li>
</ul>
</li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tạo footprint sử dụng công cụ Component Wizard</span></span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Ví dụ tạo footprint cho Pic 16F877A, Loại 40 Chân PDIP</span></span><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Chọn Tools->Component Wizard… (T->C).Xuất hiện hộp thoại sau :</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh4.googleusercontent.com/-TyuMYr0p4lM/UhXAMgkr74I/AAAAAAAAAPQ/tVd_NsJ0GU0/w640-h499-no/3991.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Nhấn Next> Xuất hiện ra hộp thoại chọn loại chân.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;">Ở đây chọn Dual In-line Packages(DIP)<span style="font-size: small;"><span style="font-family: 'times new roman';"> .</span></span>Đơn vị chọn mm cho dễ thực hiện.</li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh6.googleusercontent.com/-vUc80Cw4v38/UhXAMy68NFI/AAAAAAAAAPU/eu88LUX53C8/w640-h499-no/3992.jpg" style="border: 0px; max-width: 100%;" /></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tiếp tục nhấn Next> Xem lại datasheet và chọn các thông số cho phù hợp.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Các thông số cần chú ý ở đây là kích thước.</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh4.googleusercontent.com/-etip8B-rip4/UhXANlVeAEI/AAAAAAAAAPc/BH67MmsRs0E/w657-h553-no/3993.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-n49rzjq7XAY/UhXAONbJ85I/AAAAAAAAAPo/wL7zH-sfL7Y/w816-h466-no/3994.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Chọn xong kích thước lỗ khoan và kích thước PAD nhấn Next></span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh3.googleusercontent.com/-j14g3332ukM/UhXAOhXFMmI/AAAAAAAAAPs/6S0aPazUDd4/w816-h466-no/3995.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><div align="center" style="margin: 0px; padding: 0px;">
<span style="font-size: small;"><span style="font-family: 'times new roman';">Sau khi chọn xong chọn Next> chọn kích thước outline (đường bao) cho footprint.</span></span></div>
</li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-hziAWElFd4E/UhXAPORxFsI/AAAAAAAAAP4/rtoEEfizOJw/w816-h466-no/3996.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tiếp tục nhấn next. Chọn số lượng chân cho footpint - ở đây là 40 chân.</span></span></li>
</ul>
</li>
</ul>
<span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-4fIvEbNHNms/UhXAPPOdlxI/AAAAAAAAAQA/0olq4LEQKHc/w816-h466-no/3997.jpg" style="border: 0px; max-width: 100%;" /></span></span><br />
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><ul style="margin: 0px 0px 0px 2em; padding: 0px;">
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Tiếp tục nhấn Next, đặt tên cho footprint.</span></span></li>
<li style="list-style: circle outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Nhấn next và finish là đã hoàn thành footprint cho linh kiện như hình vẽ:</span></span></li>
</ul>
</li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh6.googleusercontent.com/-PeH1JH3UKKw/UhXAPdoYqwI/AAAAAAAAAQE/Jorlm-Y1bH0/w814-h249-no/3998.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
<div align="left" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<br /></div>
<div align="left" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="color: red;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Add FootPrint</span></span></span></div>
<ul style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 1em 0px 1em 2em; padding: 0px;">
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Từ thư viện Schematic. Chọn Linh kiện Tu 330uF sau đó add Footprint tương ứng.</span></span></li>
<li style="list-style: disc outside; margin: 0px; padding: 0px;"><span style="font-size: small;"><span style="font-family: 'times new roman';">Add Footprint có thể được thực hiện theo sau khi vẽ mạch Schematic . Tuy nhiên khi tạo thư viện nên làm luôn mục này để sau này sử dụng không cần phải Add Footprint mà chỉ cần sử dụng.</span></span></li>
</ul>
<div align="center" style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin: 0px; padding: 0px;">
<span style="font-size: x-small;"><span style="font-family: 'times new roman';"><img alt="[IMG]" class="bbCodeImage LbImage" src="https://lh5.googleusercontent.com/-OS-O_uY_GMk/UhXAQw0iSJI/AAAAAAAAAQM/CIn_nKTJOZE/w1038-h553-no/3999.jpg" style="border: 0px; max-width: 100%;" /></span></span></div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com4tag:blogger.com,1999:blog-6417374826664977718.post-61596404057086448662014-03-14T08:48:00.001-07:002014-03-14T08:48:34.661-07:00hướng dẫn thiết kế altium<b style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">1. Lấy linh kiện từ thư viện</b><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Chọn các linh kiện cần thiết cho mạch Schematic sau</span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: arial; font-size: 15px; line-height: 20px;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm4.staticflickr.com/3785/9582362794_b29a5a4e37_o.png" style="border: 0px; max-width: 100%;" /></span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Trong Workplace trên thanh Menubar chọn Part (hoặc nhấn P->P). Hoặc dùng chức năng Search linh kiện trong các thư viện trong mục Library. Chọn các linh kiện cần thiết cho mạch Schematic.</span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Lưu ý ở đây thêm thư viện có sẵn của chương trình “NSC switcher.SchLib” (thư viện nằm trong </span><b style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">…\Library\National Semiconductor\NSC switcher.SchLib</b><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"> ) để dùng linh kiện có sẵn LM2596S-ADJ, các linh kiện còn lại là các linh kiện đã tạo từ </span><b style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><a class="internalLink" href="http://vidieukhien.net/threads/46/" style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-top-left-radius: 5px; border-top-right-radius: 5px; color: #467e06; margin: 0px -3px; padding: 0px 3px; text-decoration: none;">bài trước</a></b><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"> hoặc từ các thư viện sẵn có.</span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: arial; font-size: 15px; line-height: 20px;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm6.staticflickr.com/5548/9579583341_e16fd95375_o.png" style="border: 0px; max-width: 100%;" /></span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Các linh kiện khác thực hiện tương tự.</span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Sau khi đã lấy ra đầy đủ các linh kiện cần thiết, tiến hành sắp xếp các linh kiện lại cho hợp lý .</span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><b style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">2. Sắp xếp và đi dây linh kiện</b><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Tiến hành sắp xếp lại mạch sau khi đã lấy các linh kiện.</span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Đi dây chọn place->Wire hoặc nhấn biểu tưởng Wire.</span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Sử dụng thêm Net Lable để đi dây cho các mạch phức tạp hơn. (Đặt tại các điểm cần kết nối. Các Lable cùng tên được kết nối với nhau mà không cần đi dây ).</span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><b style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">chú ý: nhớ đặt tên cho các linh kiện, không được trùng tên !</b><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: arial; font-size: 15px; line-height: 20px;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm3.staticflickr.com/2883/9579586091_c9cab549a8_o.png" style="border: 0px; max-width: 100%;" /></span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Sau khi tiến hành đi dây. Được mạch Schematic sau</span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: arial; font-size: 15px; line-height: 20px;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm6.staticflickr.com/5485/9582375744_51ec9813bd_o.png" style="border: 0px; max-width: 100%;" /></span><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Tiến hành lưu lại mạch Schematic.</span><br />
<span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><br /></span>
<span style="background-color: #f6f6f6; color: #141414; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><br /></span>
<div class="messageContent" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 16px; margin: 0px; min-height: 120px; padding: 0px; zoom: 1;">
<article><blockquote class="messageText ugc baseHtml" style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: 11pt; line-height: 1.4; margin: 0px; padding: 0px;">
CHUYỂN THIẾT KẾ TỪ SCHEMATIC SANG FILE PCB<br style="margin-top: 0px;" />Quá trình này được thực hiện bằng cách mở file schematic lên. Sau đó chọn <b>Design >> Update PCB Document</b> . Cửa sổ <b>Engineering Change Order</b> hiện ra, sau đó và nó sẽ tiến hành các quá trình sau:<br />1.Một list các thành phần được sử dụng trong thiết kế sẽ được liệt kê ra và nó sẽ yêu cầu footprint cho mỗi thành phần trong đó. Altium sẽ tìm các footprint này trong các thư viện và đặt chúng vào <b>Workspace PCB</b>. Nếu như không tìm thấy footprint nó sẽ báo lỗi !<br />2.List các dây nối, các linh kiên được tao ra, các dây được nối vào các pad của các linh kiện theo đúng sơ đồ nguyên lý ( schematic). Lỗi sẽ xảy ra nếu như footprint không được tìm thấy hay các pads trong footprint không tương thích với sơ đồ nguyên lý.<br /><br />Các bước thực hiện :3.Ngoài ra các công cụ khác cũng được add vào file PCB, bao gồm <b>placement rooms</b> ( bạn sẽ thấy nó là 1 vùng màu hồng xuất hiên trong <b>workspace PCB</b> sau khi quá trình chuyển thiết kế này hoàn tất ), các lớp linh kiên, các luật thiết kế ..v..v<br />1.Mở file schematic lên : PSU.SchDoc<br />2.Chọn <b>Design >> update PCB Document PSU.PcbDoc</b>. Cửa sổ <b>Engineering Change Order</b> xuất hiện.<br /><br /><span style="font-family: arial;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm8.staticflickr.com/7434/9582421402_c75007ef6c_o.png" style="border: 0px; max-width: 100%;" /></span><br /><br /><br />3.Click vào <b>Validate Change</b>, nếu tất cả thay đổi được phê chuẩn thì dấu tick màu xanh lá cây sẽ hiện ra ở mỗi thành phần trong list. nếu như sự thay đổi không được phê duyệt, đóng bảng này lại kiểm tra và sửa các lỗi.<br />4.Click vào <b>Execute Changes</b>, để chuyển những thay đổi này vào file PCB. Khi quá trình hoàn tất, cột <b>Done</b> sẽ được tick<br />5.Click close. Workspace PCB hiện ra với tất cả các linh kiện được xếp trong <b>placement rooms</b> ( khung màu hồng). nếu như bạn chưa thấy các linh kiện sử dụng phím tắt <b>V + D ( View >> Fit Document)</b>.<br /><span style="font-family: arial;"><span style="color: red;"><span style="font-size: small;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm8.staticflickr.com/7402/9580199437_2139e6f8f5_o.png" style="border: 0px; max-width: 100%;" /></span></span></span><br /><br /><br /><br /><b>Board Shape</b> với đường outline chính là vùng mà nhà sản xuất PCB căn cứ vào đó để cắt Board. Ta định nghĩa lại Board Shape bằng cách chọn<b>Design>> Board Shape >> Redefine Board Shape</b>. và dùng chuột để tùy chình vùng board mới !<br />Vẽ đường <b>board outline</b> bằng cách chọn công cụ 'line' và phải được vẽ trên lớp 'keep-out layer'.<br /><br /><br /><span style="font-family: arial;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm3.staticflickr.com/2882/9580234411_bbb5b4ac70_o.png" style="border: 0px; max-width: 100%;" /></span></blockquote>
</article></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<div class="privateControls" style="float: left; margin: 0px; padding: 0px;">
</div>
</div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<br /></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px; margin-top: 0px;"><span style="font-size: small;"><b>THIẾT KẾ PCB</b></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">Tới đây chúng ta đã có board mạch, các linh kiện. nhiệm vụ lúc này là xếp các linh kiện đó lên board và đi dây đồng ( tracks) sao cho tối ưu, hợp lý nhất.</span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">Xếp các linh kiện ở vùng màu hồng vào board ( màu đen). Vì vùng màu hồng này ta không cần dùng tới nữa có thể ẩn nó đi bằng cách nhấn <span style="color: red;">Clrl + D. </span>bảng <span style="color: red;">View Configurations </span>hiện ra , trong vùng <span style="color: red;">Rooms </span>chọn <span style="color: red;">Hidden. </span>Click <span style="color: red;">OK.</span></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="color: red;"><span style="font-size: small;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm6.staticflickr.com/5453/9583033920_ec603e4ee4_o.png" style="border: 0px; max-width: 100%;" /> </span></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Hoặc đơn giản ta có thế xóa nó đi : click chuột vào nó và nhấn Delete <img alt=":D" class="mceSmilieSprite mceSmilie8" src="http://vidieukhien.net/styles/default/xenforo/clear.png" style="background-image: url(http://vidieukhien.net/styles/default/xenforo/xenforo-smilies-sprite.png); background-position: -20px 0px; background-repeat: no-repeat no-repeat; border: 0px; height: 18px; margin: 0px 1px; vertical-align: text-bottom; width: 18px;" title="Big Grin :D" /></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Để xếp đặt các linh kiên, có thể dùng các công cụ như :</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">PCB Inspector: click vào thẻ “PCB” ở góc phía dưới bên phải màn hình, chọn “PCB Inspector” , chọn linh kiện rồi chỉnh tọa độ của nó trong bảng inspector theo ý mình</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Các phím tắt Align:</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">SHIFT + CTRL + T </span><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Căn đều các đỉnh</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">SHIFT + CTRL + L </span><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Căn đều sang bên trái</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">SHIFT + CTRL + R </span><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Căn đều sang bên phải</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">SHIFT + CTRL + B </span><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Căn đều xuống dưới</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">SHIFT + CTRL + H </span><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Chia đều khoảng cách theo chiều ngang</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">SHIFT + CTRL + V </span><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Chia đều khoảng cách theo chiều dọc</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">SHIFT + CTRL + D </span><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Căn chỉnh vào gird</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm6.staticflickr.com/5457/9580264731_629ab3a261_o.png" style="border: 0px; max-width: 100%;" /></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">Nhấn phím tắt <span style="color: red;">V + F (View >> Fit Board) </span>để phóng to không gian làm việc .khi phóng to board mạch các ô lưới tọa độ sẽ hiện ra, có thể ẩn nó đi bằng cách nhấn <span style="color: red;">Ctrl + G >> </span>chọn <span style="color: red;">Do Not Draw ( như hình ). </span></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">Click<span style="color: red;"> OK</span> </span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm8.staticflickr.com/7340/9580272493_4df092d580_o.png" style="border: 0px; max-width: 100%;" /> </span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><b>THIẾT LẬP LUẬT ĐI DÂY (DRC)</b></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">Trong Altium có rất nhiều luật, muốn hiểu hết tất cả ta cần có thời gian nghiên cứu và làm việc. tuy nhiên ở mức độ cơ bản ta chỉ cần quan tâm các thông số:<br /><br />Clearance: khoảng cách giữa 2 phần tử</span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm8.staticflickr.com/7297/9580295007_5d8a4f5303_o.png" style="border: 0px; max-width: 100%;" /></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">Width: độ rộng đường mạch</span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm6.staticflickr.com/5502/9583086054_e6e9fc18e2_o.png" style="border: 0px; max-width: 100%;" /></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">·</span><span style="font-size: small;">RoutingVias: kích thước các lỗ Via( ta quan tâm tới chúng khi thi công mạch nhiều lớp )</span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm3.staticflickr.com/2810/9583100012_8cd03476b0_o.png" style="border: 0px; max-width: 100%;" /> </span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">Để thiết lập rules chọn <span style="color: red;">Design >> Rules ( phím tắt D+ R). </span>bảng <span style="color: red;">PCB Rules and Constraints Editor </span>hiện ra.</span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">click vào từng thẻ tương ứng <span style="color: red;">(như mình đã bôi trong hình)</span> và tùy chỉnh các thông số theo yêu cầu thiết kế của bạn.</span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">ví dụ trong thiết kế này mình chọn: <span style="color: red;">Preferred Width </span>= 20 mil ; <span style="color: red;">Min Width </span>= 20 mil ; <span style="color: red;">Max Width </span>= 1000 mil</span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">Chú Ý : Trong quá trình thiết kế các các thông số phần tử mạch có thể tính theo 2 hệ đơn vị khác nhau ( mm và mil). Bạn có thế nhấn phím tắt <span style="color: red;">‘ Q’</span>để chuyển đổi qua lại 2 hệ đơn vị đo này. </span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm8.staticflickr.com/7317/9580322757_f7a1510a76_o.png" style="border: 0px; max-width: 100%;" /></span></span></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><br /></span></span></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><br /></span></span></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">Nhấn phím tắt <span style="color: red;">P+T </span>hoặc click chuột để chọn công cụ đi dây :</span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm4.staticflickr.com/3717/9583137112_e0c3c4c0d2_o.png" style="border: 0px; max-width: 100%;" /></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">Khi đi dây độ rộng mặc đinh dây sẽ bằng <span style="color: red;">Preferred </span><span style="color: red;">Width </span>= 20 mil mà ta đã thiết lập trong Rules.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;">muốn thay đổi kích thước dây chỉ cần nhấn phím <span style="color: red;">TAB </span>và tùy chỉnh.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm8.staticflickr.com/7433/9580359545_cc0df11d5e_o.png" style="border: 0px; max-width: 100%;" /></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">nhắc lại : có thể nhấn phím Q để chuyển đổi qua lại 2 hệ đơn vị đo ( mm; mil)</span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">chú ý: khi chỉnh kich thước dây phải thỏa mãn: <span style="color: red;">Min Width</span><span style="color: red;">≤ kích thước dây ≤</span><span style="color: red;"> Max Width</span></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="color: red;"><span style="font-size: small;">Min Width; Max Width </span></span>là giá trị mà ta đã thiết lập trước trong Rules !</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">nếu không thỏa mãn Altium sẽ báo lỗi !</span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;">Lưu ý: mỗi đường dây phải chịu 1 dòng tải khác nhau, do đó ta phải dựa vào dòng tải của dây mà chọn kích thước dây cho phù hợp. trong bài hướng dẫn này đường dây nguồn phải chịu dòng lên tới 3A. Vì thế mà mình chọn kích thước dây nguồn tương đối lớn = 4mm <img alt=":D" class="mceSmilieSprite mceSmilie8" src="http://vidieukhien.net/styles/default/xenforo/clear.png" style="background-image: url(http://vidieukhien.net/styles/default/xenforo/xenforo-smilies-sprite.png); background-position: -20px 0px; background-repeat: no-repeat no-repeat; border: 0px; height: 18px; margin: 0px 1px; vertical-align: text-bottom; width: 18px;" title="Big Grin :D" /> <img alt=":D" class="mceSmilieSprite mceSmilie8" src="http://vidieukhien.net/styles/default/xenforo/clear.png" style="background-image: url(http://vidieukhien.net/styles/default/xenforo/xenforo-smilies-sprite.png); background-position: -20px 0px; background-repeat: no-repeat no-repeat; border: 0px; height: 18px; margin: 0px 1px; vertical-align: text-bottom; width: 18px;" title="Big Grin :D" /> <img alt=":D" class="mceSmilieSprite mceSmilie8" src="http://vidieukhien.net/styles/default/xenforo/clear.png" style="background-image: url(http://vidieukhien.net/styles/default/xenforo/xenforo-smilies-sprite.png); background-position: -20px 0px; background-repeat: no-repeat no-repeat; border: 0px; height: 18px; margin: 0px 1px; vertical-align: text-bottom; width: 18px;" title="Big Grin :D" /></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm3.staticflickr.com/2825/9580370645_b2b5002db6_o.png" style="border: 0px; max-width: 100%;" /></span></span></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<span style="background-color: #f6f6f6; font-family: arial; font-size: 15px; line-height: 20px;"><span style="font-size: small;"><br /></span></span></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">thiết lập rule phủ đồng bằng cách click tab </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Design -> Rules,<span style="color: black;"> ở thẻ clearance click phải chọn <span style="color: red;">new rule <span style="color: black;">và </span><span style="color: black;">để tên rule là <span style="color: red;">clearance_1*</span> như mặc định. tick chọn</span></span></span> Advanced(Query)</span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><span style="color: black;"><span style="color: red;"><span style="color: black;">, click tiếp <span style="color: red;">Query Buder</span>, trong cửa sổ hiện ra chọn <span style="color: red;">belong to polygon</span> (như hình minh họa), sau khi hoàn thành click <span style="color: red;">OK</span></span></span></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><b style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm8.staticflickr.com/7459/9710421116_d8205b3782_o.png" style="border: 0px; max-width: 100%;" /></b><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Tiếp đó thay đổi thông số </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">clearance</span><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"> cho phù hợp!</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm4.staticflickr.com/3714/9710867182_442efc41c1_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Tại sao ta phải thay đổi thông số </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">clearance</span><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"> so với mặc định ?.</span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">C</span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">learance </span><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">là khoảng cách giữa lớp phủ đồng và các phần tử khác trên PCB. Chúng ta có rất nhiều nhà sản xuất PCB chất lượng, việc chế tạo PCB bị lỗi do lớp phủ đồng chưa tách rời hoàn toàn với các phần tử khác là 1 điều hiếm gặp . tuy nhiên để giúp công việc sản xuất PCB được dễ dàng, cũng như ta thiết kế 1 PCB đạt tiêu chuẩn, tăng thông số clearance là 1 điều nên làm ( </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">mình để</span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">clearance </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">= 60 mill</span><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">). việc này cũng giúp giảm thiểu các lỗi trong thiết kế PCB.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Tiếp đó để phủ đồng, click </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Place -> Polygon Pour<span style="color: black;">. chọn lớp phủ là </span></span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">top layer</span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><span style="color: black;">, net phủ là <span style="color: red;">GND</span>, click <span style="color: red;">OK</span></span></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><b style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm8.staticflickr.com/7346/9710233404_4269da5a63_o.png" style="border: 0px; max-width: 100%;" /></b><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; color: black; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">sau đó dùng chuột để tùy chình vùng phủ đồng bám theo đường </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">keep-outline.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><b style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm6.staticflickr.com/5489/9710431034_7e2ef725d2_o.png" style="border: 0px; max-width: 100%;" /></b></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<b style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"><br /></b></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: large; margin-top: 0px;"><b>Adding lables</b></span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Add thêm các nhãn đễ board mạch của ta trở nên rõ ràng, chuyên nghiệp và dễ dàng khi sử dụng.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">chọn lớp vẽ là top overlay, sau đó nhấn phím tắt P- S (Place -> String). có 1 nhãn di chuyển theo đầu con trỏ chuột, đặt nhãn ở vị trí thích hợp và chỉnh sủa lại nội dung.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">vì board này khá đơn giản, ta không cần phải thêm các nhãn, chỉ cần chỉnh sử lại các nhãn có sẵn trên board cho phù hợp. các nhãn TP1 - TP2 là vị trí cấp nguồn, và TP3-TP4 là tín hiệu out. đúp click vào tững nhãn và sửa lại TP1 là Vin, TP3 là Vout, TP2, TP4 là GND như hình.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm8.staticflickr.com/7408/9711167146_6499bbb732_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Một công cụ cực kỳ hay và hữu ích trong Altium đó là </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Inspector</span><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"> và </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Find similar Objects</span><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">. bạn có thể chọn và chỉnh sửa nhiều phần tử cùng lúc mà không tốn thời gian. ở ví dụ này mình sẽ sử dụng chúng để chình lại kích thước tất cả cá nhãn cùng lúc để tiết kiệm thời gian.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">click phải vào 1 nhãn bất kì và chon </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">find similar objects</span><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">. 1 cứa sổ hiện ra, ở đây ta sẽ chọn những đặc điểm chung của các đối tượng cần chọn, vì ta cần chon tất cả các text nên</span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"> Object kind</span><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"> chọn </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">same</span><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">, sau đó click </span><span style="background-color: #f6f6f6; color: red; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">OK</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm3.staticflickr.com/2873/9711718728_c0c91f72d2_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Cửa sỗ PCB Inspector hiện ra như sau, trong cứa sổ này là rất nhiều những thông số của các nhãn được chọn. ta chỉnh lại kích thước nhãn bằng cách thay đổi text Height và text Width ( được bôi trên hình) cho phù hợp.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm4.staticflickr.com/3780/9712133537_bf5be24181_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">ok, vậy là các nhãn trông đã nhỏ hơn và gọn gàng hơn ! </span><img alt=":D" class="mceSmilieSprite mceSmilie8" src="http://vidieukhien.net/styles/default/xenforo/clear.png" style="background-color: #f6f6f6; background-image: url(http://vidieukhien.net/styles/default/xenforo/xenforo-smilies-sprite.png); background-position: -20px 0px; background-repeat: no-repeat no-repeat; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; height: 18px; line-height: 20px; margin: 0px 1px; vertical-align: text-bottom; width: 18px;" title="Big Grin :D" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm4.staticflickr.com/3744/9715378198_46ed1693bb_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"> </span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Nhấn phím tắt 2 <-> 3 để chuyển đổi qua lại chế đọ 2D và 3D, mình cực kỳ thích công cụ này, nó giúp ta có thể quan sát mạch một cách trực quan hơn, va có thể đưa ra những quyết định chỉnh sửa lại cho board đẹp hơn, chuyên nghiệp hơn !</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm3.staticflickr.com/2831/9712197227_7efbc3e65a_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<br /></div>
<div class="messageMeta" style="color: #141414; font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 11px; margin: -5px; overflow: hidden; padding: 15px 5px 5px; zoom: 1;">
<b style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; margin-top: 0px;"><span style="font-size: medium;">XUẤT FILE GERBER</span></b><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">File Gerber là gì?</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Các định dạng tập tin Gerber được sử dụng bởi phần mềm thiết kế board mạch in(PCB) công nghiệp để mô tả hình ảnh board mạch in đồng, mặt nạ hàn, chú thích, lỗ khoan, vv. Các định dạng tập tin Gerber là tiêu chuẩn công nghiệp chuyển đổi hình ảnh board mạch in.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Để tránh những sai sót trong quá trình đi đặt mạch. ( việc nhà sản xuất PCB ko có phần mềm mà bạn đang dùng hay việc nhân viên kỹ thật mở file PCB lên gây ra những thay đổi trong đường mạch. .v..v) . bạn nên xuất re file GERBER, tất cả nhà sản xuất PCB đều có thể nhận file GERBER này !</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">-Để xuất file Gerber chọn : file-> fabrication outputs -> gerber file.</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Tab general: chọn “ inches”, “2:4”</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm8.staticflickr.com/7375/9712304903_8a31394a5c_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">-Tab “layer” , ô “plot layers”, chon “ used on</span><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm6.staticflickr.com/5470/9712309513_5b61df008f_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm4.staticflickr.com/3794/9715543812_ccb3573e0a_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm4.staticflickr.com/3704/9712318099_63f8b37a5d_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><img alt="[IMG]" class="bbCodeImage LbImage" src="http://farm4.staticflickr.com/3753/9712349351_4f2f90531c_o.png" style="background-color: #f6f6f6; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px; max-width: 100%;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><br style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;">Với file Gerber trong tay, email cho nhà sản xuất PCB mà bạn yêu thích và tận hưởng thành quả của chính mình ! </span><img alt=":D" class="mceSmilieSprite mceSmilie8" src="http://vidieukhien.net/styles/default/xenforo/clear.png" style="background-color: #f6f6f6; background-image: url(http://vidieukhien.net/styles/default/xenforo/xenforo-smilies-sprite.png); background-position: -20px 0px; background-repeat: no-repeat no-repeat; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; height: 18px; line-height: 20px; margin: 0px 1px; vertical-align: text-bottom; width: 18px;" title="Big Grin :D" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"> </span><img alt=":D" class="mceSmilieSprite mceSmilie8" src="http://vidieukhien.net/styles/default/xenforo/clear.png" style="background-color: #f6f6f6; background-image: url(http://vidieukhien.net/styles/default/xenforo/xenforo-smilies-sprite.png); background-position: -20px 0px; background-repeat: no-repeat no-repeat; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; height: 18px; line-height: 20px; margin: 0px 1px; vertical-align: text-bottom; width: 18px;" title="Big Grin :D" /><span style="background-color: #f6f6f6; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 20px;"> </span><img alt=":D" class="mceSmilieSprite mceSmilie8" src="http://vidieukhien.net/styles/default/xenforo/clear.png" style="background-color: #f6f6f6; background-image: url(http://vidieukhien.net/styles/default/xenforo/xenforo-smilies-sprite.png); background-position: -20px 0px; background-repeat: no-repeat no-repeat; border: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; height: 18px; line-height: 20px; margin: 0px 1px; vertical-align: text-bottom; width: 18px;" title="Big Grin :D" /></div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com1tag:blogger.com,1999:blog-6417374826664977718.post-74054074316237054272013-12-01T10:34:00.003-08:002013-12-01T10:34:37.147-08:00giới thiệu MSP430<span style="color: #00b050; font-size: medium;">Chương 1 : Giới thiệu qua họ vi điều khiển MSP430G2553.</span><span style="font-size: 18px;"><span style="color: #1f497d;"><span style="font-family: "Times New Roman";">1.Giới thiệu tổng quát :</span></span><br /><span style="color: black;"><span style="font-family: "Times New Roman";">Các dòng vi điều khiển msp430 này do hãng TI ( Texas Instruments) sản xuất, ngoài ra thì TI còn sản xuất và cung cấp nhiều linh kiện điện tử và các module khác , để tìm hiểu thì các bạn có thể tham khảo ở địa chỉ : </span></span><a class="externalLink" href="http://www.ti.com/" rel="nofollow" target="_blank"><span style="font-family: "Times New Roman";">www.ti.com</span></a><span style="color: black;"><span style="font-family: "Times New Roman";"> để biết rõ hơn .<br /> Vi điều khiển( Micro controller unit – MCU ) là đơn vị xử lý nhỏ, nó được tích hợp toàn bộ các bộ nhớ như ROM , RAM , các port truy xuất , giao tiếp ngoại vi trực tiếp trên 1 con chip hết sức nhỏ gọn. Được thiết kế dựa trên cấu trúc </span></span><span style="color: #002060;"><span style="font-family: "Times New Roman";">VON-NEUMAN </span></span><span style="color: black;"><span style="font-family: "Times New Roman";">, đặc điểm của cấu trúc này là chỉ có duy nhất 1 bus giữa CPU và bộ nhớ (data và chương trình) , do đó mà chúng phải có độ rộng bit tương tự nhau.</span></span></span><br /><span style="color: black;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">MSP430 có một số phiênbản như: MSP430x1xx, MSP430x2xx, MSP430x3xx,<br /> MSP430x4xx, MSP430x5xx. Dưới đây là những đặc điểm tổng quát của họ vi điều khiển MSP430:<br /> + Cấu trúc sử dụng nguồn thấp giúp kéo dài tuổi thọ của Pin<br />-Duy trì 0.1µA dòng nuôi RAM.<br />-Chỉ 0.8µA real-time clock.<br />-250 µA/ MIPS.<br /> + Bộ tương tự hiệu suất cao cho các phép đo chính xác<br />-12 bit hoặc 10 bit ADC-200 kskp, cảm biến nhiệt độ, Vref ,<br /> -12 bit DAC.<br />-Bộ giám sát điện áp nguồn.<br /> + 16 bit RISC CPU cho phép được nhiều ứng dụng, thể hiện một phần ở kích thước Code lập trình.<br />-Thanh ghi lớn nên loại trừ được trường hợp tắt nghẽn tập tin khi đang làm việc.<br />-Thiết kế nhỏ gọn làm giảm lượng tiêu thụ điện và giảm giá thành.<br />-Tối ưu hóa cho những chương trình ngôn ngữ bậc cao như C, C++<br />-Có 7 chế độ định địa chỉ.<br />-Khả năng ngắt theo véc tơ lớn.<br /> + Trong lập trình cho bộ nhớ Flash cho phép thay đổi Code một cách linh hoạt, phạm vi rộng, bộ nhớ Flash còn có thể lưu lại như nhật ký của dữ liệu.</span></span></span> <br />
<br />
<br />
<span style="font-size: medium;"><span style="color: #002060;"><span style="font-family: "Times New Roman";">1.Sơ đồ chân : </span></span></span><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Chip MSP430 có kích thước nhỏ gọn , chỉ với 20 chân đối với kiểu chân DIP.<br /> Bao gồm 2 port I/O (hay GPIO general purprose input/ output : cổng nhập xuất chung).</span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;"><img alt="1." class="bbCodeImage LbImage" src="http://codientu.org/attachments/1-png.5564/" /> <br /> Ta thấy rằng mỗi port đều có 8 chân.<br /> Port 1 : có 8 chân từ P1.0 đến P1.7 tương ứng với các chân từ 2-7 và 14 , 15. <br /> Port 2 : cũng gồm có 8 chân P2.0 – P2.7 ứng với các chân 8 – 13 , 18,19.<br /> Ngoài chức năng I/O thì trên mỗi pin của các port đều là những chân đa chức năng, ta thể thấy rõ trong bảng sau : <br /><img alt="2." class="bbCodeImage LbImage" src="http://codientu.org/attachments/2-png.5565/" /> </span></span><br /><span style="font-size: 18px;"><br /></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;"><img alt="3." class="bbCodeImage LbImage" src="http://codientu.org/attachments/3-png.5566/" /> </span></span><br /><span style="font-size: 18px;"><br /></span><br /><span style="color: black;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Trên bảng là chức năng của từng chân , ngoài ra đối với các MCU có kiểu chân SMD loại 28 chân thì nó có thêm port 3 nữa,nhưng ở đây chỉ xét đối với kiểu DIP 20 chân và kiểu TSSOP 20 chân , kiểu còn lại các bạn có thể tìm hiểu trên trang chủ của nhà sản xuất .</span></span></span> <br />
<br />
<br />
<span style="color: #002060;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">2.Giải thích sơ lược các chân : </span></span></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">- Chân số 1 là chân cấp nguồn Vcc( ký hiệu trên chip là DVcc ) , ở đây nguồn cho chip chỉ được cấp ở mức 3,3V , nếu cấp nguốn cao quá mức này thì chip có thể hoạt động sai hay cháy chip . <br />Để có được mức nguồn này thì ta phải dùng 1 IC ổn áp riêng có ký hiệu LM1117 hay AD1117 , IC này có kiểu chân SMD nhỏ gọn , cách mắc chip này thì cũng giống như với những IC nguồn như LM78xx , tuy nhiên lưu ý ở đây là thứ tự chân ở đây có hơi khác 1 chút.Các bạn có thể xem datasheet của IC mà mắc cho phù hợp. <br />-Chân 20 là chân nối cực âm (0V) , chân này thì không có gì đặc biệt. </span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Các bạn có thể tham khảo mạch nguồn ở đây để phục vụ cho việc thiết kế mạch học tập :</span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;"><img alt="4." class="bbCodeImage LbImage" src="http://codientu.org/attachments/4-png.5567/" /> </span></span><br /><span style="font-size: 18px;"><br /></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Trên mạch các bạn có thể thấy là có thêm IC 7805 cấp 5V , với mục đích để sử dụng cho các ngoại vi khác cho ứng dụng của các bạn , mạch trên chỉ giúp các bạn tham khảo, nhưng các bạn yên tâm là mạch này không hề sai , các bạn có thể lấy đúng giá trị như mạch trên . <br />-Chân reset : Chính là chân số 16 RST , nếu các bạn đã từng học về PIC thì sẽ thấy chân reset có ký hiệu là MCLR , các bạn để ý thấy dấu gạch ngang trên có nghĩa là chân này tích cực ở mức thấp . Mục đích của việc reset là nhằm cho chương trình chạy lại từ đầu .</span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Mạch reset cho chip :</span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;"><img alt="5." class="bbCodeImage LbImage" src="http://codientu.org/attachments/5-png.5568/" /> </span></span><br /><span style="font-size: 18px;"><br /><br /> Các bạn chú ý tụ ở đây là tụ pi và chính xác là tụ 102 nha, nếu thay đổi thì khi kết nỗi Jtag để nạp code cho chip sẽ không được.</span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">-Mạch dao động : Cũng giống như những dòng vi điều khiển khác thì Msp430 cũng hỗ trợ người dùng thạch anh ngoài ( external crystal ), nhưng thạch anh ngoại vi cho phép chỉ có thể lên tới 32,768 kHz mà thôi, và tín hiệu này được mắc trên 2 chân 18 và 19. Nhưng msp430 lại hỗ trợ thạch anh nội có thể lên đến 16Mhz, tùy vào cách khai báo trong lập trình. Và mặc định của chip là thạch anh nội. Như vậy thì chúng ta không cần thiết phải sử dụng mạch dao động ngoại cho chip giống như những dòng khác.<br /> - Port I/O : <br /> Port 1 : có 8 chân từ P1.0 đến P1.7 tương ứng với các chân từ 2-7 và 14 , 15. <br /> Port 2 : cũng gồm có 8 chân P2.0 – P2.7 ứng với các chân 8 – 13 , 18,19.<br /> Trong chế độ nhập (input) thì cả 2 port đều có 1 mạch điều khiển điện trở kéo dương – gọi là PULL UP nhưng giá trị của điện trở này rất lớn khoảng 47K nên gọi là WEAK PULL UP RESISTAN. Việc điều khiển PULL UP sẽ được tiến hành thông qua lập trình tác động lên thanh ghi <span style="color: red;">PxREN</span> sẽ được đề cập ở chương sau .</span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Điều này cũng giống như việc thiết lập input ở port B của vi điều khiển PIC, ở port B cũng có điện trở kéo lên , và người lập trình phải thao tác qua thanh ghi OPTION_REG. </span></span><br /><span style="font-size: 18px;"><br /></span><br />
<ul>
<li><span style="color: red;"><span style="font-size: 18px;"><span style="font-family: "Wingdings";">ð</span><span style="font-family: "Times New Roman";">Tóm tắt :</span></span></span></li>
<li><span style="color: blue;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Qua chương này chúng ta phải nắm được các chân cơ bản trước của chip .</span></span></span></li>
<li><span style="color: blue;"><span style="font-size: 18px;"><span style="font-family: "Wingdings";">ð</span><span style="font-family: "Times New Roman";">Mạch reset và mạch dao động OSC của chip .</span></span></span></li>
<li><span style="color: blue;"><span style="font-size: 18px;"><span style="font-family: "Wingdings";">ð</span><span style="font-family: "Times New Roman";">Các chân I/O của 2 port và PULL UP .</span></span></span></li>
</ul>
<span style="color: blue;"><span style="font-size: 18px;"><span style="font-family: "Times New Roman";"><div style="text-align: center;">
<span style="color: red;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Chương 3 : Mạch nạp cho MCU.</span></span></span></div>
<span style="color: #00b050;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">1 . Kit Lanchpad : </span></span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Với bất kỳ 1 con MCU nào thì việc phải thiết kế 1 mạch nạp cho chip là điều không thể bỏ qua ! Và với Msp430 cũng không là ngoại lệ .<br />PIC hay 8051 thì có nhiều mạch nạp để nạp code cho chip , từ đơn giản đến phức tạp , nói chung cực kì đa dạng.Và nói chung thì các mạch nạp cũng đều khá đắt , thấp cũng phải mất 200k hay hơn.<br /> Như đã nói thì Msp430 là dòng value line , power low, và low – cost . Chính vì vậy mà TI đã cung cấp cho người dùng 1 mạch nạp code + debug chỉ trên 1 mạch nhỏ gọn. Trong kit còn có hỗ trợ : </span></span><br /><span style="font-size: 18px;"><span style="font-family: "Times New Roman";">-1 mạch nạp code có cả debug<br />-1 dây cáp USB tốt để kết nối kit với máy tính.<br />-1 chip thạch anh 32,768kHz<br /> -1 chip Msp430G2553 <br /> -1 chip Msp430G2453<br /> -1 header female.</span></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Tất cả chỉ có 9,8 USD – rất rẻ để học!</span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Đây chính là hình ảnh của Kit lanchpad : <br /><img alt="6." class="bbCodeImage LbImage" src="http://codientu.org/attachments/6-png.5569/" /> </span></span><br /><span style="font-size: 18px;"><br /><br /><span style="font-family: "Times New Roman";">Các bạn có thể mua tại địa chỉ sau : </span><a class="externalLink" href="http://hshopvn.com/" rel="nofollow" target="_blank">HShopVN</a></span><br />
<div style="text-align: center;">
</div>
<span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Kit có thể nạp được code cho dòng Msp430G : như msp430g2231, 2553, 2452,…<br />Kit kết nối với máy tính thông qua cổng USB .</span></span> </span><br />
<br />
<div style="text-align: center;">
<span style="color: red;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Chương 4 : Trình biên dịch </span></span></span></div>
<br /><span style="color: #00b050;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Bây giờ chúng ta sẽ tiến hành cài đặt chương trình để có thể tiến hành viết code , biên dịch và nạp code cho chip .</span></span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Không giống như chương trình của các dòng vi điều khiển khác , TI đã cung cấp cho người dùng những IDE đã được tích hợp trong 1 gói phần mềm. Các bạn chỉ cần cài đặt 1 chương trình là đã có thể vừa viết code , debug, và nạp code cho chip.<br /> Chắc nhiều bạn sẽ thắc mắc cụm từ debug có nghĩa là gì? <br /> Debug chỉ là việc cho chương trình chạy từng dòng lệnh để kiểm tra lỗi của chương trình cũng như kiểm tra được cả thanh ghi của chip khi nó thực hiện lệnh .<br /> Có nhiều IDE được TI cung cấp cho người sử dụng , nhưng trong đó có 2 chương trình mạnh và được nhiều người ưa thích đó là CCS và IAR . Các bạn đừng có nhầm lẫn giữa CCS C cho PIC với CCS cho Msp430 nhé! Hai chương trình này là hoàn toàn khác nhau .</span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Sau đây , xin được giới thiệu cụ thể 2 chương trình trên : </span></span><br /><span style="color: #0070c0;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">1 . IAR (IAR Embedded Workbench ) : </span></span></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Đây là chương trình biên dịch được cung cấp bởi IAR SYSTEMS. Có 3 phiên bản: Kickstart Version – Free , Baseline Version ~ $795 và Full Version ~ $2695.</span></span><br /><span style="font-size: 18px;"><span style="font-family: "Times New Roman";">Để tải chương trình , chúng ta có thể vào trang chủ : </span><a class="externalLink" href="http://www.iar.com/" rel="nofollow" target="_blank"><span style="font-family: "Times New Roman";">www.iar.com</span></a><span style="font-family: "Times New Roman";"> hoặc từ địa chỉ của TI : </span><a class="externalLink" href="http://www.ti.com/" rel="nofollow" target="_blank"><span style="font-family: "Times New Roman";">www.ti.com</span></a><span style="font-family: "Times New Roman";"> , sau đó gõ từ IAR trên mục tìm kiếm ,để download được thì các bạn phải tạo 1 tài khoản và đăng nhập để tải về , các bạn chỉ có thể tải được bản trial mà thôi .</span><br /></span><br /><span style="color: #00b0f0;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">2 . CCS (Code composer studio ) : </span></span></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Đây là chương trình do TI cung cấp , có nhiều server đã được cung cấp .<br /> Phiên bản mới nhất hiện nay là CCS 5.3 .</span></span><br /><span style="font-size: 18px;"><span style="font-family: "Times New Roman";">Các bạn có thể tải tại : </span><a class="externalLink" href="http://www.ti.com/" rel="nofollow" target="_blank"><span style="font-family: "Times New Roman";">www.ti.com</span></a></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Đăng nhập vào (sau khi đã đăng ký tài khoản ) , CCS có hỗ trợ cho người dùng bản dùng thử nhưng bị giới hạn code (limited code ) , chúng ta chỉ được sử dụng 4kB bộ nhớ , nhưng với sinh viên chúng ta thì với 4 kB cũng đã đủ làm những dự án nhỏ .</span></span><br /><span style="color: #7030a0;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Chính vì vậy mà tôi khuyên bạn nên tải bản CCS về , và trong tài liệu này cũng sử dụng CCS để viết code . CCS có rất nhiều tính năng hay mà sau này chúng ta sẽ cùng nhau nghiên cứu sau .Việc sử dụng phiên bản nào là tùy thuộc vào các bạn , các version cũng đều giống nhau , nếu CCS 5.3 thì yêu cầu máy của bạn phải có cấu hình đủ mạnh để dùng. </span></span></span><br /><br /><span style="color: #0070c0;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">3 . Cài đặt và sử dụng CCS : </span></span></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Sau khi tải CCS về , các bạn tiến hành cài đặt , cách cài đặt cũng rất đơn giản. Các bạn chỉ cần chạy file setup.exe .<br />Đối với phiên bản CCS 4.3 hay 4.2 thì các bạn cài đặt xong là có thể sử dụng được nhưng với CCS 5.3 thì các bạn còn phải làm 1 việc nữa đó là chọn : limit free code , thì mới viết code được . Cách làm như sau : <br /> Sau khi cài đặt xong, các bạn khởi động chương trình : <br /> Start -> all program -> Texas Instruments -> Chọn code …. <br />Hoặc chạy chương trình bằng cách click vào biểu tượng CCS trên desktop . <br /> Sau đó , click chọn Help -> Code Composer code linsce -> upgrade -> active việc cài đặt và sử dụng cũng như tạo mới 1 project các bạn xem tại mục MSP430 này, đã có gần như đầy đủ các video minh họa việc học lập trình với msp430.</span></span> </span><br />
<br />
<div style="text-align: center;">
<span style="text-decoration: underline;"><span style="color: red;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Phần 2 : Cách lập trình.</span></span></span></span></div>
<br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Phần này , sẽ giới thiệu cho các bạn cách lập trình trên MCU Msp430G2553 .<br /> Ngôn ngữ lập trình ở đây chính là C (Language programing C).Đây là chủ đề chính của tài liệu .</span></span><br /><br />
<div style="text-align: center;">
<span style="color: #0070c0;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Chương 1 : GPIO (General purpose input/ouput ) :</span></span></span></div>
<br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Đây sẽ là chương trình đầu tiên của các bạn , cũng tương tự như khi các bạn mới học C thì đầu tiên chúng ta phải học cách viết chương trình hiển thị dòng chữ “hello word” in ra màn hình .<br />Ở đây chúng ta sẽ tìm hiểu cách viết 1 chương trình đơn giản , để biết cách bật tắt 1 led trên chân P1.0 . Tại sao lại là trên chân P1.0 ? đơn giản là vì trên kit lanchpad đã có sẵn 2 chú led được hàn trên 2 chân là P1.0 và P1.6 .<br /> Cũng giống như chức năng I/O của Pic thì chức năng GPIO cũng chỉ làm 1 việc đơn giản đó là việc xuất ra tín hiệu hay đọc vào tín hiệu . Tín hiệu ở đây hiểu đơn giản là những tín hiệu điện - tín hiệu số . <br />Tín hiệu số (Binary ) tín hiệu này chỉ có 2 trạng thái đó là 1 và 0 .<br /> 1 : Có điện , mức điện áp này bằng với điện áp nguốn cấp cho MCU .</span></span><br /><span style="font-size: 18px;"><span style="font-family: "Times New Roman";">00: không có điện .</span></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">1.Các thanh ghi cần thiết lập : <br /> Msp430 có 2 port nhập xuất đó là :</span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Port1 : Từ chân P1.0 đến P1.7<br /> Port2: 8 chân P2.0 đến P2.7<br />Để biết rõ các chân này trên MCU thì các bạn chịu khó đọc lại chương 1 trong phần 1 . </span></span><br /><span style="font-size: 18px;"><br /><br /><span style="color: #0070c0;"><span style="font-family: "Times New Roman";"><span style="font-family: "Times New Roman";"> a. </span>Thanh ghi PxSEL(x:1 , 2) và PxSEL2(x:1 , 2) : </span></span></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Thanh ghi này qui định chế độ làm việc cho các chân bao gồm</span></span><br /><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">PxSEL và PxSEL2 .<br /><a href="http://codientu.org/attachments/5570/" target="_blank">View attachment 5570</a> <br /> VD: Ta muốn port 1 là GPIO thì ta thực hiện lệnh như sau: <br /> P1SEL = 0;<br /> P1SEL2 = 0 ;<br /> Nếu như muốn chân P1.2 làm chức năng I/O thì khai báo như sau : <br /> P1SEL & = ~0x01 ; // sử dụng lệnh đảo bit , set về mức 0 .<br /> P1SEL2 &= ~0x01;<br /> Lưu ý: Interrupts P1 và P2 sẽ bị vô hiệu hóa khi PxSEL= 1 .</span></span><br /><span style="font-size: 18px;"><span style="color: #0070c0;"><span style="font-family: "Times New Roman";"><span style="font-family: "Times New Roman";"> b. </span>Thanh ghi PxDIR(x:1 , 2)</span></span></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Thanh ghi này qui định loại ngõ vào ra cho các chân (I/O pins)<br /> Mặc định các chân này là input, nên ta chỉ cần set output cho các chân này<br /> VD: P1DIR = 0x01 // chân P1.0 là output.<br /> Mức 1 : ouput ( xuất tín hiệu ) .<br /> Mức 0 : input (đọc tín hiệu về) .</span></span><br /><span style="font-size: 18px;"><br /><span style="color: #0070c0;"><span style="font-family: "Times New Roman";"><span style="font-family: "Times New Roman";">c. </span>Thanh ghi PxREN(x:1 , 2)</span></span></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Thanh ghi này cho phép tắt hoặc mở chế độ pullup/pulldown resistor cho các pins .<br /> Bit = 0 : Tắt chức năng pull up /down (disable).<br /> Bit= 1 : enable pull up/down.</span></span><br /><span style="font-size: 18px;"><span style="color: #0070c0;"><span style="font-family: "Times New Roman";"><span style="font-family: "Times New Roman";"> d. </span>Thanh ghi PxOUT(x: 1 , 2)</span></span></span><br /><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">_Khi ta muốn xuất giá trị cho các chân I/O, ta sẽ đặt giá trị vào các thanh ghi PxOUT . <br /> Bit = 1 : output mức cao. <br /> Bit = 0 : output mức thấp.<br /> _Khi ta config thanh ghi PxREN sang chế độ pullup/pulldown resistor thì<br /> Bit = 1 : Pull up .<br /> Bit = 0 : Pull down .</span></span><br /><br /><span style="color: red;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Lưu ý là ta phải chỉnh P1DIR trước khi xuất giá trị ra ngoài.</span></span></span><br /><span style="font-size: 18px;"><br /></span><br /><span style="color: #002060;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Tóm tắt:<br />Để thực hiện xuất / nhập trên 1 chân (Pin):<br />- Cài đặt đúng giá trị cho thanh ghi PxDIR <br />- Đặt kiểu tín hiệu của pin là GPIO hay các chức năng<br /> khác qua thanh ghi PxSEL<br />- Xuất tín hiệu bằng cách ghi giá trị “0” hoặc “1” vào<br /> port tương ứng (port P1OUT)</span></span></span><br /><br /><span style="color: #002060;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">- Đọc giá trị của chân bằng cách đọc mức logic trên port tương ứng.</span></span></span><br /><span style="font-size: 18px;"><br /></span><br /><span style="color: #002060;"><span style="font-family: "Times New Roman";"><span style="font-size: 18px;">Code mẫu : </span></span></span><br />
<span style="font-size: 18px;"><br /><br />
<div class="bbCodeBlock bbCodeHtml">
<div class="type">
HTML:</div>
<pre>#include <msp430g2231.h >
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR |= 0x01; // Set P1.0 to output direction
P1SEL = 0; // Set P1 GPIO function
P1SEL2 = 0;
while(1)
{
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
_delay_cycles(100); // Đối với CCS
} }
</pre>
</div>
Tạm thời bài viết sẽ tạm dừng tại đây , mình sẽ viết tiếp và sẽ up lên sớm cho mọi người , mong các bạn ủng hộ mình ,hãy thể hiện việc làm của các bạn bằng cách thể hiện việc ấn like nhé!</span> </span><br />
<br />
<br />
<span style="font-size: 18px;">Bài 1 : GPIO tiếp theo . <br /><br /> Bây giờ chúng ta sẽ viết về phần đọc tín hiệu cho msp430 , config chức năng input . <br /><br /> Các bạn lưu ý là trên kit lanchpad của chúng ta đã có sẵn 1 button được mắc vào chân P1.3 , vì vậy chúng ta sẽ tận dụng điều này để viết code , không cần phải lắp mạch để test . <br /> Như đã nói ở phần đầu thì việc thiết lập chế độ input , có tích hợp sẵn 1 mạch điều khiển điện trở kéo dương - pull up , điện trờ tầm 47K , để bật được chức năng này , ta sẽ tác động đến thanh ghi <span style="color: red;">PxREN </span><br /> Code : <br />
<div class="bbCodeBlock bbCodeHtml">
<div class="type">
HTML:</div>
<pre>// BAI 2 : doc button //
#include "msp430.h"
int main (void){
WDTCTL = WDTHOLD + WDTPW ;
P1SEL &= ~(BIT0 + BIT3);
P1SEL2 &= ~(BIT0 + BIT3) ;
P1DIR |= BIT0 ; // P1.0 : OUT
// BIT 3 : INPUT
P1DIR &= ~BIT3 ; // LENH XOA BIT 3
P1OUT |= BIT3 ; //BIT3 = 1
P1REN = BIT3 ; //PULL UP BIT3
while(1) {
if ((P1IN & BIT3)==0) { // se tat khi p1.3 khong co bam nut.
P1OUT |= BIT0 ;
}
else P1OUT &= ~ BIT0 ; // se sang
}
}</pre>
<pre> </pre>
<pre> </pre>
<pre> </pre>
<pre>mẫu code:</pre>
<pre> </pre>
<pre> </pre>
<pre> </pre>
<pre><span style="color: #0000bb;">Code</span><span style="color: #007700;">:</span><span style="color: #ff8000;">#include</span><span style="color: #0000bb;">main</span><span style="color: #007700;">(</span><span style="color: #0000bb;">void</span><span style="color: #007700;">) {</span><span style="color: #0000bb;">WDTCTL </span><span style="color: #007700;">= </span><span style="color: #0000bb;">WDTPW </span><span style="color: #007700;">| </span><span style="color: #0000bb;">WDTHOLD</span><span style="color: #007700;">; </span><span style="color: #ff8000;">// Stop watchdog timer</span><span style="color: #0000bb;">P1DIR </span><span style="color: #007700;">|= </span><span style="color: #0000bb;">0XFF</span><span style="color: #007700;">; </span><span style="color: #ff8000;">// set all the ports as output ports</span><span style="color: #0000bb;">int x </span><span style="color: #007700;">= </span><span style="color: #0000bb;">0X01</span><span style="color: #007700;">;</span><span style="color: #0000bb;">long i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">int j</span><span style="color: #007700;">=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;">int k</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">int l</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;
for(;;)
{</span></pre>
</div>
<div class="bbCodeBlock bbCodeHtml">
</div>
<div class="bbCodeBlock bbCodeHtml">
</div>
<div class="bbCodeBlock bbCodeHtml">
</div>
<div class="bbCodeBlock bbCodeHtml">
<pre><span style="color: #007700;">
for(</span><span style="color: #0000bb;">k</span><span style="color: #007700;">=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;">k</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">5</span><span style="color: #007700;">;</span><span style="color: #0000bb;">k</span><span style="color: #007700;">++){</span><span style="color: #0000bb;">x</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×01</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">j</span><span style="color: #007700;">=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;">j</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">8</span><span style="color: #007700;">;</span><span style="color: #0000bb;">j</span><span style="color: #007700;">++){
</span><span style="color: #0000bb;">P1OUT </span><span style="color: #007700;">= </span><span style="color: #0000bb;">x</span><span style="color: #007700;">;</span><span style="color: #0000bb;">x</span><span style="color: #007700;">*=</span><span style="color: #0000bb;">2</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">10000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{
}
}
}
for(</span><span style="color: #0000bb;">k</span><span style="color: #007700;">=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;">k</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">5</span><span style="color: #007700;">;</span><span style="color: #0000bb;">k</span><span style="color: #007700;">++){</span><span style="color: #0000bb;">x</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×80</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">j</span><span style="color: #007700;">=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;">j</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">8</span><span style="color: #007700;">;</span><span style="color: #0000bb;">j</span><span style="color: #007700;">++){
</span><span style="color: #0000bb;">P1OUT </span><span style="color: #007700;">= </span><span style="color: #0000bb;">x</span><span style="color: #007700;">;</span><span style="color: #0000bb;">x</span><span style="color: #007700;">/=</span><span style="color: #0000bb;">2</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">10000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{
}
}
}
for(</span><span style="color: #0000bb;">k</span><span style="color: #007700;">=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;">k</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">5</span><span style="color: #007700;">;</span><span style="color: #0000bb;">k</span><span style="color: #007700;">++){
</span><span style="color: #0000bb;">P1OUT</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0xAA</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">l</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">l</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;">l</span><span style="color: #007700;">++){
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">64000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{}}</span><span style="color: #0000bb;">P1OUT</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×55</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">l</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">l</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;">l</span><span style="color: #007700;">++){
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">64000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{}}
}
for(</span><span style="color: #0000bb;">k</span><span style="color: #007700;">=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;">k</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">5</span><span style="color: #007700;">;</span><span style="color: #0000bb;">k</span><span style="color: #007700;">++){
</span><span style="color: #0000bb;">P1OUT</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×18</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">20000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{}</span><span style="color: #0000bb;">P1OUT</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×24</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">20000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{}</span><span style="color: #0000bb;">P1OUT</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×42</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">20000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{}</span><span style="color: #0000bb;">P1OUT</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×81</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">20000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{}
}
for(</span><span style="color: #0000bb;">k</span><span style="color: #007700;">=</span><span style="color: #0000bb;">1</span><span style="color: #007700;">;</span><span style="color: #0000bb;">k</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">5</span><span style="color: #007700;">;</span><span style="color: #0000bb;">k</span><span style="color: #007700;">++){
</span><span style="color: #0000bb;">P1OUT</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×81</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">20000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{}</span><span style="color: #0000bb;">P1OUT</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×42</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">20000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{}</span><span style="color: #0000bb;">P1OUT</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×24</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">20000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{}</span><span style="color: #0000bb;">P1OUT</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0×18</span><span style="color: #007700;">;
for(</span><span style="color: #0000bb;">i</span><span style="color: #007700;">=</span><span style="color: #0000bb;">0</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;"><=</span><span style="color: #0000bb;">20000</span><span style="color: #007700;">;</span><span style="color: #0000bb;">i</span><span style="color: #007700;">++)
{}
}
}
}</span> </pre>
<pre> </pre>
<pre> </pre>
<pre> </pre>
<pre> </pre>
<pre> </pre>
<pre> </pre>
<pre> </pre>
<pre><span style="font-size: 22px;"><span style="color: red;"><b>Chương 2 : Basic Clocks</b></span></span>
Phần này có thể hơi khó hiểu, nhưng các bạn cứ đọc kỹ trước, rồi sau này sẽ hiểu dần dần sau .
Chế độ clock được cung cấp trong tất cả các dòng MCUs Msp430 của TI .Trong chương này sẽ giúp các bạn hiểu rõ về hoạt động các xung clocks cơ bản của msp430.
<b>1. <span style="color: #ff4d4d;">Giới thiệu về clock :</span></b>
Việc config xung clocks là vô cùng cần thiết đối với bất kỳ 1 con MCUs nào, có xung clock thì con mcu của chúng ta mới có thể hoạt động đúng được .
Chúng ta có thể hiểu xung clocks chính là trái tim của 1 hệ thống xử lý số, và tốc độ xử lý lệnh phụ thuộc hoàn toàn vào nguồn xung .
Vấn đề là làm sao chúng ta có thể thiết lập xung clocks này hoạt động .Chúng ta có thể có nhiều cách làm việc đó . Với dòng msp430 này thì nó 3 loại xung cơ bản như sau :
<span style="color: #80ff00;">- Internal Oscillators
- External Crystals
- External Oscillators</span>
<span style="color: #0000b3;">2. Internal/External Oscillators :</span>
<b><span style="color: #b300b3;">a. Internal :</span></b>
Đây là nguồn dao động có sẵn bên trong chip , thông thường sử dụng các mạch RC được tích hợp sẵn với các hệ mạch .
- Lợi ích của nguồn này đó là việc chúng ta có thể dễ dàng thay đổi được tần số hoạt động mà không cần phải sử dụng các linh kiện ngoại – làm chiếm diện tích board .
- Trên chip Msp430 đã có sẵn nguồn xung DCO (Digitally Controller Oscillator) hỗ trợ tốc độ cao .
<span style="color: #b300b3;"><b>b. External :</b></span>
Khác với những dòng vi điều khiển khác thì dòng Msp430 chỉ có thể hỗ trợ thạch anh có tần số lên đến 32.768khz ,việc sử dụng thạch anh ngoại nhằm đáp ứng nhu cầu về ứng dụng cần chạy thời gian thực và cần sự chính xác cao .
Chính vì vậy mà chúng ta nên hạn chế sử dụng nếu có thể được , 1 mặt giảm việc thi công mạch in .
<img alt="osc." class="bbCodeImage LbImage" src="http://codientu.org/attachments/osc-png.13189/" />
Hình ảnh chỉ mang tính minh họa .
Trong chương này , chúng ta sẽ nghiên cứu chi tiết việc thiết lập nguồn xung nội ,như vậy sẽ đơn giản cho việc thiết kế phần cứng .Và nguồn xung nội hỗ trờ dải tần làm việc tử 400-kHz to 16-MHz .
<span style="color: #4d4dff;"><b>3. Mode trong xung nội : </b></span>
Trong nguồn xung nội thì chúng ta có tối đa là 4 mode chế độ hoạt động , các mode này lần lượt là :
<b>LFXT1CLK : Low-frequency/high-frequency oscillator</b>
Module dao động hỗ trợ tần số thấp / cao , có thể được dung cho ứng dụng với bộ theo dõi tần số thấp thạch anh 32.768khz , hoặc từ các nguồn xung khác có tần số từ 400khz đến 16Mhz .
<b>XT2CLK: Optional high-frequency oscillator .</b>
Module lựa chọn làm việc ở tần số cao .
<b>DCOCLK: Internal digitally controlled oscillator (DCO).</b>
Bộ dao động số được tích hợp sẵn trong chip, khi làm việc nếu không có thiết lập gì về nguồn xung thì msp430 sẽ hoạt động dưa trên bộ DCO này .
<b>VLOCLK: Internal very low power, low frequency oscillator with 12-kHz typical frequency</b>
Module tích hợp , đây là mode hoạt động siêu tiết kiệm năng lượng .
Sơ đồ khối clocks :
<img alt="basic clocks." class="bbCodeImage LbImage" src="http://codientu.org/attachments/basic-clocks-png.13190/" />
</pre>
</div>
</span>PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com2tag:blogger.com,1999:blog-6417374826664977718.post-68284026354343481032013-11-26T21:43:00.000-08:002013-11-26T21:43:05.672-08:00Bộ đếm/ bộ định thời trong 8051<h3 align="left" id="sites-page-title-header" style="font-family: Arial, Verdana, sans-serif; font-size: 22px; margin: 0px; padding: 3px 10px;" xmlns="http://www.w3.org/1999/xhtml">
<span dir="ltr" id="sites-page-title">Bộ đếm/ bộ định thời trong 8051</span></h3>
<div class="sites-canvas-main" id="sites-canvas-main" style="background-color: white; font-family: Arial, Verdana, sans-serif; font-size: 13px; min-height: 150px; padding-bottom: 5px; padding-top: 15px;">
<div id="sites-canvas-main-content">
<table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox" style="margin: 0px; table-layout: fixed; width: 776px;" xmlns="http://www.w3.org/1999/xhtml"><tbody>
<tr><td class="sites-layout-tile sites-tile-name-content-1" style="padding: 10px; vertical-align: top;"><div dir="ltr">
<br /><div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bộ đếm, bộ định thời là gì?</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Các thanh ghi liên quan</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Cách thức hoạt động của bộ đếm/bộ định thời</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Các bước lập trình bộ đếm/bộ định thời</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Giới thiệu</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bộ đếm/Bộ định thời: Đây là các ngoại vi được thiết kế để thực hiện một nhiệm vụ đơn giản: đếm các xung nhịp. Mỗi khi có thêm một xung nhịp tại đầu vào đếm thì giá trị của bộ đếm sẽ được tăng lên 01 đơn vị (trong chế độ đếm tiến/đếm lên) hay giảm đi 01 đơn vị (trong chế độ đếm lùi/đếm xuống).</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Xung nhịp đưa vào đếm có thể là một trong hai loại:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Xung nhịp bên trong IC: Đó là xung nhịp được tạo ra nhờ kết hợp mạch dao động bên trong IC và các linh kiện phụ bên ngoài nối với IC. Trong trường hợp sử dụng xung nhịp loại này, người ta gọi là các <b>bộ định thời</b> (<b>timers</b>). Do xung nhịp bên loại này thường đều đặn nên ta có thể dùng để <b>đếm thời gian</b> một cách khá chính xác.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Xung nhịp bên ngoài IC: Đó là các tín hiệu logic thay đổi liên tục giữa 02 mức 0-1 và không nhất thiết phải là đều đặn. Trong trường hợp này người ta gọi là các <b>bộ đếm</b> (<b>counters</b>). Ứng dụng phổ biến của các bộ đếm là <b>đếm các sự kiện bên ngoài</b> như đếm các sản phầm chạy trên băng chuyền, đếm xe ra/vào kho bãi…</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.25in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Một khái niệm quan trọng cần phải nói đến là sự kiện “<b>tràn</b>” (<b>overflow</b>). Nó được hiểu là sự kiện bộ đếm đếm vượt quá giá trị tối đa mà nó có thể biểu diễn và quay trở về giá trị 0. Với bộ đếm 8 bit, giá trị tối đa là 255 (tương đương với FF trong hệ Hexa) và là 65535 (FFFFH) với bộ đếm 16 bit.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> 8051 có 02 bộ đếm/bộ định thời. Chúng có thể được dùng như các <b>bộ định thời</b>để tạo một bộ trễ thời gian hoặc như các <b>bộ đếm</b> để đếm các sự kiện xảy ra bên ngoài bộ VĐK. Trong bài này chúng ta sẽ tìm hiểu về cách lập trình cho chúng và sử dụng chúng như thế nào. Phần <b>1</b> là Lập trình bộ định thời, và phần <b>2</b> là Lập trình cho bộ đếm.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1. Các bộ định thời của 8051</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> 8051 có hai bộ định thời là <b>Timer 0</b> và <b>Timer 1</b>, ở phần này chúng ta bàn về các thanh ghi của chúng và sau đó trình bày cách lập trình chúng như thế nào để tạo ra các độ trễ thời gian.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.1 Các thanh ghi cơ sở của bộ định thời</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Cả hai bộ định thời <b>Timer 0</b> và <b>Timer 1</b> đều có độ dài <b>16 bit</b> được truy cập như hai thanh ghi tách biệt <b>byte thấp</b> và <b>byte cao</b>. Chúng ta sẽ bàn riêng về từng thanh ghi.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.1.1 Các thanh ghi của bộ Timer 0</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Thanh ghi 16 bit của bộ <b>Timer 0</b> được truy cập như byte thấp và byte cao:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Thanh ghi byte thấp được gọi là <b>TL0</b> (Timer0 Low byte).</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Thanh ghi byte cao được gọi là <b>TH0</b> (Timer0 High byte).</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in; text-align: justify; text-indent: 0.25in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Các thanh ghi này có thể được truy cập, hoặc được đọc như mọi thanh ghi khác chẳng hạn như A, B, R0, R1, R2 v.v...</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in; text-align: justify; text-indent: 0.25in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"><br /></span></div>
<div style="clear: both; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<a href="http://www.dientumaytinh.com/2012/07/hoc-lap-trinh-8051-bo-em-bo-inh-thoi.html" rel="nofollow" style="color: #3ba8bd; outline: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2lETzbT11Bly0EyFaxyyKdpxvq3ntdlFX69P0KLlYGqN7Tp4TLbVRtJCmedy4Kmx0nMel2GomCKD1YGEAg14BGKdy7nerRb0-Qrxot2B9ioJGjkiRLsh-TuHwwFb5snltjc-0xn4ZiwVl/s1600/hoc+lap+trinh+8051.hinh1.jpg" style="background-color: transparent; border: 0px none; padding: 0px;" /></a></div>
<div style="clear: both; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<br /></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center; text-indent: 0.5in;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Hình 1:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Các thanh ghi của bộ Timer 0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<br /><a href="" name="more" style="color: #0052b4;"></a></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.1.2 Các thanh ghi của bộ Timer 1</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Giống như <b>timer 0</b>, bộ định thời gian <b>Timer 1</b> cũng dài 16 bit và thanh ghi 16 bit của nó cũng được chia ra thành hai byte là <b>TL1</b> và <b>TH1</b>. Các thanh ghi này được truy cập và đọc giống như các thanh ghi của bộ Timer 0 ở trên.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"><br /></span></div>
<div style="clear: both; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<a href="http://www.dientumaytinh.com/2012/07/hoc-lap-trinh-8051-bo-em-bo-inh-thoi.html" rel="nofollow" style="color: #3ba8bd; outline: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn5NGIkI_AyB6M4POuhyphenhyphen3uJEzVzTgWrWeAOTAPFQqn5Vz3I16_UMbyZfN-UIPXnHvzFh9bdOpyXFh31SPC6LZcMdqZKt8u5MnjsQbRpt9zPUeYVs6pH8qktRqmzyaZp9YeEJyqpYZxFpc0/s1600/hoc+lap+trinh+8051.hinh2.jpg" style="background-color: transparent; border: 0px none; padding: 0px;" /></a></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"><br /></span></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center; text-indent: 0.5in;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Hình 2: </span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Các thanh ghi của bộ Timer 1.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.1.3 Thanh ghi TMOD</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Cả hai bộ định thời <b>Timer 0</b> và <b>Timer 1</b> đều dùng chung một thanh ghi được gọi là <b>TMOD:</b> để thiết lập các <b>chế độ làm việc khác nhau của bộ định thời</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Thanh ghi <b>TMOD</b> <b>là thanh ghi 8 bit</b> gồm có:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">4 bit thấp để thiết lập cho bộ <b>Timer 0</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">4 bit cao để thiết lập cho <b>Timer 1</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Trong đó:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2 bit thấp của chúng dùng để thiết lập chế độ của bộ định thời.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2 bit cao dùng để xác định phép toán.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<br /></div>
<div style="clear: both; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<a href="http://www.dientumaytinh.com/2012/07/hoc-lap-trinh-8051-bo-em-bo-inh-thoi.html" rel="nofollow" style="color: #3ba8bd; outline: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvtwQchjeB4UIr-ukqT2N3S4sFk8-DwrrhFDTnAl33qh6N9dzN74U6mhHS5Z0D-2waGIgNNK2sJdHi7LMGp6HZexH-6z1uJCuD3rabCG7srlP9g3csnPBSGoOp76STPAhVqjEX9lZuKJt6/s1600/hoc+lap+trinh+8051.hinh3.jpg" style="background-color: transparent; border: 0px none; padding: 0px;" /></a></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> </span><b style="text-align: center; text-indent: 0.5in;"><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> </span></b></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center; text-indent: 0.5in;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Hình 3:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Thanh ghi TMOD.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.1.3.1 Các bit M1, M0</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Là các <b>bit chế độ</b> của các bộ Timer 0 và Timer 1. Chúng chọn <b>chế độ</b> của các bộ định thời: <b>0</b>, <b>1</b>, <b>2</b> và <b>3</b> như <b>bảng dưới</b>. Chúng ta chỉ tập chung vào các chế độ thường được sử dụng rộng rãi nhất là <b>chế độ 1 </b>và <b>chế độ</b> <b>2</b>. Chúng ta sẽ sớm khám phá ra các đặc tính của các chế độ này sau khi khám phần còn lại của thanh ghi <b>TMOD</b>. Các chế độ được thiết lập theo trạng thái của <b>M1</b> và <b>M0</b> như sau:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: none; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin: 0px 0px 20px 5.4pt; width: 604px;"><tbody>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 33pt;" width="44"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">M1</span></b></div>
</td><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 33pt;" width="44"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">M0</span></b></div>
</td><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 52.25pt;" width="70"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chế độ</span></b></div>
</td><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 346.5pt;" width="462"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chế độ hoạt động</span></b></div>
</td></tr>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 33pt;" width="44"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">0</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 33pt;" width="44"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">0</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 52.25pt;" width="70"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">0</span></b></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 346.5pt;" valign="top" width="462"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bộ định thời 13 bit:8 bit là bộ định thời/bộ đếm, 5 bit đặt trước.</span></div>
</td></tr>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 33pt;" width="44"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">0</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 33pt;" width="44"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">1</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 52.25pt;" width="70"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1</span></b></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 346.5pt;" valign="top" width="462"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bộ định thời 16 bit: không có đặt trước.</span></div>
</td></tr>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 33pt;" width="44"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">1</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 33pt;" width="44"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">0</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 52.25pt;" width="70"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2</span></b></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 346.5pt;" valign="top" width="462"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bộ định thời 8 bit: tự nạp lại.</span></div>
</td></tr>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 33pt;" width="44"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">1</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 33pt;" width="44"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">1</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 52.25pt;" width="70"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">3</span></b></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 346.5pt;" valign="top" width="462"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chế độ bộ định thời chia tách.</span></div>
</td></tr>
</tbody></table>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bảng 1: </span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Các chế độ hoạt động của bộ đếm/bộ định thời</span></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.1.3.2 Bit C/T </span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">(Counter/Timer)</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Bit này trong thanh ghi <b>TMOD</b> được dùng để quyết định xem bộ định thời được dùng như một máy <b>tạo độ trễ</b> hay <b>bộ đếm</b> sự kiện. Nếu bit <b>C/T = 0</b> thì nó được dùng như một <b>bộ định thời tạo độ trễ </b>thời gian.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ví dụ 1:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">TMOD = 0000 0001 (01H) : chế độ 1 của bộ định thời Timer 0 được chọn.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">TMOD = 0010 0000 (20H) : chế độ 2 của bộ định thời Timer 1 được chọn.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">TMOD = 0001 0010 (12H) : chế độ 1 của bộ định thời Timer 1 và chế độ 2 của Timer 0 được chọn.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Nguồn đồng hồ cho chế độ trễ thời gian là tần số thạch anh của 8051. Điều đó có nghĩa là độ lớn của tần số thạch anh đi kèm với 8051 quyết định tốc độ nhịp của các bộ định thời trên 8051. <b>Tần số của bộ định thời luôn bằng 1/12 tần số của thạch anh</b> gắn với 8051.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="clear: both; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<a href="http://www.dientumaytinh.com/2012/07/hoc-lap-trinh-8051-bo-em-bo-inh-thoi.html" rel="nofollow" style="color: #3ba8bd; outline: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY394TWIwDgm3NmXXuODO91LXeJYEe2NFRiBDzqAvXcJTSIE9bRFpC-xRvn4xGzhuapJVyDArGYsuyPYKTboXBHsYxWmexMkX-bAJOmtMbT1TAJVetoLQrcOQxLq1BrvA-FsgF09LB4deW/s1600/hoc+lap+trinh+8051.hinh4.jpg" style="background-color: transparent; border: 0px none; padding: 0px;" /></a></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"><br /></span></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Hình 4:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Tần số của bộ đếm/bộ định thời</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ví dụ 2:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: none; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin: 0px 0px 20px; width: 604px;"><tbody>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 113.4pt;" width="151"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Tần số thạch anh</span></b></div>
</td><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 2.75in;" width="264"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Tần số bộ định thời</span></b></div>
</td><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 164pt;" width="219"><div align="center" style="text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chu kỳ bộ định thời</span></b></div>
</td></tr>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 113.4pt;" width="151"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">20MHz</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 2.75in;" width="264"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">20MHz/12=1,6666MHz</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 164pt;" width="219"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">1/1,6666MHz=0,6us</span></div>
</td></tr>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 113.4pt;" width="151"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">12MHz</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 2.75in;" width="264"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">12MHz/12=1MHz</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 164pt;" width="219"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">1/1MHz=1us</span></div>
</td></tr>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 113.4pt;" width="151"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">11,0592MHz</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 2.75in;" width="264"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">11,0592MHz/12=0,9216MHz</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 164pt;" width="219"><div align="center" style="text-align: center;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">1/0,9216MHz=1,085us</span></div>
</td></tr>
</tbody></table>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bảng 2:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Một số tần số thông dụng</span></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Mặc dù các hệ thống 8051 có thể sử dụng tần số thạch anh từ 10 đến 40MHz, song ta chỉ tập trung vào tần số thạch anh <b>11,0592MHz</b>. Lý do đằng sau một số lẻ như vậy là tốc độ baud đối với truyền thông nối tiếp của 8051. Tần số XTAL = 11,0592MHz cho phép hệ thống 8051 truyền thông với PC mà không có lỗi.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.1.3.3 Bit cổng GATE</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Một bit khác của thanh ghi <b>TMOD</b> là bit cổng <b>GATE</b>. Để ý trên <b>hình 3</b> ta thấy cả hai bộ định thời Timer0 và Timer1 đều có bit <b>GATE</b>. Vậy bit <b>GATE</b> dùng để làm gì? Mỗi bộ định thời thực hiện điểm khởi động và dừng. Một số bộ định thời thực hiện điều này bằng phần mềm, một số khác bằng phần cứng và một số khác vừa bằng phần cứng vừa bằng phần mềm. Các bộ định thời trên 8051 có cả hai:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Việc <b>khởi động</b> và <b>dừng</b> bộ định thời được khởi động bằng phần mềm bởi các<b>bit khởi động bộ định thời TR</b> là <b>TR0 và TR1</b>. Điều này có được nhờ các lệnh Set bit <b>TR0</b> lên <b>1</b> (khởi động bộ định thời) hoặc Clear bit <b>TR0</b> (dừng bộ định thời) đối với <b>Timer 0</b>, và tương tự <b>TR1</b> đối với <b>Timer 1</b>. <b>Các lệnh này có tác dụng khi bit GATE = 0</b> trong thanh ghi <b>TMOD</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Việc khởi động và ngừng bộ định thời bằng <b>phần cứng từ nguồn ngoài</b> bằng cách đặt bit <b>GATE = 1</b> trong thanh ghi <b>TMOD</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Tuy nhiên, để tránh sự lẫn lộn ngay từ bây giờ ta đặt <b>GATE = 0</b> có nghĩa là không cần khởi động và dừng các bộ định thời bằng phần cứng từ bên ngoài.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ví dụ 3:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">TMOD = 0000 0010: Bộ định thời là Timer0, chế độ 2, C/T = 0 dùng nguồn XTAL, GATE = 0 dùng phần mềm để khởi động và dừng bộ định thời.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Như vậy, bây giờ chúng ta đã có hiểu biết cơ bản về vai trò của thanh ghi <b>TMOD</b>, chúng ta sẽ xét từng chế độ của bộ định thời và cách chúng được lập trình như thế nào để tạo ra một độ trễ thời gian.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.2 Lập trình cho chế độ 1</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Dưới đây là những bước hoạt động của timer ở chế độ 1:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Đây là bộ định thời <b>16 bit</b>, do vậy nó cho phép các giá trị <b>0000</b> đến <b>FFFFH</b>được nạp vào các thanh ghi <b>TL</b> và <b>TH</b> của bộ định thời.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Sau khi <b>TL</b> và <b>TH</b> được nạp một giá trị khởi tạo 16 bit thì bộ định thời phải được <b>khởi động</b>. Điều này được thực hiện bởi việc SET bit <b>TR0</b> đối với<b>Timer 0</b> và SET bit <b>TR1</b> đối với <b>Timer 1</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Sau khi bộ định thời được khởi động, nó bắt đầu đếm lên. Nó đếm lên cho đến khi đạt được giới hạn <b>FFFFH</b> của nó. Sau đó, khi nó quay từ <b>FFFFH</b> về <b>0000</b>thì nó bật lên bit cờ <b>TF</b> được gọi là <b>cờ bộ định thời</b>. Cờ bộ định thời này có thể được hiển thị. Khi cờ bộ định thời này được thiết lập, <b>để dừng bộ định thời:</b> ta thực hiện xóa các bit <b>TR0</b> đối với <b>Timer 0</b> hoặc <b>TR1</b> đối với <b>Timer 1</b>. Ở đây cũng cần phải nhắc lại là đối với mỗi bộ định thời đều có cờ <b>TF</b> riêng của mình: <b>TF0</b> đối với <b>Timer 0</b> và <b>TF1</b> đối với <b>Timer 1</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Sau khi bộ định thời đạt được giới hạn của nó là giá trị <b>FFFFH</b>, muốn lặp lại quá trình thì các thanh ghi <b>TH</b> và <b>TL</b> phải được nạp lại với giá trị ban đầu và cờ<b>TF</b> phải được xóa về 0.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"><br /></span></div>
<div style="clear: both; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<a href="http://www.dientumaytinh.com/2012/07/hoc-lap-trinh-8051-bo-em-bo-inh-thoi.html" rel="nofollow" style="color: #3ba8bd; outline: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7THqkFYzXCkdYC6j3DkaQyKpZsVz4b7skJGWDcZzuSE3I-QvGBDPm6vYkhdezTjL9JM-K7xb2ne2q-OnMgTJLi5uEeFkec6PP_PR57Y9-yGC834V5T_FmL7Vd9jRG9xQQznn5pPLI25WF/s1600/hoc+lap+trinh+8051.hinh5.jpg" style="background-color: transparent; border: 0px none; padding: 0px;" /></a></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Hình 5:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Timer/counter chế độ 1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.2.1 Các bước lập trình ở chế độ 1</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Để tạo ra một độ trễ thời gian dùng chế độ 1 của bộ định thời thì cần phải thực hiện các bước dưới đây:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Nạp giá trị <b>TMOD</b> cho thanh ghi báo độ định thời nào (Timer0 hay Timer1) được sử dụng và chế độ nào được chọn.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Nạp các thanh ghi <b>TL</b> và <b>TH</b> với các giá trị đếm ban đầu.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">3.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Khởi động</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> bộ định thời.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">4.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Duy trì kiểm tra cờ</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> bộ định thời <b>TF</b> bằng một vòng lặp để xem nó được bật lên 1 không. Thoát vòng lặp khi <b>TF</b> được lên cao.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">5.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Dừng</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> bộ định thời.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">6.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Xoá cờ TF</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> cho vòng kế tiếp.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">7.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Quay trở lại bước 2 để <b>nạp lại TL và TH</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Công thức tính toán độ trễ sử dụng <b>chế độ</b> <b>1</b> (16 bit) của bộ định thời đối với tần số thạch anh XTAL = f (MHz):</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: none; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin: 0px 0px 20px 5.4pt; width: 604px;"><tbody>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 232.3pt;" valign="top" width="310"><div style="text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">a) Tính theo số Hex</span></b></div>
</td><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 232.45pt;" valign="top" width="310"><div style="text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">b) Tính theo số thập phân</span></b></div>
</td></tr>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 232.3pt;" valign="top" width="310"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">(FFFF - YYXX + 1)*12/f (</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s) trong đó YYXX là các giá trị khởi tạo của TH, TL tương ứng. Lưu ý rằng các giá trị YYXX là theo số Hex.</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 232.45pt;" valign="top" width="310"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chuyển đổi các giá trị YYXX của TH, TL về số thập phân để nhận một số thập phân NNNNN sau đó lấy (65536 – NNNNN)*12/f (</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s).</span></div>
</td></tr>
</tbody></table>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bảng 3:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Công thức tính độ trễ thời gian theo tần số XTAL (f)</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ví dụ 4:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Trong chương trình dưới đây ta tạo ra một sóng vuông với độ đầy xung 50% (cùng tỷ lệ giữa phần cao và phần thấp) trên chân P1.5. Bộ định thời Timer0 được dùng để tạo độ trễ thời gian:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">#include<at89x51.h> //khai báo thư viện cho VĐK 89x51</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">void delay(void); //khi báo nguyên mẫu hàm con tạo trễ</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">main()</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">{</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> P1_5=1; //khởi tạo chân P1_5 ở mức cao</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> while(1) //vòng lặp vô hạn</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> {</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> delay(); //chương trình con tạo trễ</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> P1_5=~P1_5; //đảo tín hiệu chân P1_5</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> }</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">}</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">void delay(void) //định nghĩa hàm delay</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">{</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TMOD=0x01; //chọn timer0, chế độ 1, 16Bit</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TL0=0xF2; //nạp giá trị cho TL0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TH0=0xFF; //nạp giá trị cho TH0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TR0=1; //khởi động timer0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> while(!TF0){} //vòng lặp kiểm tra cờ TF0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TR0=0; //ngừng timer0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TF0=0; //xóa cờ TF0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">}</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Trong chương trình chính (hàm main) thực hiện gọi hàm con <span style="color: #0070c0;">delay()</span> tạo trễ, và đảo liên tục tín hiệu đầu ra ở chân P1_5.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Trong chương trình con <span style="color: #0070c0;">delay()</span> trên đây chú ý các bước sau:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">TMOD được nạp.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Giá trị FFF2H được nạp và TH0 - TL0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">3.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bộ định thời Timer0 được khởi động bởi lệnh Set bit TR0.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">4.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bộ Timer0 đếm lên 01 sau mỗi chu kỳ của timer. Khi bộ định thời đếm tăng qua các trạng thái FFF3, FFF4 ... cho đến khi đạt giá trị FFFFH là nó quay về 0000H và bật cờ bộ định thời TF0 = 1. Tại thời điểm này vòng lặp kiểm tra cờ TF0 mới được thoát ra.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">5.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bộ Timer0 được dừng bởi lệnh clear bit TR0.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">6.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Cờ TF0 cũng được xóa, sẵn sàng cho chu trình tiếp theo.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.25in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Lưu ý rằng để lặp lại quá trình trên ta phải nạp lại các thanh ghi TH và TL và khởi động lại bộ định thời (đơn giản là ta gọi lại hàm delay()).</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.25in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"><br /></span></div>
<div style="clear: both; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<a href="http://www.dientumaytinh.com/2012/07/hoc-lap-trinh-8051-bo-em-bo-inh-thoi.html" rel="nofollow" style="color: #3ba8bd; outline: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmWYbf6Oo1-kzCJRguicNhavpWKhBzhZbxs7txJwm770mld7ZTvKNPnrlAdKcmGXmgTbU85Hm9RC9ClOVR9B9woNlKmoEfBZRimWanN0k0uvbQ0xMVUEri2TEuz4ICtRImBKFQsRZHME_A/s1600/hoc+lap+trinh+8051.hinh6.jpg" style="background-color: transparent; border: 0px none; padding: 0px;" /></a></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Hình 6:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Một chu trình đếm của timer0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Tính toán độ trễ tạo ra bởi bộ định thời ở chương trình trên với tần số XTAL=11,0592MHz:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Bộ định thời làm việc với tần số đồng hồ bằng 1/12 tần số XTAL, do vậy ta có 11,0592MHz/12=0,9216MHz là tần số của bộ định thời. Kết quả là mỗi nhịp xung đồng hồ có chu kỳ T=1/0,9216MHz=1,085us. Hay nói cách khác, bộ Timer0 tăng 01 đơn vị sau 1,085</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s để tạo ra bộ trễ bằng số_đếm</span><span style="font-family: Symbol; font-size: 13pt;">´</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1,085</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Số đếm bằng FFFFH - FFF2H = ODH (13 theo số thập phân). Tuy nhiên, ta phải cộng 1 vào 13 vì cần thêm một nhịp đồng hồ để nó quay từ FFFFH về 0000H và bật cờ TF. Do vậy, ta có 14 </span><span style="font-family: Symbol; font-size: 13pt;">´</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> 1,085</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s = 15,19</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s cho nửa chu kỳ và cả chu kỳ là T = 2 </span><span style="font-family: Symbol; font-size: 13pt;">´</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> 15,19</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s = 30, 38</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s là thời gian trễ được tạo ra bởi bộ định thời.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Tuy nhiên, trong tính toán độ trễ ở trên ta đã không tính đến tổng phí các lệnh cài đặt timer0, các lệnh kiểm tra trong vòng lặp, gọi hàm con… Chính các câu lệnh này làm cho độ trễ dài hơn, dẫn đến tần số của xung vuông ở đầu ra P1_5 không còn đúng như tính toán ở trên. Đây là nhược điểm của C trong lập trình VĐK. Tùy vào từng chương trình biên dịch, mỗi lệnh của C sẽ được biên dịch ra số lệnh ASM khác nhau, để tính toán chính xác ta phải tính cả tổng phí từng dòng lệnh ASM.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.2.2 Tìm các giá trị cần được nạp vào bộ định thời</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Giả sử rằng chúng ta biết lượng <b>thời gian trễ</b> mà ta cần thì câu hỏi đặt ra là làm thế nào để tìm ra được các <b>giá trị</b> cần thiết cho các thanh thi <b>TH</b> và <b>TL</b>. Để tính toán các giá trị cần được nạp vào các thanh ghi TH và TL chúng ta hãy nhìn vào ví dụ sau với việc sử dụng tần số dao động XTAL = 11. 0592MHz đối với hệ thống 8051.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Các bước để tìm các giá trị của các thanh ghi <b>TH</b> và <b>TL</b>:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chia thời gian trễ cần thiết cho 1.085</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Thực hiện 65536 - n với n là giá trị thập phân nhận được từ bước 1.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">3.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chuyển đổi kết quả ở bước 2 sang số Hex: ta có YYXX là giá trị Hexa ban đầu cần phải nạp vào các thanh ghi bộ định thời.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">4.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Đặt TL = XX và TH = YY.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ví dụ 5:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Giả sử tần số XTAL = 11.0592MHz. Hãy tìm các giá trị cần được nạp vào các thanh ghi vào các thanh ghi TH và TL nếu ta muốn độ thời gian trễ là 5ms.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Lời giải:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Vì tần số XTAL = 11.0592MHz nên bộ đếm tăng sau mỗi chu kỳ 1.085</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s. Điều đó có nghĩa là phải mất rất nhiều khoảng thời gian 1,085</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s để có được một xung 5ms. Để có được ta chia 5ms cho 1.085</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s và nhận được số n = 4608 nhịp. Để nhận được giá trị cần được nạp vào TL và TH thì ta tiến hành lấy 65536 trừ đi 4608 bằng 60928. Ta đổi số này ra số hex thành EE00H. Do vậy, giá trị nạp vào TH là EE Và TL là 00.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">void delay(void) //định nghĩa hàm delay</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">{</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TMOD=0x01; //chọn timer0 chế độ 1 16Bit</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TL0=0x00; //nạp giá trị cho TL0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TH0=0xEE; //nạp giá trị cho TH0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TR0=1; //khởi động timer0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> while(!TF0){} //vòng lặp kiểm tra cờ TF0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TR0=0; //ngừng timer0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TF0=0; //xóa cờ TF0</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">}</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ví dụ 6:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Giả sử ta có tần số XTAL là 11,0592MHz. Hãy tìm các giá trị cần được nạp vào các thanh ghi TH và TL để tạo ra một sóng vuông tần số 2kHz.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.25in;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Xét các bước sau:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.25in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1. T = 1/f = 1/2KHz = 500us là chu kỳ của sóng vuông.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2. Khoảng thời gian phần cao và phần thấp là: T/2 = 250</span><span style="font-family: Symbol; font-size: 13pt;">m</span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">s.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">3.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Số nhịp cần trong thời gian đó là:250us/1,085us = 230. Giá trị cần nạp vào các thanh ghi cần tìm là 65536 - 230 = 65306 và ở dạng hex là FF1AH.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">4.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Giá trị nạp vào TL là 1AH, TH là FFH.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chương trình cần viết là:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">void delay(void) //định nghĩa hàm delay</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">{</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TMOD=0x10; //chọn timer1 chế độ 1 16Bit</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TL1=0x1A; //nạp giá trị cho TL1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TH1=0xFF; //nạp giá trị cho TH1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TR1=1; //khởi động timer1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> while(!TF1){} //vòng lặp kiểm tra cờ TF1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TR1=0; //ngừng timer1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TF1=0; //xóa cờ TF1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">}</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.3 Chế độ 0</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> <b>Chế độ 0</b> hoàn toàn giống chế độ 1 chỉ khác là bộ định thời 16 bit được thay bằng<b>13 bit</b>. Bộ đếm 13 bit có thể giữ các giá trị giữa <b>0000</b> đến <b>1FFFF</b> trong <b>TH</b> - <b>TL</b>. Do vậy khi bộ định thời đạt được giá trị cực đại của nó là <b>1FFFH</b> thì nó sẽ quay trở về <b>0000</b>và cờ <b>TF</b> được bật lên.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.4 Lập trình cho chế độ 2</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Dưới đây là những bước hoạt động của timer ở chế độ 2:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Nó là một bộ định thời <b>8 bit</b>, do vậy nó chỉ cho phép các giá trị từ <b>00</b> đến <b>FFH</b>được nạp vào thanh ghi <b>TH</b> của bộ định thời.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Sau khi 2 thanh ghi <b>TH</b> và <b>TL</b> được nạp giá trị ban đầu thì bộ định thời phải được <b>khởi động</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Sau khi bộ định thời được khởi động, nó bắt đầu đếm tăng lên bằng cách<b> tăng thanh ghi TL</b>. Nó đếm cho đến khi đại giá trị giới hạn <b>FFH</b> của nó. Khi nó quay trở về <b>00</b> từ <b>FFH</b>, nó thiết lập cờ bộ định thời <b>TF</b>. Nếu ta sử dụng bộ định thời <b>Timer0</b> thì đó là cờ <b>TF0</b>, còn <b>Timer1</b> thì đó là cờ <b>TF1</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Khi thanh ghi <b>TL</b> quay trở về <b>00</b> từ <b>FFH,</b> cờ <b>TF</b> được bật lên 1 thì thanh ghi <b>TL</b>được tự động nạp lại với giá trị sao chép từ thanh ghi <b>TH</b>. Để lặp lại quá trình chúng ta đơn giản chỉ việc <b>xoá cờ</b> <b>TF</b> và để cho nó chạy mà không cần sự can thiệp của lập trình viên để nạp lại giá trị ban đầu. Điều này làm cho <b>chế độ 2 được gọi là chế độ tự nạp lại</b> so với chế độ 1 (phải nạp lại các thanh ghi TH và TL).</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"><br /></span></div>
<div style="clear: both; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<a href="http://www.dientumaytinh.com/2012/07/hoc-lap-trinh-8051-bo-em-bo-inh-thoi.html" rel="nofollow" style="color: #3ba8bd; outline: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM-zbbRcRJz-a23hwIpP_g_bOf8shF72dK5nTQWeDcVODM_M4Scy9aT7wfvLu2M74ZHlcHhZJBpw-aB2y8AFoGYlVOPRz4c_hvHBeLU02A8PXOWFbeWIShcKPY1KNFDg-w63vxQEWJPOTo/s1600/hoc+lap+trinh+8051.hinh7.jpg" style="background-color: transparent; border: 0px none; padding: 0px;" /></a></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"><br /></span></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in; text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Hình 7:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Timer/counter chế độ 2</span></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in; text-align: center;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Cần phải nhấn mạnh rằng:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> chế độ 2 là bộ định thời 8 bit. Tuy nhiên, nó lại có khả năng tự nạp, khi tự nạp lại thì <b>giá trị ban đầu của TH được giữ nguyên, còn TL được nạp lại giá trị sao chép từ TH.</b></span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chế độ này có nhiều ứng dụng, bao gồm việc <b>thiết lập tần số baud trong truyền thông nối tiếp</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.4.1 Các bước lập trình cho chế độ 2</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Để tạo ra một thời gian trễ sử dụng chế độ 2 của bộ định thời cần thực hiện các bước sau:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Nạp thanh ghi giá trị <b>TMOD</b> để báo bộ định thời gian nào (Timer0 hay Timer1) được sử dụng và chế độ làm việc nào của chúng được chon.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Nạp lại thanh ghi <b>TH</b> và <b>TL</b> với giá trị đếm ban đầu.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">3.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Khởi động</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> bộ định thời.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">4.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Duy trì kiểm tra cờ</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> bộ định thời <b>TF</b> bằng cách sử dụng một vòng lặp để xem nó đã được bật chưa. Thoát vòng lặp khi <b>TF</b> lên cao.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">5.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Dừng bộ định thời.</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">6.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Xoá cờ TF</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">7.<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Quay trở lại bước 3.</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Vì chế độ 2 là chế độ tự nạp lại.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ví dụ 7 minh hoạ những điều này:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ví dụ 7:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">#include<at89x51.h> //khai báo thư viện cho VĐK 89x51 </span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">void delay(void); //khi báo nguyên mẫu hàm con tạo trễ</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">main()</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">{</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TMOD=0x20; //chọn timer1, chế độ 2, 8Bit, tự nạp lại</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TH1=0x00; //nạp giá trị cho TH1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TL1=0xFE; //nạp giá trị cho TL1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> P1_5=1; //khởi tạo chân P1_5 ở mức cao</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> while(1) //vòng lặp vô hạn</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> {</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> delay(); //gọi chương trình con tạo trễ</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> P1_5=~P1_5; //đảo tín hiệu chân P1_5</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> }</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">}</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">void delay(void) //định nghĩa hàm delay</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">{</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TR1=1; //khởi động timer1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> while(!TF1){} //vòng lặp kiểm tra cờ TF1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TR1=0; //ngừng timer1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TF1=0; //xóa cờ TF1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">}</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Hàm delay() trên sẽ tạo một độ trễ bằng 256 lần (FF - 00 + 1) chu kỳ của timer (không tính tổng phí các lệnh) kể từ chu trình thứ 2. Vì chu trình đầu tiên timer1 bắt đầu đếm ở vị trí <b>0xFE</b>, kể từ chu trình sau thì thanh ghi <b>TL1</b> mới sao chép được giá trị ở <b>TH1</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2. Bộ đếm</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Ở phần trên đây ta đã sử dụng các bộ định thời của 8051 để tạo ra các độ trễ thời gian. Các bộ định thời này cũng có thể được dùng như các <b>bộ đếm</b> (</span><b style="font-family: 'Times New Roman', serif; font-size: 17px; text-indent: 48px;">counter</b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">) các sự kiện xảy ra bên ngoài 8051. Công dụng của bộ đếm sự kiện sẽ được tình bày ở phần này. Chừng nào còn liên quan đến công dụng của bộ định thời như bộ đếm sự kiện thì mọi vấn đề mà ta nói về lập trình bộ định thời ở phần trước cũng được áp dụng cho việc lập trình như là một bộ đếm ngoại trừ nguồn tần số.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Đối với bộ định thời/bộ đếm khi dùng nó như <b>bộ định thời</b> thì nguồn tần số <b>là tần số thạch anh</b> của 8051. Tuy nhiên, khi nó được dùng như một <b>bộ đếm</b> thì nguồn xung để tăng nội dung các thanh ghi TH và TL là từ <b>bên ngoài 8051</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ở chế độ bộ đếm, hãy lưu ý rằng các thanh ghi <b>TMOD</b> và <b>TH</b>, <b>TL</b> cũng giống như đối với bộ định thời được bàn ở phần trước, thậm chí chúng vẫn có cùng tên gọi. Các chế độ của các bộ đếm cũng giống nhau.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2.1 Bit C/T trong thanh ghi TMOD</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Xem lại phần trên về bit <b>C/T</b> trong thanh ghi <b>TMOD</b>: ta thấy rằng nó quyết định nguồn xung đồng hồ cho bộ đếm:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Nếu bit <b>C/T = 0</b> thì bộ định thời nhận các xung đồng hồ từ bộ giao động thạch anh của 8051.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.75in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Nếu bit <b>C/T = 1</b> thì bộ định thời được sử dụng như bộ đếm và nhận các xung đồng hồ từ nguồn bên ngoài của 8051.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Do vậy, nếu <b>bit</b> <b>C/T = 1</b> thì bộ đếm tăng lên khi các xung được đưa đến chân P3.4 (<b>T0</b>) đối với <b>counter0</b> và chân P3.5 (<b>T1</b>) đối với <b>counter1</b>.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: none; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin: 0px 0px 20px 5.4pt; width: 604px;"><tbody>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 90.75pt;" valign="top" width="121"><div style="text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chân</span></b></div>
</td><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 99pt;" valign="top" width="132"><div style="text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chân cổng</span></b></div>
</td><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 99pt;" valign="top" width="132"><div style="text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chức năng</span></b></div>
</td><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 176pt;" valign="top" width="235"><div style="text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Mô tả</span></b></div>
</td></tr>
<tr style="height: 15.05pt;"><td style="border: 1pt solid windowtext; height: 15.05pt; padding: 0in 5.4pt; vertical-align: top; width: 90.75pt;" valign="top" width="121"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">14</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 15.05pt; padding: 0in 5.4pt; vertical-align: top; width: 99pt;" valign="top" width="132"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">P3.4</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 15.05pt; padding: 0in 5.4pt; vertical-align: top; width: 99pt;" valign="top" width="132"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">T0</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; height: 15.05pt; padding: 0in 5.4pt; vertical-align: top; width: 176pt;" valign="top" width="235"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Đầu vào ngoài của <b>bộ đếm 0</b></span></div>
</td></tr>
<tr><td style="border: 1pt solid windowtext; padding: 0in 5.4pt; vertical-align: top; width: 90.75pt;" valign="top" width="121"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">15</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 99pt;" valign="top" width="132"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">P3.5</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 99pt;" valign="top" width="132"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">T1</span></div>
</td><td style="border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; vertical-align: top; width: 176pt;" valign="top" width="235"><div style="text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Đầu vào ngoài của <b>bộ đếm 1</b></span></div>
</td></tr>
</tbody></table>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Bảng 4:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Các chân cổng P3 được dùng cho bộ đếm 0 và 1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ví dụ 8:</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> </span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Chương trình sau sử dụng bộ đếm 1, đếm các xung ở chân P3.5 và hiển thị số đếm được (trong thanh ghi TL1) lên cổng P2:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">#include<at89x51.h> //khai báo thư viện 89x51</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">main() //chương trình chính</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">{</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TMOD=0x60; //0x60=0110 000 : C/T=1, bộ đếm 1, chế độ 2 tự nạp</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TH1=0x00; //xóa bộ đếm ban đầu</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> P3_5=1; //set chân vào cho bộ đếm</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> TR1=1; //khởi động bộ đếm 1</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> while(1) //vòng lặp vô hạn</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> {</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> P2=TL1; //hiển thị số đếm được ra cổng P2</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;"> }</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="color: #0070c0; font-family: 'Times New Roman', serif; font-size: 13pt;">}</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Trong <b>ví dụ 8</b> chúng ta sử dụng bộ </span> <b style="font-family: 'Times New Roman', serif; font-size: 17px; text-indent: 48px;">counter</b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"><b>1</b> như bộ đếm sự kiện để nó đếm lên mỗi khi các xung đồng hồ được cấp đến chân <b>P3.5</b>. Các xung đồng hồ này có thể biểu diễn số người đi qua cổng hoặc số vòng quay hoặc bất kỳ sự kiện nào khác mà có thể chuyển đổi thành các xung.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2.2 Thanh ghi TCON</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Trong các ví dụ trên đây ta đã thấy công dụng của các cờ <b>TR0</b> và <b>TR1</b> để bật/tắt các bộ đếm/bộ định thời. Các bit này là một bộ phận của thanh ghi <b>TCON</b>. Đây là thanh ghi <b>8 bit</b>, như được chỉ ra trong <b>hình 2</b>:</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">4 bit trên được dùng để lưu cất các bit <b>TF</b> và <b>TR</b> cho cả Timer/counter 0 và Timer/</span><span style="font-family: 'Times New Roman', serif; font-size: 17px; text-indent: 48px;">counter </span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">1.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.5in; text-align: justify;">
<span style="font-family: Wingdings; font-size: 13pt;">Ø<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">4 bit thấp được thiết lập dành cho điều khiển các <b>ngắt</b> mà ta sẽ bàn ở các bài sau.</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<br /></div>
<div style="clear: both; color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: center;">
<a href="http://www.dientumaytinh.com/2012/07/hoc-lap-trinh-8051-bo-em-bo-inh-thoi.html" rel="nofollow" style="color: #3ba8bd; outline: none;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieJcKpQIMWjcCNtcAKuqIAYZVIEFAo6Gjk1fnQib-xEmLtKCWT-qWPBu0z9zZwob8GDh4YC8MIgl9HLqxuy8ZJmTxOc-i9JVSo0xDoZiewCV0IhrttuEbR4mHgpL2whjsq4h2QxIWeSn9f/s1600/hoc+lap+trinh+8051.hinh8.jpg" style="background-color: transparent; border: 0px none; padding: 0px;" /></a></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"><br /></span></div>
<div align="center" style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin: 0in 0in 0.0001pt; text-align: center;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Hình 8:</span></b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Thanh ghi TCON – Điều khiển bộ đếm/bộ định thời</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin: 0in 0in 0.0001pt; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin: 0in 0in 0.0001pt; text-align: justify;">
<b><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">2.3 Trường hợp khi bit GATE = 1 trong TMOD</span></b></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; margin-left: 0.25in; text-align: justify;">
<br /></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;"> Trước khi kết thúc bài này ta cần bàn thêm về trường hợp khi bit <b>GATE = 1</b> trong thanh ghi <b>TMOD</b>. Tất cả những gì chúng ta vừa nói trong bài này đều giả thiết <b>GATE = 0</b>. Khi GATE = 0 thì bộ đếm/bộ định thời được khởi động bằng các lệnh Set bit <b>TR0 </b>hoặc<b>TR1</b>. Vậy điều gì xảy ra khi bit GATE = 1?</span></div>
<div style="color: #495457; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; text-align: justify; text-indent: 0.5in;">
<span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Nếu <b>GATE = 1</b> thì việc khởi động và dừng bộ đếm/bộ định thời được thực hiện từ bên ngoài qua chân <b>P3.2</b> (<b>INT0</b>) và <b>P3.3</b> (<b>INT1</b>) đối với Timer/counter 0 và Timer/counter 1 tương ứng. Phương pháp điều khiển bằng phần cứng để dừng và khởi động bộ đếm/bộ định thời này có thể có rất nhiều ứng dụng.</span><br /><span style="font-family: 'Times New Roman', serif; font-size: 13pt;">Ví dụ: chẳng hạn 8051 được dùng trong một sản phẩm phát báo động mỗi giây dùng bộ Timer0 theo nhiều việc khác. Bộ Timer0 được bật lên bằng phần mềm qua lệnh Set bit TR0 và nằm ngoài sự kiểm soát của người dùng sản phẩm đó. Tuy nhiên, khi nối một công tắc chuyển mạch tới chân P2.3 ta có thể dừng và khởi động bộ định thời, bằng cách đó ta có thể tắt báo động.</span></div>
</div>
</div>
</td></tr>
</tbody></table>
</div>
</div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-29212342932478628112013-11-22T12:26:00.000-08:002013-11-22T12:26:15.858-08:00LinkLabel trong C#<h3 class="post-title entry-title" style="font-family: Georgia, Times, serif; font-size: 22px; line-height: 1.2em; margin: 0.25em 0px 0px; padding: 0px 0px 4px;">
LinkLabel trong C#</h3>
<div class="post-header" style="color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 12px;">
<div class="post-header-line-1">
</div>
</div>
<h2 class="date-header" style="color: #999999; font-family: Arial; font-size: 12px; font-weight: normal; letter-spacing: 0.01em; line-height: 1.2em; margin: 0.1em 0px;">
<br /></h2>
<div class="post-body entry-content" id="post-body-1419394653168036758" style="border-top-color: rgb(187, 187, 187); border-top-style: solid; border-top-width: 2px; color: #333333; font-family: Arial; font-size: 14px; margin: 3.1em 0px 0.75em; padding-top: 6px;">
<br />
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;">A LinkLabel control is a label control that can display a hyperlink. A LinkLabel control is inherited from the Label class so it has all the functionality provided by the Windows Forms Label control. LinkLabel control does not participate in user input or capture mouse or keyboard events. <br style="outline: none 0px;" /><o:p style="outline: none 0px;"></o:p></span><br />
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;">In this article, I will discuss how to create a LinkLabel control in Windows Forms at design-time as well as run-time. After that, I will continue discussing various properties and methods available for the LinkLabel control. <br style="outline: none 0px;" /><o:p style="outline: none 0px;"></o:p></span><br />
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;">In Visual Studio 2010, the ToolStripLabel control is recommended for a LinkLabel control.<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="font-family: Calibri; outline: none 0px;"><b style="outline: none 0px;"><span style="outline: none 0px;">Creating a LinkLabel</span></b><span style="outline: none 0px;"><o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="outline: none 0px;"><span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">There are two ways to create a control.<o:p style="outline: none 0px;"></o:p></span></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">Design-time<o:p style="outline: none 0px;"></o:p></span></span></b></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="outline: none 0px;"><span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">First, we can use the Form designer of Visual Studio to create a control at design-time. In design-time mode, we can use visual user interfaces to create a control properties and write methods.<o:p style="outline: none 0px;"></o:p></span></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="outline: none 0px;"><span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">To create a LinkLabel control at design-time, you simply drag and drop a LinkLabel control from Toolbox to a Form. After you drag and drop a LinkLabel on a Form. The LinkLabel looks like Figure 1. Once a LinkLabel is on the Form, you can move it around and resize it using mouse and set its properties and events.<o:p style="outline: none 0px;"></o:p></span></span></span></div>
<div align="center" class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; text-align: center; vertical-align: top;">
<span style="outline: none 0px;"><v:stroke joinstyle="miter" style="outline: none 0px;"></v:stroke><v:formulas style="outline: none 0px;"><v:f eqn="if lineDrawn pixelLineWidth 0" style="outline: none 0px;"></v:f><v:f eqn="sum @0 1 0" style="outline: none 0px;"></v:f><v:f eqn="sum 0 0 @1" style="outline: none 0px;"></v:f><v:f eqn="prod @2 1 2" style="outline: none 0px;"></v:f><v:f eqn="prod @3 21600 pixelWidth" style="outline: none 0px;"></v:f><v:f eqn="prod @3 21600 pixelHeight" style="outline: none 0px;"></v:f><v:f eqn="sum @0 0 1" style="outline: none 0px;"></v:f><v:f eqn="prod @6 1 2" style="outline: none 0px;"></v:f><v:f eqn="prod @7 21600 pixelWidth" style="outline: none 0px;"></v:f><v:f eqn="sum @8 21600 0" style="outline: none 0px;"></v:f><v:f eqn="prod @7 21600 pixelHeight" style="outline: none 0px;"></v:f><v:f eqn="sum @10 21600 0" style="outline: none 0px;"></v:f></v:formulas><v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f" style="outline: none 0px;"></v:path><o:lock aspectratio="t" style="outline: none 0px;" v:ext="edit"></o:lock></span><span style="outline: none 0px;"><o:p style="outline: none 0px;"></o:p></span></div>
<div align="center" class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; text-align: center; vertical-align: top;">
<i style="outline: none 0px;"><span style="outline: none 0px;"><span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;"><img alt="LinkLabelImg1.jpg" border="0" height="303" src="http://www.c-sharpcorner.com/UploadFile/mahesh/linklabel-in-C-Sharp/Images/LinkLabelImg1.jpg" style="border: none; clear: both; max-width: 595px; outline: none 0px; padding-top: 4px;" width="410" /><br style="outline: none 0px;" />Figure 1<o:p style="outline: none 0px;"></o:p></span></span></span></i></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">Run-time<o:p style="outline: none 0px;"></o:p></span></span></b></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">LinkLabel class represents a hyperlink Label control. We simply create an instance of LinkLabel class, set its properties and add this it to the Form controls.<o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">In the first step, we create an instance of the LinkLabel class. The following code snippet creates a LinkLabel control object.<o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="color: #2b91af; font-family: Consolas; outline: none 0px;">LinkLabel</span><span style="font-family: Consolas; outline: none 0px;"> dynamicLinkLabel = <span style="color: blue; outline: none 0px;">new</span> <span style="color: #2b91af; outline: none 0px;">LinkLabel</span>();<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<br /></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">In the next step, we set properties of a LinkLabel control. The following code snippet sets background color, foreground color, Text, Name, and Font properties of a LinkLabel.<o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="color: green; font-family: Consolas; outline: none 0px;">// Set background and foreground</span><span style="font-family: Consolas; outline: none 0px;"><o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.BackColor = <span style="color: #2b91af; outline: none 0px;">Color</span>.Red;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.ForeColor = <span style="color: #2b91af; outline: none 0px;">Color</span>.Blue;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;"><span style="outline: none 0px;"> </span><o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Text = <span style="color: #a31515; outline: none 0px;">"I am a Dynamic LinkLabel"</span>;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Name = <span style="color: #a31515; outline: none 0px;">"DynamicLinkLabel"</span>;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Font = <span style="color: blue; outline: none 0px;">new</span> <span style="color: #2b91af; outline: none 0px;">Font</span>(<span style="color: #a31515; outline: none 0px;">"Georgia"</span>, 16);<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<br /></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">In the last step, we need to add a LinkLabel control to the Form by calling Form.Controls.Add method. The following code snippet adds a LinkLabel control to a Form.<o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<br /></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">Controls.Add(dynamicLinkLabel);<span style="outline: none 0px;"> </span></span><o:p style="outline: none 0px;"></o:p></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="font-family: Calibri; outline: none 0px;"><b style="outline: none 0px;"><span style="line-height: 27px; outline: none 0px;">Setting LinkLabel Properties</span></b><span style="font-family: 'Times New Roman', serif; line-height: 18px; outline: none 0px;"><o:p style="outline: none 0px;"></o:p></span></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<span style="font-family: Calibri, sans-serif; outline: none 0px;">After you place a LinkLabel control on a Form, the next step is to set properties.<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<span style="font-family: Calibri, sans-serif; outline: none 0px;">The easiest way to set properties is from the Properties Window. You can open Properties window by pressing F4 or right click on a control and select Properties menu item. The Properties window looks like Figure 2.<o:p style="outline: none 0px;"></o:p></span></div>
<div align="center" style="background-color: white; font-family: 'segoe UI'; outline: none 0px; text-align: center; vertical-align: top;">
<span style="outline: none 0px;"></span><span style="font-family: Calibri, sans-serif; outline: none 0px;"><o:p style="outline: none 0px;"></o:p></span></div>
<div align="center" class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; text-align: center; vertical-align: top;">
<span style="font-family: Calibri; outline: none 0px;"><span style="font-size: x-small; outline: none 0px;"><i style="outline: none 0px;"><span style="outline: none 0px;"><img alt="LinkLabelImg2.jpg" border="0" height="409" src="http://www.c-sharpcorner.com/UploadFile/mahesh/linklabel-in-C-Sharp/Images/LinkLabelImg2.jpg" style="border: none; clear: both; max-width: 595px; outline: none 0px; padding-top: 4px;" width="329" /><br style="outline: none 0px;" />Figure 2</span></i><span style="outline: none 0px;"><o:p style="outline: none 0px;"></o:p></span></span></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="font-family: Calibri, sans-serif; outline: none 0px;"><span style="font-size: x-small; outline: none 0px;">Name<o:p style="outline: none 0px;"></o:p></span></span></b> </div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">Name property represents a unique name of a LinkLabel control. It is used to access the control in the code. The following code snippet sets and gets the name and text of a LinkLabel control.<o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Name = <span style="color: #a31515; outline: none 0px;">"DynamicLinkLabel"</span>;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="color: blue; font-family: Consolas; outline: none 0px;">string</span><span style="font-family: Consolas; outline: none 0px;"> name = dynamicLinkLabel.Name;<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="font-family: Calibri, sans-serif; outline: none 0px;"><span style="font-size: x-small; outline: none 0px;">Location, Height, Width, and Size<o:p style="outline: none 0px;"></o:p></span></span></b> </div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;"><br style="outline: none 0px;" />The Location property takes a Point that specifies the starting position of the LinkLabel on a Form. The Size property specifies the size of the control. We can also use Width and Height property instead of Size property. The following code snippet sets Location, Width, and Height properties of a LinkLabel control.<o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Location = <span style="color: blue; outline: none 0px;">new</span> <span style="color: #2b91af; outline: none 0px;">Point</span>(20, 150);<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Height = 40;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Width = 300;<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="font-family: Calibri, sans-serif; outline: none 0px;"><span style="font-size: x-small; outline: none 0px;">Background, Foreground, BorderStyle<o:p style="outline: none 0px;"></o:p></span></span></b></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<span style="font-family: Calibri, sans-serif; outline: none 0px;">BackColor and ForeColor properties are used to set background and foreground color of a LinkLabel respectively. If you click on these properties in Properties window, the Color Dialog pops up.<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<span style="font-family: Calibri, sans-serif; outline: none 0px;">Alternatively, you can set background and foreground colors at run-time. The following code snippet sets BackColor and ForeColor properties.<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.BackColor = <span style="color: #2b91af; outline: none 0px;">Color</span>.Red;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.ForeColor = <span style="color: #2b91af; outline: none 0px;">Color</span>.Blue;<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<span style="font-family: Calibri, sans-serif; outline: none 0px;">You can also set borders style of a LinkLabel by using the BorderStyle property. The BorderStyle property is represented by a BorderStyle enumeration that has three values – FixedSingle, Fixed3D, and None. <span style="outline: none 0px;"> </span>The default value of border style is Fixed3D. The following code snippet sets the border style of a LinkLabel to FixedSingle.<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.BorderStyle = <span style="color: #2b91af; outline: none 0px;">BorderStyle</span>.FixedSingle;<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="font-family: Calibri, sans-serif; outline: none 0px;"><span style="font-size: x-small; outline: none 0px;">Font<o:p style="outline: none 0px;"></o:p></span></span></b> </div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;"><br style="outline: none 0px;" />Font property represents the font of text of a LinkLabel control. If you click on the Font property in Properties window, you will see Font name, size and other <a alt="Replica watches" href="http://www.watchesn.com/" style="color: black; outline: none 0px; text-decoration: none;" title="Replica watches">font</a> options. The following code snippet sets Font property at run-time.<o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Font = <span style="color: blue; outline: none 0px;">new</span> <span style="color: #2b91af; outline: none 0px;">Font</span>(<span style="color: #a31515; outline: none 0px;">"Georgia"</span>, 16);<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="font-family: Calibri, sans-serif; outline: none 0px;"><span style="font-size: x-small; outline: none 0px;">Text and TextAlign, and TextLength<o:p style="outline: none 0px;"></o:p></span></span></b> </div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">Text property of a LinkLabel represents the current text of a LinkLabel control. The TextAlign property represents text alignment that can be Left, Center, or Right. The TextLength property returns the length of a LinkLabel contents.<o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">The following code snippet sets the Text and TextAlign properties and gets the size of a LinkLabel control.<o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Text = <span style="color: #a31515; outline: none 0px;">"I am Dynamic LinkLabel"</span>;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.TextAlign<span style="outline: none 0px;"> </span>= <span style="color: #2b91af; outline: none 0px;">HorizontalAlignment</span>.Center;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="color: blue; font-family: Consolas; outline: none 0px;">int</span><span style="font-family: Consolas; outline: none 0px;"> size = dynamicLinkLabel.TextLength;<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="font-family: Calibri, sans-serif; outline: none 0px;"><span style="font-size: x-small; outline: none 0px;">Append Text<o:p style="outline: none 0px;"></o:p></span></span></b> </div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;"><br style="outline: none 0px;" />We can append text to a LinkLabel by simply setting Text property to current text plus new text you would want to append something like this.<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Text += <span style="color: #a31515; outline: none 0px;">" Appended text"</span>;<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="font-family: Calibri, sans-serif; outline: none 0px;"><span style="font-size: x-small; outline: none 0px;">AutoEllipsis<o:p style="outline: none 0px;"></o:p></span></span></b></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;">An ellipsis character (...) is used to give an impression that a control has more characters but it could not fit in the current width of the control. If AutoEllipsis property is true, it adds ellipsis character to a control if text in control does not fit. You may have to set AutoSize to false to see the ellipses character.<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<span style="font-size: x-small; outline: none 0px;"><b style="outline: none 0px;"><span style="font-family: Calibri, sans-serif; outline: none 0px;">Image in LinkLabel</span></b><span style="font-family: Calibri, sans-serif; outline: none 0px;"><o:p style="outline: none 0px;"></o:p></span></span> </div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;"><span style="outline: none 0px;"><br style="outline: none 0px;" />The <span style="border: 1pt windowtext; outline: none 0px; padding: 0in;">Image</span> property of a</span> LinkLabel control is used to set a LinkLabel background as an image. The Image property needs an Image object. The Image class has a static method called FromFile that takes an image file name with full path and creates an Image object.<span style="font-family: 'Times New Roman', serif; line-height: 18px; outline: none 0px;"><o:p style="outline: none 0px;"></o:p></span></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">You can also align image and text. The ImageAlign and TextAlign properties of Button are used for this purpose.<o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="font-family: Calibri; font-size: x-small; outline: none 0px;">The following C# code snippet sets an image as a LinkLabel background. </span><span style="font-family: Consolas; line-height: 14px; outline: none 0px;">dynamicLinkLabel</span><span style="font-family: Consolas; line-height: 14px; outline: none 0px;">.Image = <span style="color: #2b91af; outline: none 0px;">Image</span>.FromFile(<span style="color: #a31515; outline: none 0px;">@"C:\Images\Dock.jpg"</span>);<span style="color: green; outline: none 0px;"> </span></span><span style="font-family: Consolas; line-height: 14px; outline: none 0px;">dynamicLinkLabel</span><span style="font-family: Consolas; line-height: 14px; outline: none 0px;">.ImageAlign = <span style="color: #2b91af; outline: none 0px;">ContentAlignment</span>.MiddleRight;</span><span style="font-family: Consolas; line-height: 14px; outline: none 0px;">dynamicLinkLabel</span><span style="font-family: Consolas; line-height: 14px; outline: none 0px;">.TextAlign = <span style="color: #2b91af; outline: none 0px;">ContentAlignment</span>.MiddleLeft;<span style="color: green; outline: none 0px;"> </span></span><span style="font-family: Consolas; line-height: 14px; outline: none 0px;">dynamicLinkLabel</span><span style="font-family: Consolas; line-height: 14px; outline: none 0px;">.FlatStyle = <span style="color: #2b91af; outline: none 0px;">FlatStyle</span>.Flat;</span><span style="font-size: x-small; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;"><o:p style="outline: none 0px;"></o:p></span></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<b style="outline: none 0px;"><span style="line-height: 27px; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">Hyperlink Properties<o:p style="outline: none 0px;"></o:p></span></span></b><br />
<br style="outline: none 0px;" />
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;">Here are the hyperlink related properties available in the LinkLabel control.<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="font-family: Calibri, sans-serif; outline: none 0px;"><span style="font-size: x-small; outline: none 0px;">Links and LinkArea<o:p style="outline: none 0px;"></o:p></span></span></b> </div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;"><br style="outline: none 0px;" />A LinkLabel control can display more than one hyperlink. The Links property a type of LinkCollection represents all the hyperlinks available in a LinkLabel control. The Add method of LinkColleciton is used to add a link to the collection. The Remove and RemoveAt methods are used to remove a link from the LinkCollection. The Clear method is used to remove all links from a LinkCollection.<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;">LinkArea property represents the range of text that is treated as a part of the link. It takes a starting position and length of the text.<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;">The following code snippet ads a link and sets LinkArea and a link click event handler.<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.LinkArea = <span style="color: blue; outline: none 0px;">new</span> <span style="color: #2b91af; outline: none 0px;">LinkArea</span>(0, 22);<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.Links.Add(24, 9, <span style="color: #a31515; outline: none 0px;">"http://www.c-sharpcorner.com"</span>);<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.LinkClicked += <span style="color: blue; outline: none 0px;">new</span> <span style="color: #2b91af; outline: none 0px;">LinkLabelLinkClickedEventHandler</span>(LinkedLabelClicked);<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;">Here is the code for the LinkLabel click event handler and uses Process.Start method to open a hyperlink in a browser.<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="color: blue; font-family: Consolas; outline: none 0px;">private</span><span style="font-family: Consolas; outline: none 0px;"> <span style="color: blue; outline: none 0px;">void</span> LinkedLabelClicked(<span style="color: blue; outline: none 0px;">object</span> sender, <span style="color: #2b91af; outline: none 0px;">LinkLabelLinkClickedEventArgs</span> e)<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">{<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;"><span style="outline: none 0px;"> </span>dynamicLinkLabel.LinkVisited = <span style="color: blue; outline: none 0px;">true</span>;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;"><span style="outline: none 0px;"> </span>System.Diagnostics.<span style="color: #2b91af; outline: none 0px;">Process</span>.Start(<span style="color: #a31515; outline: none 0px;">"http://www.c-sharpcorner.com"</span>);<span style="outline: none 0px;"> </span><o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">}<o:p style="outline: none 0px;"></o:p></span></div>
<div style="background-color: white; font-family: 'segoe UI'; outline: none 0px; vertical-align: top;">
<b style="outline: none 0px;"><span style="font-family: Calibri, sans-serif; outline: none 0px;"><span style="font-size: x-small; outline: none 0px;">LinkColor, VisitedLinkColor, ActiveLinkColor and DisabledLinkColor<o:p style="outline: none 0px;"></o:p></span></span></b> </div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px; vertical-align: top;">
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;"><br style="outline: none 0px;" />LinkColor, VisitedLinkColor, ActiveLinkColor and DisabledLinkColor properties represent colors when a hyperlink is in normal, visited, active, or disabled mode. The following code snippet sets these colors.<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.ActiveLinkColor = <span style="color: #2b91af; outline: none 0px;">Color</span>.Orange;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.VisitedLinkColor = <span style="color: #2b91af; outline: none 0px;">Color</span>.Green;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.LinkColor = <span style="color: #2b91af; outline: none 0px;">Color</span>.RoyalBlue;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<span style="font-family: Consolas; outline: none 0px;">dynamicLinkLabel.DisabledLinkColor = <span style="color: #2b91af; outline: none 0px;">Color</span>.Gray;<o:p style="outline: none 0px;"></o:p></span></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 0pt; outline: none 0px;">
<br /></div>
<div class="MsoNormal" style="background-color: white; font-family: 'segoe UI'; margin: 0in 0in 10pt; outline: none 0px;">
<b style="outline: none 0px;"><span style="line-height: 27px; outline: none 0px;"><span style="font-family: Calibri; outline: none 0px;">Summary<o:p style="outline: none 0px;"></o:p></span></span></b><br />
<br style="outline: none 0px;" />
<span style="color: black; font-family: 'Segoe UI', sans-serif; outline: none 0px;">A LinkLabel control is used to display a hyperlink and can be used to click the hyperlink to open a URL.. In this article, we discussed discuss how to create a LinkLabel control in Windows Forms at design-time as well as run-time. After that, we saw how to use various properties and methods.</span></div>
</div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-32558535149556524822013-11-22T10:55:00.000-08:002013-11-22T10:59:22.780-08:00MSP430F55xx Development Kit <h2 style="background-color: white; background-image: none; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; font-family: sans-serif; font-size: 19px; font-weight: normal; line-height: 19.1875px; margin: 0px 0px 0.6em; overflow: hidden; padding-bottom: 0.17em; padding-top: 0.5em;">
<span class="mw-headline" id="Gi.E1.BB.9Bi_thi.E1.BB.87u">Giới thiệu</span></h2>
<div class="thumb tright" style="background-color: white; clear: right; float: right; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin: 0.5em 0px 1.3em 1.4em; width: auto;">
<div class="thumbinner" style="background-color: #f9f9f9; border: 1px solid rgb(204, 204, 204); font-size: 12px; overflow: hidden; padding: 3px !important; text-align: center; width: 302px;">
<a class="image" href="http://vnelek.vn/mediawiki/index.php?title=T%E1%BA%ADp_tin:OverView.png" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: none;"><img alt="OverView.png" class="thumbimage" height="300" src="http://vnelek.vn/mediawiki/images/thumb/f/f9/OverView.png/300px-OverView.png" srcset="/mediawiki/images/thumb/f/f9/OverView.png/450px-OverView.png 1.5x, /mediawiki/images/thumb/f/f9/OverView.png/600px-OverView.png 2x" style="border: 1px solid rgb(204, 204, 204); vertical-align: middle;" width="300" /></a><br />
<div class="thumbcaption" style="border: none; font-size: 11px; line-height: 1.4em; padding: 3px !important; text-align: left;">
<div class="magnify" style="background-image: none !important; background-position: initial initial !important; background-repeat: initial initial !important; border: none !important; float: right;">
<a class="internal" href="http://vnelek.vn/mediawiki/index.php?title=T%E1%BA%ADp_tin:OverView.png" style="background-image: none !important; background-position: initial initial !important; background-repeat: initial initial !important; border: none !important; color: #0b0080; display: block; text-decoration: none;" title="Phóng lớn"><img alt="" height="11" src="http://vnelek.vn/mediawiki/skins/common/images/magnify-clip.png" style="background-image: none !important; background-position: initial initial !important; background-repeat: initial initial !important; border: none !important; display: block; vertical-align: middle;" width="15" /></a></div>
</div>
</div>
</div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
MSP430F55xx Development Kit là một sản phẩm được thiết kế riêng, chuyên dụng, dành cho họ vi điều khiển MSP430F5xx của Texas Instruments. Đây là dòng vi điều khiển với các tính năng vượt trội về siêu tiết kiệm năng lượng, tần số hoạt động cao, tích hợp nhiều tính năng trên một con chip duy nhất. Vi xử lý với kiến trúc RISC, thanh ghi 16-bit và các bộ tạo hằng số cho phép đạt hiệu quả thực thi mã lập trình cao nhất. Bộ tạo tần số dao động nội (DCO) cho phép thời gian chuyển từ chế độ tiết kiệm năng lượng sang chế độ hoạt động bình thường < 5us.</div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
Ưu điểm vượt trội của MSP430F55xx Development Kit là khả năng có thể nạp lại chương trình mà không cần phải dùng mạch nạp hoặc một thiết bị nào khác. Trên kit tích hợp sẵn một cổng USB 2.0 cho phép người sử dụng nạp lại chương trình bằng cách chuyển đổi jump (BOOT) để thay đổi giữa chế độ nạp và chế độ hoạt động bình thường. Cổng USB đó cũng được dùng để kit giao tiếp với máy tính, thư viện lập trình API đã được cung cấp sẵn bởi Texas Instruments.</div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
<b>Các tính năng của MSP430F55xx Development Kit</b></div>
<ul style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; list-style-image: url(data:image/png; margin: 0.3em 0px 0px 1.6em; padding: 0px;">
<li style="margin-bottom: 0.1em;">31 chân giao tiếp ngoại vi.</li>
<li style="margin-bottom: 0.1em;">Dải điện áp cung cấp cho kit từ 4.5Vdc – 20Vdc.</li>
<li style="margin-bottom: 0.1em;">2 LED xanh – đỏ có thể điều khiển được. 1 LED báo nguồn.</li>
<li style="margin-bottom: 0.1em;">1 nút nhấn kết nối với chân I/O (P2.0) và 1 nút nhấn reset.</li>
<li style="margin-bottom: 0.1em;">Nạp lại chương trình mà không cần mạch nạp hay một thiết bị nào khác.</li>
<li style="margin-bottom: 0.1em;">Giao tiếp với máy tính thông qua chuẩn USB 2.0.</li>
</ul>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
<b>Các thành phần chính của MSP430F55xx Development Kit</b></div>
<ul style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; list-style-image: url(data:image/png; margin: 0.3em 0px 0px 1.6em; padding: 0px;">
<li style="margin-bottom: 0.1em;">Dây cáp và cổng USB.</li>
<li style="margin-bottom: 0.1em;">Thạch anh 32768Hz.</li>
<li style="margin-bottom: 0.1em;">2 header kết nối đực hoặc cái.</li>
<li style="margin-bottom: 0.1em;">IC ổn áp nguồn ASM1117 – 3.3v</li>
<li style="margin-bottom: 0.1em;">MSP430F5510 với 4 timer 16-bit, bộ chuyển đổi ADC tốc độ cao (> 200ksps), bộ giao tiếp nối tiếp USCI, bộ nhân phần cứng, DMA, bộ đếm thời gian thực và 31 chân I/O.</li>
</ul>
<h2 style="background-color: white; background-image: none; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; font-family: sans-serif; font-size: 19px; font-weight: normal; line-height: 19.1875px; margin: 0px 0px 0.6em; overflow: hidden; padding-bottom: 0.17em; padding-top: 0.5em;">
<span class="mw-headline" id="C.C3.A0i_.C4.91.E1.BA.B7t_ph.E1.BA.A7n_c.E1.BB.A9ng_v.C3.A0_ph.E1.BA.A7n_m.E1.BB.81m"><br />Cài đặt phần cứng và phần mềm</span></h2>
<h3 style="background-color: white; background-image: none; border-bottom-style: none; font-family: sans-serif; font-size: 17px; line-height: 19.1875px; margin: 0px 0px 0.3em; overflow: hidden; padding-bottom: 0.17em; padding-top: 0.5em;">
<span class="mw-headline" id="C.C3.A0i_.C4.91.E1.BA.B7t_ph.E1.BA.A7n_m.E1.BB.81m"><br />Cài đặt phần mềm</span></h3>
<div class="thumb tright" style="background-color: white; clear: right; float: right; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin: 0.5em 0px 1.3em 1.4em; width: auto;">
<div class="thumbinner" style="background-color: #f9f9f9; border: 1px solid rgb(204, 204, 204); font-size: 12px; overflow: hidden; padding: 3px !important; text-align: center; width: 302px;">
<a class="image" href="http://vnelek.vn/mediawiki/index.php?title=T%E1%BA%ADp_tin:USB_Firmware_Upgrade.png" style="background-image: none; background-position: initial initial; background-repeat: initial initial; color: #0b0080; text-decoration: none;"><img alt="USB Firmware Upgrade.png" class="thumbimage" height="222" src="http://vnelek.vn/mediawiki/images/thumb/9/96/USB_Firmware_Upgrade.png/300px-USB_Firmware_Upgrade.png" srcset="/mediawiki/images/thumb/9/96/USB_Firmware_Upgrade.png/450px-USB_Firmware_Upgrade.png 1.5x, /mediawiki/images/9/96/USB_Firmware_Upgrade.png 2x" style="border: 1px solid rgb(204, 204, 204); vertical-align: middle;" width="300" /></a><br />
<div class="thumbcaption" style="border: none; font-size: 11px; line-height: 1.4em; padding: 3px !important; text-align: left;">
<div class="magnify" style="background-image: none !important; background-position: initial initial !important; background-repeat: initial initial !important; border: none !important; float: right;">
<a class="internal" href="http://vnelek.vn/mediawiki/index.php?title=T%E1%BA%ADp_tin:USB_Firmware_Upgrade.png" style="background-image: none !important; background-position: initial initial !important; background-repeat: initial initial !important; border: none !important; color: #0b0080; display: block; text-decoration: none;" title="Phóng lớn"><img alt="" height="11" src="http://vnelek.vn/mediawiki/skins/common/images/magnify-clip.png" style="background-image: none !important; background-position: initial initial !important; background-repeat: initial initial !important; border: none !important; display: block; vertical-align: middle;" width="15" /></a></div>
</div>
</div>
</div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
Hai trình biên dịch phổ biến được sử dụng với MSP430 là <a class="external text" href="http://adf.ly/ZkPcM" rel="nofollow" style="background-image: url(data:image/png; background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: #663366; padding-right: 13px; text-decoration: none;">IAR Embedded Workbench Kickstart</a> và <a class="external text" href="http://adf.ly/ZkPiA" rel="nofollow" style="background-image: url(data:image/png; background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: #663366; padding-right: 13px; text-decoration: none;">Code Composer Studio</a>(CCS). Cả hai trình biên dịch này đều có bản miễn phí và trả phí. IAR Embedded Workbench cho phép biên dịch đoạn mã assembly với dung lượng mã không giới hạn và giới hạn 4kB mã nguồn C. CCS giới hạn dung lượng mã nguồn C với 16kB. Ngoài ra, còn một số trình biên dịch khác như MSPGCC, Rowley Crossworks. Các bài lab được viết cho kit sử dụng trình biên dịch IAR và CCS. Chương trình để nạp cho MSP430F5xx Development Kit là <a class="external text" href="http://adf.ly/ZkPph" rel="nofollow" style="background-image: url(data:image/png; background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: #663366; padding-right: 13px; text-decoration: none;">USB Firmware Upgrade</a>, được phát triển bởi Texas Instruments. Giao diện chương trình được thiết kế đơn giản, chỉ cần chọn file sau khi biên dịch bởi IAR hoặc CCS (*.txt) và nhấn Upgrade. Giao diện chương trình được mô tả ở hình bên. Chương trình kết nối với kit thông qua driver cổng COM ảo. Driver đã được cài kèm theo trong bộ cài đặt của IAR và CCS. Hoặc nếu không có sẵn, driver có thể được tải về <a class="external text" href="https://app.box.com/s/je32o7n11zfmcb7svshj" rel="nofollow" style="background-image: url(data:image/png; background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: #663366; padding-right: 13px; text-decoration: none;">tại đây</a>.</div>
<h3 style="background-color: white; background-image: none; border-bottom-style: none; font-family: sans-serif; font-size: 17px; line-height: 19.1875px; margin: 0px 0px 0.3em; overflow: hidden; padding-bottom: 0.17em; padding-top: 0.5em;">
<span class="mw-headline" id="C.C3.A0i_.C4.91.E1.BA.B7t_ph.E1.BA.A7n_c.E1.BB.A9ng"><br />Cài đặt phần cứng</span></h3>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
<b>Hàn linh kiện</b></div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
MSP430F55xx Development Kit được thiết kế để người dùng có được sự thuận tiện nhất khi sử dụng. Hai hàng chân kết nối ngoại vi với kit được để trống cho người sử dụng tùy ý chọn kiểu header muốn dùng. Trước khi có thể sử dụng, hai lược (đực hoặc cái) phải được hàn vào hai hàng chân của kit.</div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
<b>Kết nối thạch anh 32768Hz</b></div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
MSP430F5510 tích hợp sẵn module Real-Time Clock (RTC) cho phép ứng dụng có thể hoạt động với tính năng thời gian thực. Để sử dụng tính năng này, 2 chân XIN/XOUT của bộ tạo dao động UCS (Unified Clock System) cần được cấp xung clock với tần số thấp như thạch anh 32768Hz. Khi chức năng RTC không được sử dụng, hai chân XIN/XOUT có thể được cấu hình để sử dụng như một chân I/O.</div>
<h2 style="background-color: white; background-image: none; border-bottom-color: rgb(170, 170, 170); border-bottom-style: solid; border-bottom-width: 1px; font-family: sans-serif; font-size: 19px; font-weight: normal; line-height: 19.1875px; margin: 0px 0px 0.6em; overflow: hidden; padding-bottom: 0.17em; padding-top: 0.5em;">
<span class="mw-headline" id="L.C3.A0m_quen_v.E1.BB.9Bi_MSP430F55xx_Development_Kit"><br />Làm quen với MSP430F55xx Development Kit</span></h2>
<div class="thumb tright" style="background-color: white; clear: right; float: right; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin: 0.5em 0px 1.3em 1.4em; width: auto;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYBq1oIfZ0J7Z_pN2EVrj1TuYnuwr4wWXeTU_rdjGnfGAfgKkTDXc-vukKgLpkr8RurICj0cfS-6jOk-DzsCHbHTB9TiO_V4hGc7XfJGuOvS7g0YSiE43Ou7Oega8_2xcanNEyIC1cmoc/s1600/themes+temp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="193" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYBq1oIfZ0J7Z_pN2EVrj1TuYnuwr4wWXeTU_rdjGnfGAfgKkTDXc-vukKgLpkr8RurICj0cfS-6jOk-DzsCHbHTB9TiO_V4hGc7XfJGuOvS7g0YSiE43Ou7Oega8_2xcanNEyIC1cmoc/s320/themes+temp.png" width="320" /></a></div>
<div class="thumbinner" style="background-color: #f9f9f9; border: 1px solid rgb(204, 204, 204); font-size: 12px; overflow: hidden; padding: 3px !important; text-align: center; width: 302px;">
<br />
<div class="thumbcaption" style="border: none; font-size: 11px; line-height: 1.4em; padding: 3px !important; text-align: left;">
<br /></div>
</div>
</div>
<h3 style="background-color: white; background-image: none; border-bottom-style: none; font-family: sans-serif; line-height: 19.1875px; margin: 0px 0px 0.3em; overflow: hidden; padding-bottom: 0.17em; padding-top: 0.5em;">
<span style="font-size: x-small;">Làm quen</span></h3>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
MSP430F55xx Development Kit đã được nạp sẵn chương trình nháy LED và đo nhiệt độ. Khi kết nối kit lần đầu tiên với máy tính thông qua cổng USB, 2 LED xanh - đỏ sẽ nháy, báo hiệu kit đã được cấp nguồn và hoạt động chính xác. Thông tin chi tiết về chương trình nháy LED được ghi ở mục <b>Các ứng dụng demo</b>.</div>
<h3 style="background-color: white; background-image: none; border-bottom-style: none; font-family: sans-serif; font-size: 17px; line-height: 19.1875px; margin: 0px 0px 0.3em; overflow: hidden; padding-bottom: 0.17em; padding-top: 0.5em;">
<span class="mw-headline" id="C.C3.A1c_.E1.BB.A9ng_d.E1.BB.A5ng_demo"><br />Các ứng dụng demo</span></h3>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
Tại lần sử dụng đầu tiên, để kích hoạt các ứng dụng demo, chuyển jump (BOOT) sang chế độ hoạt động bình thường như hình bên và kết nối với máy tính thông qua cổng USB. Nút nhấn S1 được sử dụng để chuyển từ chương trình nháy LED sang chương trình đo nhiệt độ và ngược lại. Mã nguồn IAR và CCS của chương trình có thể được tải về <a class="external text" href="http://adf.ly/ZkPv9" rel="nofollow" style="background-image: url(data:image/png; background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: #663366; padding-right: 13px; text-decoration: none;">tại đây.</a></div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
<b>Chương trình nháy LED</b></div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
Đảm bảo rằng hai LED xanh - đỏ đã được nối với P1.0 và P1.1 thông qua P1, P2 (shorting jumper). Kết nối dây cáp USB với máy tính. LED xanh và đỏ sẽ chớp nháy liên tục.</div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
<b>Chương trình đo nhiệt độ</b></div>
<div style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; margin-bottom: 0.5em; margin-top: 0.4em;">
Nhấn nút S1 để chuyển sang chương trình demo hiển thị nhiệt độ. Trong MSP430F5510 có tích hợp một module cảm biến nhiệt độ, cho phép theo dõi nhiệt độ bên trong chip. Chương trình này sử dụng module ADC 10-bit để lấy mẫu, tính toán chuyển sang giá trị độ C, F và gửi lên máy tính thông qua cổng USB, chuẩn giao tiếp CDC. Để hiển thị nhiệt độ trên máy tính cần có một chương trình giao tiếp với kit, nhận dữ liệu và hiển thị nhiệt độ. Hình bên mô tả giao diện chương trình <a class="external text" href="http://adf.ly/ZkR6u" rel="nofollow" style="background-image: url(data:image/png; background-position: 100% 50%; background-repeat: no-repeat no-repeat; color: #663366; padding-right: 13px; text-decoration: none;">connectMSP430temperature</a>. Các bước để sử dụng chương trình:</div>
<ul style="background-color: white; font-family: sans-serif; font-size: 13px; line-height: 19.1875px; list-style-image: url(data:image/png; margin: 0.3em 0px 0px 1.6em; padding: 0px;">
<li style="margin-bottom: 0.1em;">Driver cần được phải cài sẵn.</li>
<li style="margin-bottom: 0.1em;">Hệ điều hành Windows XP với .NET framework hoặc Windows Vista trở lên.</li>
<li style="margin-bottom: 0.1em;">Chuyển kit sang chế độ hoạt động bình thường (Xem hình 3.3).</li>
<li style="margin-bottom: 0.1em;">Kết nối kit với máy tính qua cổng USB.</li>
<li style="margin-bottom: 0.1em;">Chọn cổng COM kết nối theo các bước sau: Click chuột phải vào Computer ! Manage ! Device manager ! Ports (COMand LPT). Xem cổng kết nối của: MSP-FET430UIF - CDC. Chọn cổng COM đó tại mục Serial Port của giao diện chương trình.</li>
<li style="margin-bottom: 0.1em;">Nhấn nút Start để bắt đầu nhận dữ liệu.</li>
<li style="margin-bottom: 0.1em;">Click vào nút Help để xem hướng dẫn chi tiết hơn.</li>
</ul>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-38765891166703036312013-11-20T15:52:00.003-08:002013-11-20T15:52:53.699-08:00Tạo ứng dụng Visual C++ đơn giản nhất để học C<div class="LTitle" style="background-color: #e5e5e5; background-image: none; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-left-color: rgb(194, 204, 211); border-left-width: 1px; border-right-color: rgb(194, 204, 211); border-right-width: 1px; border-style: solid solid none; border-top-color: rgb(194, 204, 211); border-top-left-radius: 5px; border-top-right-radius: 5px; border-top-width: 1px; color: #59a315; filter: none; font-family: Tahoma, Arial, sans-serif; font-size: 11px; line-height: 15px; margin: 0px; padding: 3px 7px 0px; z-index: 1; zoom: 1;">
<h1 style="color: #42960b; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; margin: 0px; padding: 0px;">
Tạo ứng dụng Visual C++ đơn giản nhất để học C</h1>
</div>
<div class="LContent" style="background-color: #e5e5e5; border-bottom-color: rgb(194, 204, 211); border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-bottom-width: 1px; border-left-color: rgb(194, 204, 211); border-left-width: 1px; border-right-color: rgb(194, 204, 211); border-right-width: 1px; border-style: none solid solid; border-top-left-radius: 0px; border-top-right-radius: 0px; color: #333333; font-family: Tahoma, Arial, sans-serif; font-size: 11px; line-height: 15px; margin: 0px; padding: 5px 7px;">
<div class="article-toolswrap" id="ctl21_DivTool" style="margin: 0px; padding: 0px;">
<ul class="ContentMeta clearfix" style="color: #666666; cursor: default; font-size: 10px; list-style: none; margin: 0px; padding: 0px;"><b style="color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 14px; line-height: 1.6em; margin: 0px; padding: 0px; text-align: justify;">Với VS10, bạn có thể tạo ra các ứng dụng rất phức tạp. Tuy nhiên, với mục đích là học ngôn ngữ lập trình C, bước đầu, ta nên tạo một ứng dụng đơn giản nhất.</b></ul>
</div>
<div id="ctl21_DivContent" style="margin: 10px 0px 0px; padding: 0px;">
<div class="Content" style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: 14px; line-height: 1.6em; margin: 0px; padding: 0px; text-align: justify;">
<ul class="BoxShadow" id="toc" style="-webkit-box-shadow: rgb(119, 119, 119) 3px 3px 5px; border: 1px solid rgb(204, 204, 204); box-shadow: rgb(119, 119, 119) 3px 3px 5px; float: right; font-family: Tahoma; font-size: 11px; list-style: none; margin: 10px; padding: 10px;">
<li style="margin: 0px; padding: 0px;">Bước 1. <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#1" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;">Khởi động Visual C++ 2010 Express</a></li>
<li style="margin: 0px; padding: 0px;">Bước 2. <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#2" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;">Tạo một ứng dụng rỗng (kiểu Win32)</a></li>
<li style="margin: 0px; padding: 0px;">Bước 3. <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#3" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;">Thêm mới một tập tin mã nguồn C/C++</a></li>
<li style="margin: 0px; padding: 0px;">Bước 4. <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#4" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;">Viết mã và Biên dịch chương trình</a></li>
<li style="margin: 0px; padding: 0px;">Bước 5. <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#5" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;">Thực thi chương trình</a></li>
</ul>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Dưới đây là các bước để tạo một ứng dụng đơn giản trong Visual C++. Những hình minh họa là cho Visual C++ 2010 Express, tuy nhiên, những phiên bản khác như Visual Studio 2005/2008/2010, Visual C++ 2008 Express đều có thể áp dụng được (giao diện có thể hơi khác một tí).</div>
<h2 id="1" style="color: #42960b; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; margin: 10px 0px 2px; padding: 0px;">
Bước 1. Khởi động Visual C++ 2010 Express <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#2" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Bước tiếp theo"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/down.png" style="margin: 0px; padding: 0px;" width="16" /></a> <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#toc" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Mục lục bài viết"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/toc.png" style="margin: 0px; padding: 0px;" width="16" /></a></h2>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Bằng cách <em style="margin: 0px; padding: 0px;">Start</em> → <em style="margin: 0px; padding: 0px;">Programs</em> → <em style="margin: 0px; padding: 0px;">Microsoft Visual Studio 2010 Express</em> → <em style="margin: 0px; padding: 0px;">Microsoft Visual C++ 2010 Express</em>, giao diện của VS10 Express sẽ hiện ra như hình 1:</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-align: center; text-indent: 20px;">
<a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/caivc7.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/caivc7-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px -20px; padding: 1px;" title="Kích vào để phóng to" /> </a><br style="margin: 5px 0px; padding: 0px;" />Hình 1</div>
<h2 id="2" style="color: #42960b; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; margin: 10px 0px 2px; padding: 0px;">
Bước 2. Tạo một ứng dụng rỗng (kiểu Win32) <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#3" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Bước tiếp theo"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/down.png" style="margin: 0px; padding: 0px;" width="16" /></a> <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#1" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Bước phía trên"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/up.png" style="margin: 0px; padding: 0px;" width="16" /></a> <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#toc" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Mục lục bài viết"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/toc.png" style="margin: 0px; padding: 0px;" width="16" /></a></h2>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Với VS10 Express nói riêng và VS10 nói chung, ta có thể xây dựng được rất nhiều loại chương trình: chạy trên web, trên điện thoại thông minh, trên máy tính cá nhân,... Trên máy tính cá nhân cũng có nhiều loại chương trình: ứng dụng winform (vd: chương trình quản lý nhân sự), thư viện (các file DLL), ứng dụng console (có cửa sổ nền đen chữ trắng như màn hình DOS thời xưa),... Ứng dụng console lại có 2 kiểu: chạy trên nền .NET Framework (CLR Console Application) và chạy trên nền hệ điều hành Windows (Win32 Console Application).</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Trong số các loại ứng dụng này, ứng dụng console là đơn giản nhất vì không làm việc nhiều với giao diện (không có nút nhấn, không có hộp thả xuống, không có các biểu tượng hình ảnh đẹp mắt,...), do đó, nó rất thích hợp cho những newbie (tân binh) mới chập chững bước vào thế giới lập trình. Do với mục đích là HỌC nên chỉ sử dụng những chức năng cơ bản nhất, không cần những tính năng của mạnh mẽ khi viết trên nền .NET Framework, do vậy tôi chọn kiểu <em style="margin: 0px; padding: 0px;">Win32 Console Application</em>.</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;" title="Đè phím Ctrl, đè tiếp phím Shift sau đó gõ phím N. Chú ý: khi gõ phím N thì hai phím kia vẫn còn đè.">
- Để bắt đầu việc tạo một <em style="margin: 0px; padding: 0px;">solution</em> (tạm dịch thoáng là "ứng dụng") mới, ta có nhiều cách để làm.</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;" title="Đè phím Ctrl, đè tiếp phím Shift sau đó gõ phím N. Chú ý: khi gõ phím N thì hai phím kia vẫn còn đè.">
<u style="margin: 0px; padding: 0px;"><strong style="margin: 0px; padding: 0px;">Cách 1:</strong></u> <em style="margin: 0px; padding: 0px;">File</em> → <em style="margin: 0px; padding: 0px;">New</em> → <em style="margin: 0px; padding: 0px;">Project</em>.<u style="margin: 0px; padding: 0px;"><strong style="margin: 0px; padding: 0px;"></strong></u></div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;" title="Đè phím Ctrl, đè tiếp phím Shift sau đó gõ phím N. Chú ý: khi gõ phím N thì hai phím kia vẫn còn đè.">
<u style="margin: 0px; padding: 0px;"><strong style="margin: 0px; padding: 0px;">Cách 2:</strong></u> nhấn tổ hợp phím <em style="margin: 0px; padding: 0px;">Ctrl</em> + <em style="margin: 0px; padding: 0px;">Shift</em> + <em style="margin: 0px; padding: 0px;">N</em>.</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;" title="Đè phím Ctrl, đè tiếp phím Shift sau đó gõ phím N. Chú ý: khi gõ phím N thì hai phím kia vẫn còn đè.">
<u style="margin: 0px; padding: 0px;"><strong style="margin: 0px; padding: 0px;">Cách 3:</strong></u> trong vùng <em style="margin: 0px; padding: 0px;">Start Page</em> (khi VS mới khởi động), kích vào <em style="margin: 0px; padding: 0px;">New Project</em>.</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-align: center; text-indent: 20px;">
<a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/File-New-Project.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/File-New-Project-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px -20px; padding: 1px;" title="Kích vào để phóng to" /> </a> <a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/StartupNewProject.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/StartupNewProject-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px 5px; padding: 1px;" title="Kích vào để phóng to" /> </a><br style="margin: 5px 0px; padding: 0px;" />Hình 2</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
- Trong cửa sổ <em style="margin: 0px; padding: 0px;">New Project</em>, đầu tiên kích chọn loại ứng dụng là <em style="margin: 0px; padding: 0px;">Win32 </em><strong style="margin: 0px; padding: 0px;">[1]</strong>, <em style="margin: 0px; padding: 0px;">Win32 Console Application</em><strong style="margin: 0px; padding: 0px;"> [2]</strong>, sau đó gõ tên và thư mục chứa ứng dụng<strong style="margin: 0px; padding: 0px;"> [3]</strong>. Chú ý: nên kích chọn <em style="margin: 0px; padding: 0px;">Create directory for solution</em> <strong style="margin: 0px; padding: 0px;">[4]</strong> để VS tạo một thư mục có tên là tên của ứng dụng và sẽ đưa tất cả những tập tin liên quan vào thư mục này (để dể quản lý). Cuối cùng, kích nút <em style="margin: 0px; padding: 0px;">OK</em>.</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-align: center; text-indent: 20px;">
<a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/NewProject.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/NewProject-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px -20px; padding: 1px;" title="Kích vào để phóng to" /> </a><br style="margin: 5px 0px; padding: 0px;" />Hình 3</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
- Cửa sổ tiếp theo (<em style="margin: 0px; padding: 0px;">Win32 Application Wizard</em>) không có gì quan trọng. Kích nút <em style="margin: 0px; padding: 0px;">Next</em> để tiếp tục.</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-align: center; text-indent: 20px;">
<a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/NewWin32ProjectStep1.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/NewWin32ProjectStep1-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px -20px; padding: 1px;" title="Kích vào để phóng to" /> </a><br style="margin: 5px 0px; padding: 0px;" />Hình 4</div>
<div id="hinh5" style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
- Trong cửa sổ cuối cùng, trước tiên phải cọn loại ứng dụng là <em style="margin: 0px; padding: 0px;">Console applicaton</em><strong style="margin: 0px; padding: 0px;"> [1]</strong>, sau đó bỏ chọn mục <em style="margin: 0px; padding: 0px;">Precompiled header</em> <strong style="margin: 0px; padding: 0px;">[2]</strong>, chọn <em style="margin: 0px; padding: 0px;">Empty project</em> <strong style="margin: 0px; padding: 0px;">[3]</strong> và kích nút <em style="margin: 0px; padding: 0px;">Finish </em><strong style="margin: 0px; padding: 0px;">[4]</strong> để VS bắt đầu tạo khung ứng dụng kiểu <em style="margin: 0px; padding: 0px;">Win32 Console</em> "rỗng".</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-align: center; text-indent: 20px;">
<a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/NewWin32ProjectStep2.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/NewWin32ProjectStep2-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px -20px; padding: 1px;" title="Kích vào để phóng to" /> </a><br style="margin: 5px 0px; padding: 0px;" />Hình 5</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
- Thành quả của bước này sẽ như hình dưới đây: một <em style="margin: 0px; padding: 0px;">solution</em> (ứng dụng) chỉ có 1 <em style="margin: 0px; padding: 0px;">project</em> (dự án) và trong dự án này chỉ có 4 thư mục rỗng. Công việc tiếp theo sẽ là đưa thêm gì đó vào cái khung rỗng này để có được một chương trình "chạy được" :-)</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-align: center; text-indent: 20px;">
<a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/NewWin32ProjectStep3.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/NewWin32ProjectStep3-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px -20px; padding: 1px;" title="Kích vào để phóng to" /> </a><br style="margin: 5px 0px; padding: 0px;" />Hình 6</div>
<h2 id="3" style="color: #42960b; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; margin: 10px 0px 2px; padding: 0px;">
Bước 3. Thêm mới một tập tin mã nguồn C/C++ <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#4" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Bước tiếp theo"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/down.png" style="margin: 0px; padding: 0px;" width="16" /></a> <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#2" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Bước phía trên"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/up.png" style="margin: 0px; padding: 0px;" width="16" /></a> <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#toc" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Mục lục bài viết"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/toc.png" style="margin: 0px; padding: 0px;" width="16" /></a></h2>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Kích phải vào hàng thứ 2 trong cửa sổ <em style="margin: 0px; padding: 0px;">Solution Explorer</em>, chọn <em style="margin: 0px; padding: 0px;">Add</em> → <em style="margin: 0px; padding: 0px;">New Item</em>.</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-align: center; text-indent: 20px;">
<a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/AddNewItem.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/AddNewItem-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px -20px; padding: 1px;" title="Kích vào để phóng to" /> </a><br style="margin: 5px 0px; padding: 0px;" />Hình 7</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
- Trong cửa sổ <em style="margin: 0px; padding: 0px;">Add New Item</em>, trước tiên, kích chọn ngôn ngữ của ứng dụng (là Visual C++) [1], sao đó chọn loại tập tin sẽ tạo (là C++ File) [2], nhập tên của tập tin [3] và kích nút <em style="margin: 0px; padding: 0px;">Add</em> để VS bắt đầu tạo tập tin C để "gắn" vào ứng dụng.</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-align: center; text-indent: 20px;">
<a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/AddNewItemCpp.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/AddNewItemCpp-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px -20px; padding: 1px;" title="Kích vào để phóng to" /> </a><br style="margin: 5px 0px; padding: 0px;" />Hình 8</div>
<h2 id="4" style="color: #42960b; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; margin: 10px 0px 2px; padding: 0px;">
Bước 4. Viết mã và Biên dịch chương trình <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#5" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Bước tiếp theo"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/down.png" style="margin: 0px; padding: 0px;" width="16" /></a> <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#3" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Bước phía trên"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/up.png" style="margin: 0px; padding: 0px;" width="16" /></a> <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#toc" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Mục lục bài viết"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/toc.png" style="margin: 0px; padding: 0px;" width="16" /></a></h2>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Kích đúp vào tập tin mới tạo sau đó nhìm vào phần trung tâm của <em style="margin: 0px; padding: 0px;">Visual Studio</em>, bạn sẽ thấy 1 vùng rỗng (tab) có tên là tên của tập tin (ở đây là ChaoC.cpp). Đây chính là nội dung của tập tin này. Tiếp theo, chúng ta sẽ viết một chương trình C đơn giản nhất vào đây. Chương trình chỉ có một công việc đơn giản là hiển thị một dòng chào mừng: "<em style="margin: 0px; padding: 0px;">Chao C! Chao Visual C++ 2010 Express!</em>". Nhập nội dung chương trình như hình dưới (vùng<strong style="margin: 0px; padding: 0px;"> [1]</strong>) và kích chọn <strong style="margin: 0px; padding: 0px;">Build</strong> → <strong style="margin: 0px; padding: 0px;">Build Solution</strong> hoặc nhấn phím <em style="margin: 0px; padding: 0px;">F6</em> để biên dịch chương trình. Kết quả biên dịch được hiển thị ở cửa sổ <em style="margin: 0px; padding: 0px;">Output </em><strong style="margin: 0px; padding: 0px;">[2]</strong>. Liếc nhìn hàng cuối cùng của cửa sổ <em style="margin: 0px; padding: 0px;">Output</em>thấy "<em style="margin: 0px; padding: 0px;">1 succeeded, 0 failed</em>" nghĩa là đã biên dịch thành công, sẵn sàng chạy chương trình :-)</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-align: center; text-indent: 20px;">
<a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/SourceCodeChaoC.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/SourceCodeChaoC-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px -20px; padding: 1px;" title="Kích vào để phóng to" /> </a><br style="margin: 5px 0px; padding: 0px;" />Hình 9</div>
<h2 id="5" style="color: #42960b; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; margin: 10px 0px 2px; padding: 0px;">
Bước 5. Thực thi chương trình <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#4" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Bước phía trên"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/up.png" style="margin: 0px; padding: 0px;" width="16" /></a> <a href="http://agreenet.vn/baiviet/laptrinh/c/?eq=Ak7wytsN1FiqI4XKkvVUaA==#toc" style="color: #0f5a91; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none;" title="Mục lục bài viết"><img alt="" height="16" src="http://agreenet.vn/Media/baiviet/toc.png" style="margin: 0px; padding: 0px;" width="16" /></a></h2>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Kích chọn <em style="margin: 0px; padding: 0px;">Debug</em> → <em style="margin: 0px; padding: 0px;">Start Debugging</em> (hoặc nhấn phím <em style="margin: 0px; padding: 0px;">F5</em>) để thực thi (chạy) chương trình. Kết quả chỉ đơn giản là một dòng chữ chào mừng màu trắng trên nền đen.</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-align: center; text-indent: 20px;">
<a class="highslide" href="http://agreenet.vn/Media/baiviet/laptrinh/c-start/RunChaoC.png" style="color: #0f5a91; cursor: pointer; margin: 0px; outline: none; padding: 0px; text-decoration: none;"><img alt="" src="http://agreenet.vn/Media/baiviet/laptrinh/c-start/RunChaoC-.png" style="border: 1px solid rgb(204, 204, 204); cursor: url(http://agreenet.vn/Plugin/HighSlide/graphics/zoomin.cur), pointer !important; margin: 0px 0px 0px -20px; padding: 1px;" title="Kích vào để phóng to" /> </a><br style="margin: 5px 0px; padding: 0px;" />Hình 10</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Đến đây coi như xong viết xong một ứng dụng C đơn giản nhất trên Visual C++ 2010 Express. Để làm các bài tập khác về C, chỉ đơn giản thay đổi nội dung chương trình ở vùng [1] trong bước 3 (Viết mã và Biên dịch chương trình).</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Chúc các bạn sinh viên có một sự khởi đầu suôn sẻ.</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Chúc mọi người học lập trình vui :-)</div>
<div style="margin-bottom: 5px; margin-top: 5px; padding: 0px; text-indent: 20px;">
Visual C++</div>
</div>
</div>
</div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-34910630045811148812013-11-02T04:35:00.000-07:002013-11-02T04:35:21.347-07:00mãi mãi một tình yêumãi mãi một tình yêuPhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-36275443194605357832013-10-30T21:09:00.003-07:002013-11-02T05:06:15.469-07:00Thủ thuật Blogspot - Tạo readmore <h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>Thalointe xin giới thiệu đến các bạn thủ thuật tạo readmore, tiện ích này sẽ rút ngắn bài viết của bạn ở trang chủ, tạo cho blog của bạn gọn và đẹp hơn.</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>Vào Template - Edit HTML, Expand widget, tìm đến thẻ <data:post.body/> và thay nó bằng đoạn code sau:</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><b:if cond='data:blog.pageType != &quot;item&quot;'></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><div expr:id='&quot;summary&quot; + data:post.id'><data:post.body/></div></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><script type='text/javascript'>createSummaryAndThumb(&quot;summary<data:post.id/>&quot;);</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i></script></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><span class='rmlink' style='float:right;padding-top:20px;'></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><a expr:href='data:post.url'> &#187;&#187;&#160;&#160; read more</a></span></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i></b:if></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><b:if cond='data:blog.pageType == &quot;item&quot;'><data:post.body/></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i></b:if></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>Ngoài ra bạn còn phải cho đoạn code dưới đây vào phần HEAD (<head> ... </head>) của template:</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><script type='text/javascript'> var thumbnail_mode = &quot;no-float&quot; ; summary_noimg = 430; summary_img = 340; img_thumb_height = 100; img_thumb_width = 120; </script></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><script type='text/javascript'></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>//<![CDATA[</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>function removeHtmlTag(strx,chop){</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>if(strx.indexOf("<")!=-1)</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>{</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>var s = strx.split("<");</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>for(var i=0;i<s.length;i++){</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>if(s[i].indexOf(">")!=-1){</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>}</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>}</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>strx = s.join("");</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>}</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>chop = (chop < strx.length-1) ? chop : strx.length-2;</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>strx = strx.substring(0,chop-1);</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>return strx+'...';</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>}</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>function createSummaryAndThumb(pID){</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>var div = document.getElementById(pID);</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>Â</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>var imgtag = "";</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>var img = div.getElementsByTagName("img");</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>var summ = summary_noimg;</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>if(img.length>=1) {</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>imgtag = '<span style="float:left; padding:0px 10px 5px 0px;"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></span>';</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>summ = summary_img;</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>}</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>var summary = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>';</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>div.innerHTML = summary;</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>}</i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i>//]]></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i><br /></i></span></h3>
<h3 class="post-title entry-title" style="margin: 0px; position: relative;">
<span style="font-family: Times New Roman, Times, FreeSerif, serif; font-size: small;"><i></script></i></span></h3>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com1tag:blogger.com,1999:blog-6417374826664977718.post-73347099287219807742013-10-30T10:50:00.001-07:002013-10-30T10:50:59.314-07:00đưa file PDF lên blogger<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/8KzUkN0GW8M?feature=player_embedded' frameborder='0'></iframe></div>
<br />PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-70241565901785836392013-10-30T10:49:00.001-07:002013-10-30T10:49:28.463-07:00video hướng dẫn thiết kế blogger bằng artstarteer<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/biFGX3DrH7M?feature=player_embedded' frameborder='0'></iframe></div>
<br />PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-87111460645083742932013-10-27T21:51:00.003-07:002013-10-30T09:52:34.594-07:00Giáo trình AVR<iframe src="https://docs.google.com/file/d/0Bz1TneV6yOIlcXk5aGh1dVVwNGM/preview" width="600" height="640"></iframe>PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-13064860209461967652013-10-25T08:26:00.001-07:002013-10-25T08:26:58.019-07:00L & C Meter (PIC16F84A based)<h2>
<center>
<span style="color: red; font-family: LUCIDA HANDWRITING;"><u>L & C Meter (PIC16F84A based)</u></span></center>
</h2>
No self respecting electronics experimenter these days should be without an LC (inductance/capacitance) measuring meter.<br />There are several good designs around; I can thoroughly recommend the product of "electronics - diy" in New York.<br />If you have a need for such a device I suggest you buy theirs immediately!<br />Its good value for money, compact, easy to use etc.<br />The website you need is:<br /><br /><a href="http://electronics-diy.com/lc_meter.php">"electronics - DIY.com" </a><br /><br />Additionally they will also supply various sections, to allow an experimenter to construct his own<br />This is exactly what I did, I purchased the pre programmed PIC microcontroller (for abt $US7) and used recycled componentry locally sourced the rest of the electronic hardware.<br />The enclosure is a metal box salvaged from discarded PC towers, being the switch mode power supply of the computer.<br />Simply remove the internals (circuit board, fan etc) and you have a 6" x 6" x 3" sized metal box with IEC mains entry connector - ready for re-use.<br />Blank off any larger holes with scrap metal material.<br />I have used wire-wrap sockets mounted on a s.r.b.p. (synthetic resin bonded paper) matrix board to facilitate construction of the "electronics" hardware.<br />The following explains some theory and pictures of my particular "build"<br />I dispensed with the LCD "contrast" pot' (less than full contrast makes and LCD difficult to see), but included a 200 ohm series "bright" control to reduce the brightness of the display.<br /><br />I now wonder how I ever managed without such an instrument ?<br />Previously inductances were merely guess work (by looking at their physical size i.e. RF chokes etc, and capacitors were disgarded if the manufacturers markings had become obscured.)<br />Now you can easily measure, all kinds of recycled inductors and capacitors and grade/sort/label them, for future re-use.<br />I had a lot of bakelite encased silver-mica capacitors, which are highly regarded (long life, temp' stability, RF performance, voltage (surge) rating etc) but not of much use if you didn't know their value!<br /><br /><img src="http://www.vk6fh.com/vk6fh/lc_meter_pic16f84b.PNG" /><br /><br /><img src="http://www.vk6fh.com/vk6fh/lc_meter_pixc.png" /><br /><br />This is one of the most accurate and simplest LC inductance / capacitance Meters that one can find, yet one that you can easily build yourself.<br />This LC Meter allows to measure incredibly small inductances starting from 10nH to 1000nH,<br />1uH to 1000uH,<br />1mH to 100mH<br />and capacitance from 0.1pF up to 900nF.<br />LC Meter's circuit uses an auto ranging system so that way you do not need to spend time selecting ranges manually.<br />Another neat function is the "Zero Out" switch that will reset the initial inductance / capacitance, making sure that the final readings of the LC Meter are as accurate as possible.<br />Now let's use the above theory and apply it to electronics.<br />The LC Meter uses a popular LM311 IC that that functions as a frequency generator and this is exactly what we need.<br />If we want to calculate the value of an unknown inductor we use a known Ccal 1000pF capacitor and the value of an unknown inductor.<br />LM311 will generate a frequency that we can measure with a frequency meter.<br />Once we have this information we can use the frequency formula to calculate the inductance.<br />The same thing can be done for calculating the value of a unknown capacitor.<br />This time we don't know the value a capacitor so instead we use the value of a known inductor to calculate the frequency. Once we have that information we apply the formula to determine the capacitance.<br />All this sounds great, however if we want to determine the value of a lot of inductors / capacitors then this may become a very time consuming process.<br />Sure, we can write a computer program to do all these calculations, but what if we don't have an access to a computer or a frequency meter?<br />That's were PIC16F84A microchip comes handy.<br />PIC16F84A is like a small computer that can execute HEX programs that are written using an assembly language.<br />PIC16F84A is a very flexible microchip because it has PINs which can be configured as inputs and outputs.<br />Besides that, PIC16F84A IC requires very minimal number of external components like 4MHz crystal / resonator and few resistors depending on what project we are building.<br />Before we can use PIC16F84A microchip we have to program it with a HEX code which has to be sent from the computer.<br />In the next step we use the frequency generated by LM311 IC and pass it on to PIC16F84A's PIN 17. We designate this PIN as an input, as well as all other PINs that are directly connected to switches and jumpers.<br />User can use these inputs to tell the microchip to execute specified set of instructions or perform calculations.<br />Once the microchip will calculate the unknown inductance or capacitance it will use PINs that are designated as outputs and pass the results on to the 16 character LCD display.<br /><br />LC Meter's Technical Specifications:<br /><br />Voltage Supply: 7.5 - 15V<br />Accuracy: 1%<br />Zero Out Switch<br />Automatic Ranging<br /><br />LC Meter's Inductance Measurement Ranges:<br />- 10nH - 1000nH<br />- 1uH - 1000uH<br />- 1mH - 100mH<br /><br />LC Meter's Capacitance Measurement Ranges:<br />- 0.1pF - 1000pF<br />- 1nF - 900nF<br /><br />LC Meter's Switches & Jumpers<br /><br />SW1 - Zero out the readings.<br />SW2 - Capacitance / Inductance switch.<br />J1 - used by 16x2 two line character LCD displays.<br />J2 - displays the initial frequency of the LM311 oscillator which should be around 550KHz.<br /><br />Most of the character LCD displays have 14 or 16 PINs.<br />The displays that do have a backlight have 16 PINs and displays that do not have a backlight have 14 PINs.<br />The PINs that are highlighted in green in the table below are the ones that PIC16F84A uses to pass the output information represented in bits (0/1).<br /><br /><br /><br />
<table align="center" bgcolor="#666666" border="0" cellpadding="0" cellspacing="1" style="width: 410px;"><tbody>
<tr><td height="81" width="482"><table align="center" bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="1" style="width: 410px;"><tbody>
<tr><td height="81" width="482"><table align="center" bgcolor="#F9F9F9" border="0" style="width: 495px;"><tbody>
<tr><td bgcolor="#FFFFCC" width="53"><div align="center">
<strong>PIN</strong></div>
</td><td bgcolor="#FFFFCC" width="100"><div align="center">
<strong>Symbol</strong></div>
</td><td bgcolor="#FFFFCC" width="252"><div align="center">
<strong>Function</strong></div>
</td><td bgcolor="#FFFFCC" width="72"><div align="center">
<strong>States</strong></div>
</td></tr>
<tr><td bgcolor="#FFFFFF"><div align="center">
1</div>
</td><td bgcolor="#FFFFFF"><div align="center">
VSS</div>
</td><td bgcolor="#FFFFFF"><div align="center">
GND</div>
</td><td bgcolor="#FFFFFF"><div align="center">
-</div>
</td></tr>
<tr><td bgcolor="#FFFFFF"><div align="center">
2</div>
</td><td bgcolor="#FFFFFF"><div align="center">
VDD</div>
</td><td bgcolor="#FFFFFF"><div align="center">
VCC +5V</div>
</td><td bgcolor="#FFFFFF"><div align="center">
+</div>
</td></tr>
<tr><td bgcolor="#FFFFFF"><div align="center">
3</div>
</td><td bgcolor="#FFFFFF"><div align="center">
VO</div>
</td><td bgcolor="#FFFFFF"><div align="center">
Contrast Adjustment</div>
</td><td bgcolor="#FFFFFF"><div align="center">
+/-</div>
</td></tr>
<tr bgcolor="#E9FFD5"><td><div align="center">
4</div>
</td><td><div align="center">
RS</div>
</td><td><div align="center">
Register Select</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr bgcolor="#FFFFFF"><td><div align="center">
5</div>
</td><td><div align="center">
R/W</div>
</td><td><div align="center">
Read / Write</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr bgcolor="#E9FFD5"><td><div align="center">
6</div>
</td><td bgcolor="#E9FFD5"><div align="center">
E</div>
</td><td><div align="center">
Enable Signal</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr><td><div align="center">
7</div>
</td><td><div align="center">
DB0</div>
</td><td><div align="center">
Data Bit 0</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr><td><div align="center">
8</div>
</td><td><div align="center">
DB1</div>
</td><td><div align="center">
Data Bit 1</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr><td><div align="center">
9</div>
</td><td><div align="center">
DB2</div>
</td><td><div align="center">
Data Bit 2</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr><td><div align="center">
10</div>
</td><td><div align="center">
DB3</div>
</td><td><div align="center">
Data Bit 3</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr bgcolor="#E9FFD5"><td><div align="center">
11</div>
</td><td><div align="center">
DB4</div>
</td><td><div align="center">
Data Bit 4</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr bgcolor="#E9FFD5"><td height="15"><div align="center">
12</div>
</td><td><div align="center">
DB5</div>
</td><td><div align="center">
Data Bit 5</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr bgcolor="#E9FFD5"><td><div align="center">
13</div>
</td><td><div align="center">
DB6</div>
</td><td><div align="center">
Data Bit 6</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr bgcolor="#E9FFD5"><td><div align="center">
14</div>
</td><td><div align="center">
DB7</div>
</td><td><div align="center">
Data Bit 7</div>
</td><td><div align="center">
H/L</div>
</td></tr>
<tr><td bgcolor="#FFFFFF"><div align="center">
15</div>
</td><td bgcolor="#FFFFFF"><div align="center">
</div>
</td><td bgcolor="#FFFFFF"><div align="center">
LED Backlight VCC +5V</div>
</td><td bgcolor="#FFFFFF"><div align="center">
+</div>
</td></tr>
<tr><td bgcolor="#FFFFFF"><div align="center">
16</div>
</td><td bgcolor="#FFFFFF"><div align="center">
</div>
</td><td bgcolor="#FFFFFF"><div align="center">
LED Backlight GND</div>
</td><td bgcolor="#FFFFFF"><div align="center">
-</div>
</td></tr>
</tbody></table>
</td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<br /><br /><span style="color: #0080ff; font-family: Arial; font-size: small;"><b>The theory behind the measurements</b></span>This section will involve maths and theory.<br />The LC – meter is actually an LC oscillator based around the familiar comparator circuit LM 311.<br />We are now dealing with an LC oscillator. The oscillating part is a parallel LC tank.<br />We will use the well known parallel resonance formula (see formula 1. below).<br /><img src="http://www.vk6fh.com/vk6fh/form1.PNG" /><br />The formula say that if you connect an inductor parallel with a capacitor, it will have a resonance frequency (f).<br /><strong>L</strong> is the inductance in the resonance circuit.<br /><strong>C</strong> is the total capacitance in the resonance circuit.<br /><br />If we connect an unknown capacitor called Cx parallel to C, we will get a lower resonance frequency (f2), due to the increased capacitance.<br />The formula would then look like this:<br /><img src="http://www.vk6fh.com/vk6fh/form2.PNG" /><br />As you see, we have a new resonance frequency (f2) and you can see how Cx has been added to C.<br /><br />Now divide f1 with f2. (<em>formula 3.</em>)<br /><img src="http://www.vk6fh.com/vk6fh/form3.PNG" /><br />The inductance (<strong>L</strong>) in the formula has disappeared!<br />We now have a relationship between capacitances and frequency. (<em>formula 4.</em>)<br /><br />So what does formula 4 show anyway?<br />Well, if we know the value of C, and we can measure f1 and f2, we will be able to use formula 4 to calculate Cx.<br /><br />C is equal to all the parallel capacitance in the LC tank, but we do not know the C of the construction do we?<br />No we do not, but by making a calibration with a well known Cx, we can go backward and calculate C.<br />Before any measurement can be done, the LC meter need to perform a calibration to find out the constant value of C.<br />To find C, we use the formula 4 and break out C. (<em>formula 5.</em>)<br /><br />The procedure start to measure f1 when only C exist.<br />Then we add a <strong>well known</strong> capacitor Cx (<em>reference capacitor</em>) to the LC unit and measure the frequency again (f2).<br /><img src="http://www.vk6fh.com/vk6fh/form4.PNG" /><br />Since we know Cx (<em>reference capacitor</em>) and we have measured both f1 and f2, the micro controller will be able to calculate the constant value of C.<br /><br />The procedure above is called the <strong>calibration phase</strong>.<br />In reality it is very easy, all you need to do is to press a button called calibrate and the micro controller handles it all for you!<br /><br />What is important is that you use a very good capacitor for the calibration, else you will add error to measurement.<br />In my construction I use 1 nF 0.5%. The calibration capacitor will be added automatically with a relay. (more info later)<br /><br />Now, when the micro controller knows the constant value of C, you can use formula 4 to measure any unknown capacitor at Cx.<br /><br /><strong>Practical example:</strong><br />To make this even more understandable, I will make a small calculation example to verify the <strong>calibration formula</strong>:<br /><br />When I have no capacitor (<strong>Cx</strong>) connected to my LC-oscillator, I measure 610331Hz.<br />I connect a well known capacitor (<strong>Cx</strong>) of <strong>1 nF</strong> 0.5% to the LC-oscillator and now the frequency drop to 508609 Hz.<br /><br />Let’s use the calibration formula 5, above to calculate the value of <strong>C</strong> in the LC unit.<br />f1 = 610331, f2 = 508609 Hz, Cx = 440pF. The formula gives <strong>C</strong> to be <strong>1 nF</strong>.<br />(<em>remember that C is constant and equal to all the parallel capacitance in the LC tank</em>)<br /><br />Now, when I know <strong>C</strong>, let’s check if our calculation is correct.<br />In my measuring example I had an inductor of 68uH in the LC-oscillator.<br />I use the parallel resonance formula 1 :<br />When no <strong>Cx</strong> capacitor is connected I have L= 68uH and C=1000 pF, this gives resonance frequency = 610 331 Hz<br />When <strong>Cx</strong> capacitor is connected I have L= 68uH and C=1000 pF + Cx = 440pF, this gives resonance frequency = 508609 Hz<br />If we compare the calculated frequencies with the measured we can see that the calculation of C = 1000pF was correct. Great!<br /><br />Now when we know the value of <strong>C</strong>, we can use formula 4, to measure any unknown value of Cx.<br /><br /><strong>Lets look at the theory how to measure inductance.</strong><br />We will still use the parallel resonance formula (<em>formula 1,</em>) but in this case we will add an unknown inductance Lx in serial with the L1.<br /><img src="http://www.vk6fh.com/vk6fh/form5.PNG" /><br />We will have two states.<br />One when we only have the main inductor L1 connected with C, and a second state when we have the extra inductor Lx in serial with L1.<br />As you understand we will get two different resonance frequencies.<br /><br />First state is when I only have L1 connected to C, and the frequency f1 will be produced from the LC-oscillator.<br />Formula 6 show you how I break out L1 from the parallel resonance formula. Only L1 exist. (Lx = 0)<br /><br />Second state is when I add Lx in serial with L1 to form L2. Since the inductance increase the frequency (f2) will be produced from the LC-oscillator.<br />Formula 7 show you how I break out L2 from the parallel resonance formula. L1 and Lx are connected in serial to form L2<br /><br />What we search for is Lx. (<em>formula 8.</em>). I put formula 6 and 7 into formula 8 and get formula 9.<br />After cleaning up we get formula 10. Let's look at this formula in more details. As you can see the main inductor L1 is gone.<br /><br />To measure Lx, we only need to know the C, f1 and f2 of the LC-oscillator.<br />
<li>C will be calculated in the calibration phase (as I described earlier). </li>
<li>f1 will be measured when the input is short circuited. </li>
<li>f2 will be measured when Lx is connected to the input.<br /><br /><strong>Conclusion:</strong><br />It is possible to measure both capacitance and inductance as long as you have an accurate reference capacitor Cx for calibration of your measuring LC-meter.<br />When it is calibrated you can connect either an unknown capacitor or inductor and measure its value. In this construction I have implemented the calibration so you only need to push a button. The microcontroller will then do all the work for you.<br />Once again I have plaigarized heavily in order to produce this article.<br />So credit must go to the following<br /><br /><a href="http://electronics-diy.com/lc_meter.php">Ref 1. Electronics - DIY in New York</a><br /><a href="http://www.rfcandy.biz/communication/imp_lc.html">Ref 2. "RF candy" in Sweden </a><br /><a href="http://gaedtke.name/SubMenu_Messen/C-Messung.htm">Ref 3. Capacitance measurement using soundcard of a PC (in German language)</a><br /><a href="http://gaedtke.name/SubMenu_Messen/L-Messung.htm">Ref 4. Inductance measurement using soundcard of a PC (in German language)</a><br /><br />Addendum Jan 2013<br />If you can't see youself fabricating an example; as per above, then;<br />the Chinese are producing good cheap examples of L-C-F meters.<br />This is typical of many cheap listings found on Ebay: (click to enlarge)<br /><a href="http://www.vk6fh.com/vk6fh/LCmeter-sino1.JPG" target="new"><img border="0" src="http://www.vk6fh.com/vk6fh/LCmeter-sino1.JPG" title="click to enlarge" width="320" /></a></li>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-71415998403054649222013-10-24T10:04:00.002-07:002013-10-24T10:04:52.085-07:00sai số của tụ<span style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px;">C: +/- 0.25pF </span><br style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px; margin: 0px; padding: 0px;" /><span style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px;">D: +/- 0.5pF </span><br style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px; margin: 0px; padding: 0px;" /><span style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px;">F: +/- 1% </span><br style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px; margin: 0px; padding: 0px;" /><span style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px;">M: +/- 2% </span><br style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px; margin: 0px; padding: 0px;" /><span style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px;">J: +/- 5% </span><br style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px; margin: 0px; padding: 0px;" /><span style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px;">K: +/- 10% </span><br style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px; margin: 0px; padding: 0px;" /><span style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px;">M: +/- 20% </span><br style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px; margin: 0px; padding: 0px;" /><span style="background-color: #ececec; color: #333333; font-family: Verdana, 'Lucida Grande', 'Trebuchet MS', Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18.1875px;">Z: -20% +80%</span>PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0tag:blogger.com,1999:blog-6417374826664977718.post-388614764538149522013-10-07T16:29:00.001-07:002013-10-07T16:29:29.936-07:00Download Proteus 8 professional Full Crack mới nhất <h2 class="posttitle icon" style="background-color: white; font-family: Tahoma, Calibri, Verdana, Geneva, sans-serif; font-size: 14px; margin: 0px; padding: 10px;">
Download Proteus 8 professional Full Crack mới nhất </h2>
<div class="content" style="background-color: white; font-family: 'Time New Roman'; font-size: 17px; line-height: 20px; margin: 0px; padding: 0px;">
<div id="post_message_98805" style="margin: 0px; padding: 0px;">
<blockquote class="postcontent restore" style="margin: 0px; padding: 0px 30px 15px; word-wrap: break-word;">
Download <b>Proteus 8</b> Full Crack mới nhất, tải phần mềm vẽ mạch điện tử <b>Proteus 8 professional</b> Full<div style="margin: 0px; padding: 0px; text-align: center;">
<img alt="" border="0" src="http://files.diendanbaclieu.net/2013/T08/img/diendanbaclieu-98805-header-proteus-8.jpg" style="border: 0px; max-width: 800px;" /></div>
<br />Đã là dân điện tử, chắc hiếm bạn nào không biết đến chương trình mô phỏng mạch điện tử nổi tiếng <u>Proteus 8</u>.<br />Đây là chương trình thiết kế mạch nguyên lý, mô phỏng chạy thử, thiết kế mạch in rất trực quan và dễ sử dụng.<br />Khi cài đặt xong chương trình, các công việc bạn cần phải làm gần như rất đơn giản, đó là lựa chọn linh kiện lấy ra sử dụng, kết nối chân linh kiện, kết nối đồng hồ để đo đạc và chạy thử mạch.<br /><br /><br /><div style="margin: 0px; padding: 0px; text-align: center;">
<img alt="" border="0" src="http://files.diendanbaclieu.net/2013/T08/img/diendanbaclieu-98805-proteus-zps8c340178.jpg" style="border: 0px; max-width: 800px;" /><br /><img alt="" border="0" src="http://uploadtak.com/images/v8761_Test.png" style="border: 0px; max-width: 800px;" /></div>
<div>
</div>
</blockquote>
<br />
<blockquote class="postcontent restore" style="margin: 0px; padding: 0px 30px 15px; word-wrap: break-word;">
<div>
<a href="http://adf.ly/X7xNZ" target="_blank">link dowload </a></div>
</blockquote>
</div>
</div>
PhucNgohttp://www.blogger.com/profile/04590002085458377898noreply@blogger.com0