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

<channel>
	<title>HE Qichen&#039;s Hackspace</title>
	<atom:link href="http://heqichen.cn/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://heqichen.cn/wp</link>
	<description>DE BH4CQF K</description>
	<lastBuildDate>Sun, 01 May 2022 11:50:39 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8</generator>
	<item>
		<title>WIP: Linux Timer Interrupt</title>
		<link>http://heqichen.cn/wp/wip-linux-timer-interrupt/</link>
		<comments>http://heqichen.cn/wp/wip-linux-timer-interrupt/#comments</comments>
		<pubDate>Mon, 25 Apr 2022 18:13:57 +0000</pubDate>
		<dc:creator><![CDATA[heqichen]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://heqichen.cn/wp/?p=1053</guid>
		<description><![CDATA[<p>/proc/timer_list 1. Kernel Config: set CONFIG_TIMER_STATS=y Collect kernel timers statistics. can use /proc/timer_stats 2. Using Linux interval timer 3. Accessing SPI 4. Accessing I2C reference: [1]. https://elinux.org/Kernel_Timer_Systems [2]. https://forum.armbian.com/topic/1901-patch-for-quick-interrupt-handling-on-the-h3-fast-gpio/ [3]. https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842191/Linux+GIC+Driver, the documentation of linux interrupt controller [4]. http://cs.brown.edu/courses/csci1680/s22/content/threads2.pdf --- TODO: # Isolating CPUs Using tuned's isolated_cores Option The initial mechanism for isolating CPUs is [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/wip-linux-timer-interrupt/">WIP: Linux Timer Interrupt</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>/proc/timer_list</p>
<p>1. Kernel Config:<br />
set CONFIG_TIMER_STATS=y Collect kernel timers statistics. can use /proc/timer_stats</p>
<p>2. Using Linux interval timer</p>
<p>3. Accessing SPI</p>
<p>4. Accessing I2C</p>
<p>reference:<br />
[1]. https://elinux.org/Kernel_Timer_Systems<br />
[2]. https://forum.armbian.com/topic/1901-patch-for-quick-interrupt-handling-on-the-h3-fast-gpio/<br />
[3]. https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842191/Linux+GIC+Driver, the documentation of linux interrupt controller<br />
[4]. http://cs.brown.edu/courses/csci1680/s22/content/threads2.pdf</p>
<p>---</p>
<p>TODO:<br />
# Isolating CPUs Using tuned's isolated_cores Option</p>
<p>The initial mechanism for isolating CPUs is specifying the boot parameter isolcpus=cpulist<br />
use [cat /proc/cmdline] to see the boot argument</p>
<p>https://forum.armbian.com/topic/12922-how-can-i-set-isolated-cpu-on-orange-pi-zero/</p>
<p>https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_for_real_time/7/html/tuning_guide/isolating_cpus_using_tuned-profiles-realtime</p>
<p>https://forum.armbian.com/topic/1901-patch-for-quick-interrupt-handling-on-the-h3-fast-gpio/</p>
<p>https://forum.armbian.com/topic/1885-rt-patches-for-sun8i-kernel/</p>
<p># https://0xax.gitbooks.io/linux-insides/content/Timers/linux-timers-4.html<br />
# https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842191/Linux+GIC+Driver, the documentation of linux interrupt controller<br />
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_for_real_time/7/html/reference_guide/chap-hardware_interrupts</p>
<p># https://www.kernel.org/doc/html/v4.14/driver-api/spi.html, SPI programming</p>
<p># setitimer</p>
<p># SPI</p>
<p>https://github.com/azorg/spi/blob/master/spi.c</p>
<p># I2C</p>
<p>https://elinux.org/Interfacing_with_I2C_Devices</p>
<div class="pvc_clear"></div>
<p class="pvc_stats" element-id="1053">3,980&nbsp;total views, 6&nbsp;views today</p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/wip-linux-timer-interrupt/">WIP: Linux Timer Interrupt</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heqichen.cn/wp/wip-linux-timer-interrupt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3D打印机械臂</title>
		<link>http://heqichen.cn/wp/3d%e6%89%93%e5%8d%b0%e6%9c%ba%e6%a2%b0%e8%87%82/</link>
		<comments>http://heqichen.cn/wp/3d%e6%89%93%e5%8d%b0%e6%9c%ba%e6%a2%b0%e8%87%82/#comments</comments>
		<pubDate>Tue, 28 Jan 2020 18:28:21 +0000</pubDate>
		<dc:creator><![CDATA[heqichen]]></dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Hacker]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://heqichen.cn/wp/?p=1026</guid>
		<description><![CDATA[<p>&#160; &#160; 话说2018年春节的时候，3d打印了一个机械臂。 还是老样子，在纸上先画一个机械臂大概的形状   在CAD中画出具体参数，看看用什么养的配置比较合适，作业半径会是多少。  确定参数就可以开始做三维建模。 一步一步开始搭建机械臂的每个部分。 底座 &#160; 第一关节 第二关节 第三关节，上面可以安装夹具 所有的配件就是这些 &#160; &#160; 机械手臂上当然是要有手了 XD 用机械手来帮你选一瓶饮料 还是再切一个合适的手给机械臂 当然机械臂也可以很欢乐 7,024&#160;total views, 2&#160;views today</p>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/3d%e6%89%93%e5%8d%b0%e6%9c%ba%e6%a2%b0%e8%87%82/">3D打印机械臂</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>&nbsp;</p>
<p>话说2018年春节的时候，3d打印了一个机械臂。</p>
<p>还是老样子，在纸上先画一个机械臂大概的形状</p>
<p><a style="font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2020/01/01.-微信图片_20200129003823.jpg"><img class="alignnone size-large wp-image-1027" alt="01. 微信图片_20200129003823" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/01.-微信图片_20200129003823-768x1024.jpg" width="625" height="833" /></a><span style="font-size: 1rem;"> </span></p>
<p>在CAD中画出具体参数，看看用什么养的配置比较合适，作业半径会是多少。<a style="font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2020/01/02.-IMG_20180217_171804.jpg"><img class="alignnone size-large wp-image-1028" alt="02. IMG_20180217_171804" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/02.-IMG_20180217_171804.jpg" width="625" height="351" /></a><span style="font-size: 1rem;"> </span></p>
<p>确定参数就可以开始做三维建模。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/03.-IMG_20181231_150924.jpg"><img class="alignnone size-large wp-image-1029" alt="03. IMG_20181231_150924" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/03.-IMG_20181231_150924.jpg" width="625" height="351" /></a></p>
<p>一步一步开始搭建机械臂的每个部分。<br />
<span id="more-1026"></span><br />
底座</p>
<p>&nbsp;</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/04.-IMG_20180218_022221.jpg"><img class="alignnone size-large wp-image-1030" alt="04. IMG_20180218_022221" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/04.-IMG_20180218_022221.jpg" width="625" height="351" /></a></p>
<p>第一关节</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/05.-IMG_20180219_020454.jpg"><img class="alignnone size-large wp-image-1031" alt="05. IMG_20180219_020454" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/05.-IMG_20180219_020454-576x1024.jpg" width="576" height="1024" /></a></p>
<p>第二关节</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/06.-IMG_20180219_115319.jpg"><img class="alignnone size-large wp-image-1032" alt="06. IMG_20180219_115319" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/06.-IMG_20180219_115319-576x1024.jpg" width="576" height="1024" /></a></p>
<p>第三关节，上面可以安装夹具</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/07.-IMG_20180221_171606.jpg"><img class="alignnone size-large wp-image-1033" alt="07. IMG_20180221_171606" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/07.-IMG_20180221_171606-575x1024.jpg" width="575" height="1024" /></a></p>
<p>所有的配件就是这些</p>
<p>&nbsp;</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/08.-DSCF0624.jpg"><img class="alignnone size-large wp-image-1034" alt="08. DSCF0624" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/08.-DSCF0624-1024x575.jpg" width="625" height="350" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/09.-DSCF0626.jpg"><img class="alignnone size-large wp-image-1035" alt="09. DSCF0626" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/09.-DSCF0626.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/10.-DSCF0627.jpg"><img class="alignnone size-large wp-image-1036" alt="10. DSCF0627" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/10.-DSCF0627.jpg" width="625" height="416" /></a></p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/11.-roboticArm.gif"><img class="alignnone size-large wp-image-1037" alt="11. roboticArm" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/11.-roboticArm.gif" width="500" height="750" /></a></p>
<p>&nbsp;</p>
<p>机械手臂上当然是要有手了 XD</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/12.-DSCF2028.jpg"><img class="alignnone size-large wp-image-1038" alt="12. DSCF2028" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/12.-DSCF2028-682x1024.jpg" width="625" height="938" /></a></p>
<p>用机械手来帮你选一瓶饮料</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/13.-DSCF1981.jpg"><img class="alignnone size-large wp-image-1039" alt="13. DSCF1981" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/13.-DSCF1981.jpg" width="625" height="468" /></a></p>
<p>还是再切一个合适的手给机械臂</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/14.-DSCF2039.jpg"><img class="alignnone size-large wp-image-1040" alt="14. DSCF2039" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/14.-DSCF2039.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/15.-DSCF2046.jpg"><img class="alignnone size-large wp-image-1041" alt="15. DSCF2046" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/15.-DSCF2046-575x1024.jpg" width="575" height="1024" /></a></p>
<p>当然机械臂也可以很欢乐</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2020/01/16.-IMG_20180424_185649.jpg"><img class="alignnone size-large wp-image-1042" alt="16. IMG_20180424_185649" src="http://heqichen.cn/wp/wp-content/uploads/2020/01/16.-IMG_20180424_185649-576x1024.jpg" width="576" height="1024" /></a><br />
<iframe src="http://player.youku.com/embed/XNDUyNTczMDEyOA==" height="498" width="510" allowfullscreen="" frameborder="0"></iframe>
<div class="pvc_clear"></div>
<p class="pvc_stats" element-id="1026">7,024&nbsp;total views, 2&nbsp;views today</p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/3d%e6%89%93%e5%8d%b0%e6%9c%ba%e6%a2%b0%e8%87%82/">3D打印机械臂</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heqichen.cn/wp/3d%e6%89%93%e5%8d%b0%e6%9c%ba%e6%a2%b0%e8%87%82/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自制纸夹 &#124; 3D 打印</title>
		<link>http://heqichen.cn/wp/%e8%87%aa%e5%88%b6%e7%ba%b8%e5%a4%b9-3d-%e6%89%93%e5%8d%b0/</link>
		<comments>http://heqichen.cn/wp/%e8%87%aa%e5%88%b6%e7%ba%b8%e5%a4%b9-3d-%e6%89%93%e5%8d%b0/#comments</comments>
		<pubDate>Sun, 15 Dec 2019 09:09:32 +0000</pubDate>
		<dc:creator><![CDATA[heqichen]]></dc:creator>
				<category><![CDATA[Hacker]]></category>

		<guid isPermaLink="false">http://heqichen.cn/wp/?p=1011</guid>
		<description><![CDATA[<p>看看自己的网站，已经四年没有更新了，好像这几年上班之后就没有什么成果了。看来要重新振作起来做点事情了。先把scrum跑起来吧。为了把scrum card能够放在自己的脸前面，缺一个纸夹，那就做一个！ 先随手在纸上画一下看看最终会长成什么样。    然后就可以在3D软件里面开始画，首先画个球 &#62;.&#60; 然后把它搞成蛋状。尺寸就按照刚刚随手画的图来 再在边上画个环 把它移到正确的位置上，表示夹住纸的空缺部分。 切出放纸的凹槽 同样把下半部分蛋去掉 简简单单的纸夹就画好了，送去打印。 开始打印 完成 这样scrum card可以放在纸夹上面，提醒最主要的事情是什么。          完~ 5,548&#160;total views, 1&#160;views today</p>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/%e8%87%aa%e5%88%b6%e7%ba%b8%e5%a4%b9-3d-%e6%89%93%e5%8d%b0/">自制纸夹 | 3D 打印</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p style="text-align: left;">看看自己的网站，已经四年没有更新了，好像这几年上班之后就没有什么成果了。看来要重新振作起来做点事情了。先把scrum跑起来吧。为了把scrum card能够放在自己的脸前面，缺一个纸夹，那就做一个！</p>
<p style="text-align: left;">先随手在纸上画一下看看最终会长成什么样。  <img class="alignnone size-large wp-image-1014" style="font-size: 1rem;" alt="IMG_20191215_141625" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/IMG_20191215_141625-1024x575.jpg" width="625" height="350" /></p>
<p style="text-align: left;"> 然后就可以在3D软件里面开始画，首先画个球 &gt;.&lt;</p>
<p style="text-align: left;"><img class="alignnone size-large wp-image-1020" style="font-size: 1rem;" alt="1. sphere" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/1.-sphere.png" width="586" height="447" /></p>
<p style="text-align: left;">然后把它搞成蛋状。尺寸就按照刚刚随手画的图来</p>
<p><span id="more-1011"></span></p>
<p style="text-align: left;"><img class="alignnone size-full wp-image-1021" style="font-size: 1rem;" alt="2. 3gg" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/2.-3gg.png" width="702" height="613" /></p>
<p style="text-align: left;">再在边上画个环</p>
<p style="text-align: left;"><img class="alignnone size-large wp-image-1022" style="font-size: 1rem;" alt="3. ring" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/3.-ring.png" width="583" height="479" /></p>
<p style="text-align: left;"><span style="font-size: 1rem;">把它移到正确的位置上，表示夹住纸的空缺部分。</span></p>
<p style="text-align: left;"><img class="alignnone size-large wp-image-1016" style="font-size: 1rem;" alt="4. position ring" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/4.-position-ring.png" width="580" height="501" /></p>
<p style="text-align: left;">切出放纸的凹槽</p>
<p style="text-align: left;"><img class="alignnone size-large wp-image-1017" alt="5. cut paper" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/5.-cut-paper.png" width="514" height="382" /></p>
<p style="text-align: left;">同样把下半部分蛋去掉</p>
<p style="text-align: left;"><img class="alignnone size-large wp-image-1018" alt="6. cut base" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/6.-cut-base.png" width="421" height="476" /></p>
<p style="text-align: left;">简简单单的纸夹就画好了，送去打印。</p>
<p style="text-align: left;"><img class="alignnone size-large wp-image-1019" alt="7. flashforge" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/7.-flashforge.png" width="625" height="343" /></p>
<p style="text-align: left;">开始打印</p>
<p style="text-align: left;"><img class="alignnone size-large wp-image-1013" alt="IMG_20191215_141547" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/IMG_20191215_141547-1024x576.jpg" width="625" height="351" /></p>
<p style="text-align: left;">完成</p>
<p style="text-align: left;"><img class="alignnone size-large wp-image-1015" alt="IMG_20191215_163042" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/IMG_20191215_163042-1024x575.jpg" width="625" height="350" /></p>
<p style="text-align: left;">这样scrum card可以放在纸夹上面，提醒最主要的事情是什么。</p>
<p style="text-align: left;"><img class="alignnone size-large wp-image-1012" alt="IMG_20191215_163303" src="http://heqichen.cn/wp/wp-content/uploads/2019/12/IMG_20191215_163303-1024x575.jpg" width="625" height="350" /></p>
<p style="text-align: left;"> <span style="font-size: 1rem;"> </span><span style="font-size: 1rem;"> </span><span style="font-size: 1rem;"> </span><span style="font-size: 1rem;"> </span><span style="font-size: 1rem;"> </span><span style="font-size: 1rem;"> </span><span style="font-size: 1rem;"> </span><span style="font-size: 1rem;"> 完~</span></p>
<div class="pvc_clear"></div>
<p class="pvc_stats" element-id="1011">5,548&nbsp;total views, 1&nbsp;views today</p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/%e8%87%aa%e5%88%b6%e7%ba%b8%e5%a4%b9-3d-%e6%89%93%e5%8d%b0/">自制纸夹 | 3D 打印</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heqichen.cn/wp/%e8%87%aa%e5%88%b6%e7%ba%b8%e5%a4%b9-3d-%e6%89%93%e5%8d%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GH60 折腾之三 &#124; GH60 hacks part3</title>
		<link>http://heqichen.cn/wp/gh60-hacks-part3/</link>
		<comments>http://heqichen.cn/wp/gh60-hacks-part3/#comments</comments>
		<pubDate>Fri, 04 Mar 2016 17:14:27 +0000</pubDate>
		<dc:creator><![CDATA[heqichen]]></dc:creator>
				<category><![CDATA[Hacker]]></category>
		<category><![CDATA[gh60]]></category>
		<category><![CDATA[gh60 mods]]></category>
		<category><![CDATA[keyboard]]></category>

		<guid isPermaLink="false">http://heqichen.cn/wp/?p=990</guid>
		<description><![CDATA[<p>上回说到，我已经把GH60的程序搞定了。显然这是不够的，GH60的便携性不应该只体现在键盘上，于是从网上淘来了USB hub模块。 既然键盘是USB接口的，有了USB hub就可以在键盘里面藏更多的东西，真正变成geek的利器。 &#160; 在键盘上找到VCC GND USB_D+ USB_D-，看上去C8应该是个滤波电容，两边应该就是vcc 和 gnd了，用飞飞线把USB引到hub上。键盘原本的USB就不能在继续使用了，必须封掉 &#160; &#160; &#160; 随便找来一根USB线，用这根线作为键盘的数据线了，原本GH60的设计是从键盘的上方出线，但这个脑残的设计让键盘使用十分不方便，键盘前方必须留出距离走线，而我习惯是从侧面，也就是左边出线，因为右侧是要鼠标的地方。 &#160; &#160; 夹好杜邦头，这样以后维修起来就方便了。 找到合适的位置打孔，可以让USB线从中间穿过。 &#160; 大致就是这样，因为还要加USB设备，所以先用难看的纸胶带临时固定一下。 显然只在键盘里放USB hub是不够的，下面就是最近发现性价比极高的pcm2704   之所以找到pcm2704是因为前段时间用笔记本放音乐的时候一直有讨厌的噪音，播放钢琴的时候特别明显特别讨厌，所以想找找有没有适合的外置DAC，后来找了一圈之后发现Pcm2704实在是太好了，便宜又好用。 把同样把DAC接到HUB上。 同样找到合适的位置掏洞，把耳机插口露出来，后来发现GH60壳体实在太厚，手头有没有外置式的3.5耳机接口 T.T 只能把洞掏的无比巨大。。 固定好DAC，今天就可以到这里了。   上好螺丝，打完收工  &#160; 在键盘里面藏个USB hub的可玩性太高了，以后外出就不必要鼠标键盘都往电脑上插，直接一把键盘搞定。 同时，也想过在键盘里面放nanopi 或着BBB，一把键盘走天下了。 7,143&#160;total views, 1&#160;views today</p>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/gh60-hacks-part3/">GH60 折腾之三 | GH60 hacks part3</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>上回说到，我已经把GH60的程序搞定了。显然这是不够的，GH60的便携性不应该只体现在键盘上，于是从网上淘来了USB hub模块。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_001559.jpg"><img alt="IMG_20160302_001559" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_001559-1024x768.jpg" width="625" height="468" /></a></p>
<p>既然键盘是USB接口的，有了USB hub就可以在键盘里面藏更多的东西，真正变成geek的利器。</p>
<p><span id="more-990"></span></p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_003439.jpg"><img alt="IMG_20160302_003439" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_003439-1024x768.jpg" width="625" height="468" /></a></p>
<p>&nbsp;</p>
<p>在键盘上找到VCC GND USB_D+ USB_D-，看上去C8应该是个滤波电容，两边应该就是vcc 和 gnd了，用飞飞线把USB引到hub上。键盘原本的USB就不能在继续使用了，必须封掉</p>
<p>&nbsp;</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_003445.jpg"><img alt="IMG_20160302_003445" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_003445-1024x768.jpg" width="625" height="468" /></a></p>
<p>&nbsp;</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_003807.jpg"><img alt="IMG_20160302_003807" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_003807-1024x768.jpg" width="625" height="468" /></a></p>
<p>&nbsp;</p>
<p>随便找来一根USB线，用这根线作为键盘的数据线了，原本GH60的设计是从键盘的上方出线，但这个脑残的设计让键盘使用十分不方便，键盘前方必须留出距离走线，而我习惯是从侧面，也就是左边出线，因为右侧是要鼠标的地方。</p>
<p>&nbsp;</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_004510.jpg"><img alt="IMG_20160302_004510" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_004510-1024x768.jpg" width="625" height="468" /></a></p>
<p>&nbsp;</p>
<p>夹好杜邦头，这样以后维修起来就方便了。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_005039.jpg"><img alt="IMG_20160302_005039" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_005039-1024x768.jpg" width="625" height="468" /></a></p>
<p>找到合适的位置打孔，可以让USB线从中间穿过。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_005347.jpg"><img alt="IMG_20160302_005347" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160302_005347-1024x767.jpg" width="625" height="468" /></a></p>
<p>&nbsp;</p>
<p>大致就是这样，因为还要加USB设备，所以先用难看的纸胶带临时固定一下。</p>
<p>显然只在键盘里放USB hub是不够的，下面就是最近发现性价比极高的pcm2704</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_005002.jpg"><img alt="IMG_20160304_005002" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_005002-1024x768.jpg" width="625" height="468" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_004957.jpg"><img alt="IMG_20160304_004957" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_004957-1024x768.jpg" width="625" height="468" /></a></p>
<p>之所以找到pcm2704是因为前段时间用笔记本放音乐的时候一直有讨厌的噪音，播放钢琴的时候特别明显特别讨厌，所以想找找有没有适合的外置DAC，后来找了一圈之后发现Pcm2704实在是太好了，便宜又好用。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_010204.jpg"><img alt="IMG_20160304_010204" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_010204-1024x768.jpg" width="625" height="468" /></a></p>
<p>把同样把DAC接到HUB上。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_013221.jpg"><img alt="IMG_20160304_013221" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_013221-1024x768.jpg" width="625" height="468" /></a></p>
<p>同样找到合适的位置掏洞，把耳机插口露出来，后来发现GH60壳体实在太厚，手头有没有外置式的3.5耳机接口 T.T</p>
<p>只能把洞掏的无比巨大。。</p>
<p><img class="alignnone size-large wp-image-991" alt="IMG_20160304_012636" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_012636-1024x768.jpg" width="625" height="468" /></p>
<p>固定好DAC，今天就可以到这里了。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_013307.jpg"><img class="alignnone size-large wp-image-1004" alt="IMG_20160304_013307" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_013307-1024x768.jpg" width="625" height="468" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_013256.jpg"><img class="alignnone size-large wp-image-1005" alt="IMG_20160304_013256" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_013256-1024x768.jpg" width="625" height="468" /></a></p>
<p>上好螺丝，打完收工 <a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_013216.jpg"><img class="alignnone size-large wp-image-1007" alt="IMG_20160304_013216" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160304_013216-1024x768.jpg" width="625" height="468" /></a></p>
<p>&nbsp;</p>
<p>在键盘里面藏个USB hub的可玩性太高了，以后外出就不必要鼠标键盘都往电脑上插，直接一把键盘搞定。</p>
<p>同时，也想过在键盘里面放nanopi 或着BBB，一把键盘走天下了。
<div class="pvc_clear"></div>
<p class="pvc_stats" element-id="990">7,143&nbsp;total views, 1&nbsp;views today</p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/gh60-hacks-part3/">GH60 折腾之三 | GH60 hacks part3</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heqichen.cn/wp/gh60-hacks-part3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GH60 折腾之二 &#124; GH60 Hacks Part2</title>
		<link>http://heqichen.cn/wp/gh60-hacks-part2/</link>
		<comments>http://heqichen.cn/wp/gh60-hacks-part2/#comments</comments>
		<pubDate>Tue, 01 Mar 2016 14:52:28 +0000</pubDate>
		<dc:creator><![CDATA[heqichen]]></dc:creator>
				<category><![CDATA[Hacker]]></category>

		<guid isPermaLink="false">http://heqichen.cn/wp/?p=987</guid>
		<description><![CDATA[<p>上回书说到，我已经把所有的按键装好了，键盘的体位也调到了比较舒适的姿势，接下来就是给键盘编程了。 &#160; 话说刚收到GH60 PCB的时候，看到上面印着一个s开头的网址，十分欣喜。虽然淘宝的页面上面没有任何刷机教程，没有任何的连接，但是至少这东西有个官网在，应该可以找到资料。然而，看到后缀是.cn的，顿时心凉了一半。。这个不是国外的个人作品么，怎么有中文的网址，难道是国内的抄袭板？别抄一半改一半啊。 果不其然，上了网站没有找到任何有用的信息。。无奈开始谷歌。 其实，网上能找到很多在网页上配置配列，然后可以直接下载固件的做法，但是都无法做到鼠标的控制，backspace分开，shift分开。 最终找到了kairyu在github上的代码，终于能够使用了，我fork在了我自己的repo里面，方便自己开发。 我的代码地址： https://github.com/heqichen/tmk_keyboard_custom https://github.com/heqichen/tmk_core_custom 修改的地方主要在 tmk_keyboard_custom 这个项目当中。 1. tmk_keyboard_custom/keyboard/gh60/keymap_heqichen.c 增加了这个文件，这个文件中是我自己的配列。代码中定义的HHKB可以在keymap_common.h里面找到，kairyu中的HHKB定义是有bug的是有bug的是有bug的。。我一个一个对下来才发现错在哪里。。。 2. tmk_keyboard_custom/keyboard/gh60/Makefile 增加了以下两行 REV = CHN KEYMAP = heqichen CHN的作用就是指定这是GH60的中国版，KEYMAP指定了我的键盘配列，会自动找到keymap_heqichen.c去编译。 其实网上很多做法在make命令后面根这两个参数也是可以的，只是我比较懒，把他们直接写到了makefile里面。 经过这番折腾，终于把GH60用起来了。 现在的问题是 1. 鼠标的移动不是平滑连续的，而是一卡一卡像按键一样，这点nano75要做的好很多。 2. 现在GH60没有办法控制音量，包括audio想相关HID命令和Volume的相关HID命令都没有办法执行。 有时间我把这些问题解决掉。 &#160; 10,840&#160;total views, 2&#160;views today</p>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/gh60-hacks-part2/">GH60 折腾之二 | GH60 Hacks Part2</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>上回书说到，我已经把所有的按键装好了，键盘的体位也调到了比较舒适的姿势，接下来就是给键盘编程了。</p>
<p><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8224.jpg"><img class="alignnone size-large wp-image-982" alt="IMG_8224" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8224-1024x682.jpg" width="625" height="416" /></a></p>
<p>&nbsp;</p>
<p>话说刚收到GH60 PCB的时候，看到上面印着一个s开头的网址，十分欣喜。虽然淘宝的页面上面没有任何刷机教程，没有任何的连接，但是至少这东西有个官网在，应该可以找到资料。然而，看到后缀是.cn的，顿时心凉了一半。。这个不是国外的个人作品么，怎么有中文的网址，难道是国内的抄袭板？别抄一半改一半啊。</p>
<p>果不其然，上了网站没有找到任何有用的信息。。无奈开始谷歌。</p>
<p><span id="more-987"></span></p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160301_222751.jpg"><img class="alignnone size-large wp-image-988" alt="IMG_20160301_222751" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_20160301_222751-1024x768.jpg" width="625" height="468" /></a></p>
<p>其实，网上能找到很多在网页上配置配列，然后可以直接下载固件的做法，但是都无法做到鼠标的控制，backspace分开，shift分开。</p>
<p>最终找到了kairyu在github上的代码，终于能够使用了，我fork在了我自己的repo里面，方便自己开发。</p>
<p>我的代码地址：</p>
<p><a href="https://github.com/heqichen/tmk_keyboard_custom">https://github.com/heqichen/tmk_keyboard_custom</a></p>
<p><a href="https://github.com/heqichen/tmk_core_custom">https://github.com/heqichen/tmk_core_custom</a></p>
<p>修改的地方主要在 tmk_keyboard_custom 这个项目当中。</p>
<p>1. tmk_keyboard_custom/keyboard/gh60/<strong>keymap_heqichen.c</strong></p>
<p>增加了这个文件，这个文件中是我自己的配列。代码中定义的HHKB可以在keymap_common.h里面找到，kairyu中的HHKB定义是有bug的是有bug的是有bug的。。我一个一个对下来才发现错在哪里。。。</p>
<p>2. tmk_keyboard_custom/keyboard/gh60/<strong>Makefile</strong></p>
<p>增加了以下两行</p>
<p>REV = CHN<br />
KEYMAP = heqichen</p>
<p>CHN的作用就是指定这是GH60的中国版，KEYMAP指定了我的键盘配列，会自动找到keymap_heqichen.c去编译。</p>
<p>其实网上很多做法在make命令后面根这两个参数也是可以的，只是我比较懒，把他们直接写到了makefile里面。</p>
<p>经过这番折腾，终于把GH60用起来了。</p>
<p>现在的问题是</p>
<p>1. 鼠标的移动不是平滑连续的，而是一卡一卡像按键一样，这点nano75要做的好很多。</p>
<p>2. 现在GH60没有办法控制音量，包括audio想相关HID命令和Volume的相关HID命令都没有办法执行。</p>
<p>有时间我把这些问题解决掉。</p>
<p>&nbsp;
<div class="pvc_clear"></div>
<p class="pvc_stats" element-id="987">10,840&nbsp;total views, 2&nbsp;views today</p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/gh60-hacks-part2/">GH60 折腾之二 | GH60 Hacks Part2</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heqichen.cn/wp/gh60-hacks-part2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GH60折腾 &#124; GH60 hacks</title>
		<link>http://heqichen.cn/wp/gh60-hacks/</link>
		<comments>http://heqichen.cn/wp/gh60-hacks/#comments</comments>
		<pubDate>Mon, 29 Feb 2016 17:38:12 +0000</pubDate>
		<dc:creator><![CDATA[heqichen]]></dc:creator>
				<category><![CDATA[Hacker]]></category>

		<guid isPermaLink="false">http://heqichen.cn/wp/?p=972</guid>
		<description><![CDATA[<p>GH60 已经是我入的第四把机械键盘了，之所以会有GH60完全是因为nano75把我习惯完全变成了vim风格，方向键已经离不开字母区了。nano75虽然是便携式键盘，但是每天挤地铁还带着nano75的话还是有点不方便。所以还是选择了在单位放一把键盘。在家里放一把键盘。 所以新的键盘一定是完全可编程的，这次就更加激进的选择了没有F区域的键盘。 淘宝上选了一圈，最终选择了s开头的一款 PCB。用了五脚青轴。 焊接到没遇到什么困难，只是把按钮插进去的时候实在是麻烦。PCB上的安装孔实在太小，把按钮往里查的时候相当于硬把塑料挂掉一层，按得我手指抽筋，最终没办法，把所有的安装孔都用电钻扩了一遍。但是这样的结果就是，没有量好塑料支撑脚的直径，PCB上的安装孔扩了太大了，无脚变成了三脚-_-。。。受力只靠两个焊点，按钮就有些摇晃，正常情况下就需要用定位板来解决摇晃的问题，但是没有买定位板。只能将就了。  配列上选择了把backspace一分为二，把右shift再分多一个键的方案。 最终装好之后发现塑料外壳没有撑脚，键盘的角度太低，打字不舒服。 网上找来这些仪器撑脚装在了塑料壳上 选择好合适的位置打孔。 &#160; 装完支撑脚，用起来舒服多了。 至于颜色-_- 我自己也看不下去了。。。在买键帽的店里选择了R4的四个键帽，结果发过来的是R1的。。。无奈，我也不想再和店家沟通，再其他店买了两个R4的键帽装了上去，颜色就变成了现在这样 &#160; 给键盘刷配置也是恨这疼的过程，明天继续。。。 3,940&#160;total views, no views today</p>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/gh60-hacks/">GH60折腾 | GH60 hacks</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>GH60 已经是我入的第四把机械键盘了，之所以会有GH60完全是因为nano75把我习惯完全变成了vim风格，方向键已经离不开字母区了。nano75虽然是便携式键盘，但是每天挤地铁还带着nano75的话还是有点不方便。所以还是选择了在单位放一把键盘。在家里放一把键盘。</p>
<p>所以新的键盘一定是完全可编程的，这次就更加激进的选择了没有F区域的键盘。</p>
<p>淘宝上选了一圈，最终选择了s开头的一款 PCB。用了五脚青轴。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8224.jpg"><img class="alignnone size-large wp-image-982" alt="IMG_8224" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8224-1024x682.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8230.jpg"><img class="alignnone size-large wp-image-980" alt="IMG_8230" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8230-1024x682.jpg" width="625" height="416" /></a></p>
<p>焊接到没遇到什么困难，只是把按钮插进去的时候实在是麻烦。PCB上的安装孔实在太小，把按钮往里查的时候相当于硬把塑料挂掉一层，按得我手指抽筋，最终没办法，把所有的安装孔都用电钻扩了一遍。但是这样的结果就是，没有量好塑料支撑脚的直径，PCB上的安装孔扩了太大了，无脚变成了三脚-_-。。。受力只靠两个焊点，按钮就有些摇晃，正常情况下就需要用定位板来解决摇晃的问题，但是没有买定位板。只能将就了。</p>
<p><span id="more-972"></span></p>
<p><a style="font-size: 1rem; line-height: 1.71429;" href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8225.jpg"><img class="alignnone size-large wp-image-981" alt="IMG_8225" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8225-1024x768.jpg" width="625" height="468" /></a></p>
<p><span style="font-size: 1rem; line-height: 1.71429;"> </span><span style="line-height: 1.71429; font-size: 1rem;">配列上选择了把backspace一分为二，把右shift再分多一个键的方案。</span></p>
<p>最终装好之后发现塑料外壳没有撑脚，键盘的角度太低，打字不舒服。<br />
<a style="font-size: 1rem; line-height: 1.71429;" href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8235.jpg"><img class="alignnone size-large wp-image-976" alt="IMG_8235" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8235-1024x682.jpg" width="625" height="416" /></a></p>
<p>网上找来这些仪器撑脚装在了塑料壳上</p>
<p><a style="font-size: 1rem; line-height: 1.71429;" href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8231.jpg"><img class="alignnone size-large wp-image-979" alt="IMG_8231" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8231-1024x768.jpg" width="625" height="468" /></a></p>
<p>选择好合适的位置打孔。</p>
<p><a style="font-size: 1rem; line-height: 1.71429;" href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8233.jpg"><img class="alignnone size-large wp-image-978" alt="IMG_8233" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8233-1024x682.jpg" width="625" height="416" /></a></p>
<p><a style="font-size: 1rem; line-height: 1.71429;" href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8234.jpg"><img class="alignnone size-large wp-image-977" alt="IMG_8234" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8234-1024x682.jpg" width="625" height="416" /></a></p>
<p><a style="font-size: 1rem; line-height: 1.71429;" href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8237.jpg"><img class="alignnone size-large wp-image-975" alt="IMG_8237" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8237-1024x682.jpg" width="625" height="416" /></a><a style="font-size: 1rem; line-height: 1.71429;" href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8244.jpg"><img class="alignnone size-large wp-image-974" alt="IMG_8244" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8244-1024x767.jpg" width="625" height="468" /></a></p>
<p>&nbsp;</p>
<p>装完支撑脚，用起来舒服多了。</p>
<p><span style="line-height: 1.71429; font-size: 1rem;">至于颜色-_-</span></p>
<p>我自己也看不下去了。。。在买键帽的店里选择了R4的四个键帽，结果发过来的是R1的。。。无奈，我也不想再和店家沟通，再其他店买了两个R4的键帽装了上去，颜色就变成了现在这样</p>
<p><a style="font-size: 1rem; line-height: 1.71429;" href="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8248.jpg"><img class="alignnone size-large wp-image-973" alt="IMG_8248" src="http://heqichen.cn/wp/wp-content/uploads/2016/03/IMG_8248-1024x682.jpg" width="625" height="416" /></a></p>
<p>&nbsp;</p>
<p>给键盘刷配置也是恨这疼的过程，明天继续。。。
<div class="pvc_clear"></div>
<p class="pvc_stats" element-id="972">3,940&nbsp;total views, no views today</p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/gh60-hacks/">GH60折腾 | GH60 hacks</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heqichen.cn/wp/gh60-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>荣誉之战</title>
		<link>http://heqichen.cn/wp/battle_for_honor/</link>
		<comments>http://heqichen.cn/wp/battle_for_honor/#comments</comments>
		<pubDate>Thu, 19 Nov 2015 17:35:04 +0000</pubDate>
		<dc:creator><![CDATA[heqichen]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://heqichen.cn/wp/?p=953</guid>
		<description><![CDATA[<p>&#160; 第一季6期的荣誉之战终于杀青了，从夏天拍到了冬天。 看看导播室里的工作场景。 刚刚停电恢复，好几个摄像机还是黑屏。 为了游戏的需要，连夜修改程序。 看到一个通信的大家伙，就是天线比较粗，比较长。 屏幕上显示了一些射频的参数，不知道是发送什么。 5,106&#160;total views, no views today</p>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/battle_for_honor/">荣誉之战</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>第一季6期的荣誉之战终于杀青了，从夏天拍到了冬天。</p>
<p>看看导播室里的工作场景。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_6855.jpg"><img class="alignnone size-large wp-image-954" alt="IMG_6855" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_6855-1024x682.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_6863.jpg"><img class="alignnone size-large wp-image-955" alt="IMG_6863" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_6863-1024x682.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_6886.jpg"><img class="alignnone size-large wp-image-956" alt="IMG_6886" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_6886-1024x682.jpg" width="625" height="416" /></a></p>
<p><span id="more-953"></span>刚刚停电恢复，好几个摄像机还是黑屏。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_7022.jpg"><img class="alignnone size-large wp-image-957" alt="IMG_7022" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_7022-1024x682.jpg" width="625" height="416" /></a></p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_7078.jpg"><img class="alignnone size-large wp-image-958" alt="IMG_7078" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_7078-1024x683.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_7241.jpg"><img class="alignnone size-large wp-image-959" alt="IMG_7241" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_7241-1024x682.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151016_231007.jpg"><img class="alignnone size-large wp-image-960" alt="IMG_20151016_231007" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151016_231007-1024x768.jpg" width="625" height="468" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151016_231500.jpg"><img class="alignnone size-large wp-image-961" alt="IMG_20151016_231500" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151016_231500-1024x768.jpg" width="625" height="468" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151017_100805.jpg"><img class="alignnone size-large wp-image-962" alt="IMG_20151017_100805" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151017_100805-1024x768.jpg" width="625" height="468" /></a></p>
<p>为了游戏的需要，连夜修改程序。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151024_010241.jpg"><img class="alignnone size-large wp-image-965" alt="IMG_20151024_010241" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151024_010241-1024x768.jpg" width="625" height="468" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151024_150443.jpg"><img class="alignnone size-large wp-image-966" alt="IMG_20151024_150443" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151024_150443-1024x768.jpg" width="625" height="468" /></a></p>
<p>看到一个通信的大家伙，就是天线比较粗，比较长。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151107_164634.jpg"><img class="alignnone size-large wp-image-967" alt="IMG_20151107_164634" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151107_164634-768x1024.jpg" width="625" height="833" /></a></p>
<p>屏幕上显示了一些射频的参数，不知道是发送什么。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151107_164642.jpg"><img class="alignnone size-large wp-image-968" alt="IMG_20151107_164642" src="http://heqichen.cn/wp/wp-content/uploads/2015/11/IMG_20151107_164642-1024x768.jpg" width="625" height="468" /></a>
<div class="pvc_clear"></div>
<p class="pvc_stats" element-id="953">5,106&nbsp;total views, no views today</p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/battle_for_honor/">荣誉之战</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heqichen.cn/wp/battle_for_honor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>又拍电视了-荣誉之战 第一季第一集</title>
		<link>http://heqichen.cn/wp/battle-for-honor-s1e1/</link>
		<comments>http://heqichen.cn/wp/battle-for-honor-s1e1/#comments</comments>
		<pubDate>Sun, 18 Oct 2015 14:58:37 +0000</pubDate>
		<dc:creator><![CDATA[heqichen]]></dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://heqichen.cn/wp/?p=948</guid>
		<description><![CDATA[<p>带着连夜准备的装备来到了崇明的拍摄场地。 对战场地正在布置中 导播室 导播室的装备  帅气的教官 在双方大本营准备上战场的装备 演员马上就要到啦 沫沫和甜甜 许教官 小臭和孙铭 蓝队布置战术 金波在导播室压阵 导播室的幕后英雄阿杜，控制所有战场的进程和数据。 团队合照，真心感谢兄弟们 6,854&#160;total views, 3&#160;views today</p>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/battle-for-honor-s1e1/">又拍电视了-荣誉之战 第一季第一集</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p style="text-align: left;">带着连夜准备的装备来到了崇明的拍摄场地。<a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/外场2.jpg"><img class="alignnone size-large wp-image-913" alt="外场2" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/外场2-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;"><a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/外场.jpg"><img class="alignnone size-large wp-image-912" alt="外场" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/外场-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;">对战场地正在布置中<a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/战场1.jpg"><img class="alignnone size-large wp-image-921" alt="战场" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/战场1-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;">导播室<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/导播4.jpg"><img class="alignnone size-large wp-image-919" alt="导播4" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/导播4-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;"><span id="more-948"></span></p>
<p style="text-align: left;">导播室的装备<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/导播3.jpg"><img class="alignnone size-large wp-image-918" alt="导播3" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/导播3-1024x682.jpg" width="625" height="416" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/导播2.jpg"><img class="alignnone size-large wp-image-917" alt="导播2" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/导播2-1024x682.jpg" width="625" height="416" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/导播1.jpg"><img class="alignnone size-large wp-image-916" alt="导播1" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/导播1-1024x682.jpg" width="625" height="416" /></a><span style="line-height: 1.71429; font-size: 1rem;"> </span></p>
<p style="text-align: left;">帅气的教官<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官2.jpg"><img class="alignnone size-large wp-image-923" alt="教官2" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官2-1024x682.jpg" width="625" height="416" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官.jpg"><img class="alignnone size-large wp-image-922" alt="教官" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官-1024x682.jpg" width="625" height="416" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官3.jpg"><img class="alignnone size-large wp-image-924" alt="教官3" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官3-1024x682.jpg" width="625" height="416" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官4.jpg"><img class="alignnone size-large wp-image-925" alt="教官4" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官4-682x1024.jpg" width="625" height="938" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官5.jpg"><img class="alignnone size-large wp-image-926" alt="教官5" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官5-1024x682.jpg" width="625" height="416" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官6.jpg"><img class="alignnone size-large wp-image-927" alt="教官6" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官6-682x1024.jpg" width="625" height="938" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官7.jpg"><img class="alignnone size-large wp-image-928" alt="教官7" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官7-682x1024.jpg" width="625" height="938" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官8.jpg"><img class="alignnone size-large wp-image-929" alt="教官8" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官8-1024x682.jpg" width="625" height="416" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官9.jpg"><img class="alignnone size-large wp-image-930" alt="教官9" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官9-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;">在双方大本营准备上战场的装备<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/大本营.jpg"><img class="alignnone size-large wp-image-914" alt="大本营" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/大本营-1024x576.jpg" width="625" height="351" /></a></p>
<p style="text-align: left;">演员马上就要到啦<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/战场.jpg"><img class="alignnone size-large wp-image-920" alt="战场" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/战场-1024x682.jpg" width="625" height="416" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官10.jpg"><img class="alignnone size-large wp-image-931" alt="教官10" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/教官10-1024x683.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;">沫沫和甜甜<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员2.jpg"><img class="alignnone size-large wp-image-933" alt="演员2" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员2-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;">许教官<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员1.jpg"><img class="alignnone size-large wp-image-932" alt="演员1" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员1-682x1024.jpg" width="625" height="938" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员4.jpg"><img class="alignnone size-large wp-image-935" alt="演员4" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员4-1024x717.jpg" width="625" height="437" /></a></p>
<p style="text-align: left;">小臭和孙铭<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员3.jpg"><img class="alignnone size-large wp-image-934" alt="演员3" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员3-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;">蓝队布置战术<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员-现场.jpg"><img class="alignnone size-large wp-image-936" alt="演员-现场" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员-现场-1024x768.jpg" width="625" height="468" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员.jpg"><img class="alignnone size-large wp-image-946" alt="演员" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员-1024x768.jpg" width="625" height="468" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员-黄.jpg"><img class="alignnone size-full wp-image-939" alt="演员-黄" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员-黄.jpg" width="960" height="640" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员-蓝.jpg"><img class="alignnone size-full wp-image-938" alt="演员-蓝" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员-蓝.jpg" width="960" height="640" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员-红.jpg"><img class="alignnone size-full wp-image-937" alt="演员-红" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/演员-红.jpg" width="960" height="640" /></a></p>
<p style="text-align: left;">金波在导播室压阵<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/金波.jpg"><img class="alignnone size-large wp-image-943" alt="金波" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/金波-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;"><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/金枪2.jpg"><img class="alignnone size-full wp-image-942" alt="金枪2" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/金枪2.jpg" width="960" height="540" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/金枪.jpg"><img class="alignnone size-large wp-image-941" alt="金枪" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/金枪-1024x682.jpg" width="625" height="416" /></a><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/金枪3.png"><img class="alignnone size-full wp-image-945" alt="金枪3" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/金枪3.png" width="960" height="596" /></a></p>
<p style="text-align: left;"><a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/郭郭.jpg"><img class="alignnone size-full wp-image-940" alt="郭郭" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/郭郭.jpg" width="854" height="640" /></a></p>
<p style="text-align: left;">导播室的幕后英雄阿杜，控制所有战场的进程和数据。<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/导播.jpg"><img class="alignnone size-large wp-image-915" alt="导播" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/导播-1024x576.jpg" width="625" height="351" /></a></p>
<p style="text-align: left;">团队合照，真心感谢兄弟们<a style="line-height: 1.71429; font-size: 1rem;" href="http://heqichen.cn/wp/wp-content/uploads/2015/10/合照.jpg"><img class="alignnone size-large wp-image-911" alt="合照" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/合照-1024x576.jpg" width="625" height="351" /></a><span style="line-height: 1.71429; font-size: 1rem;"><br />
</span></p>
<div class="pvc_clear"></div>
<p class="pvc_stats" element-id="948">6,854&nbsp;total views, 3&nbsp;views today</p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/battle-for-honor-s1e1/">又拍电视了-荣誉之战 第一季第一集</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heqichen.cn/wp/battle-for-honor-s1e1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NanoPI 开箱</title>
		<link>http://heqichen.cn/wp/nanopi-unbox/</link>
		<comments>http://heqichen.cn/wp/nanopi-unbox/#comments</comments>
		<pubDate>Sat, 10 Oct 2015 06:18:08 +0000</pubDate>
		<dc:creator><![CDATA[heqichen]]></dc:creator>
				<category><![CDATA[Hacker]]></category>

		<guid isPermaLink="false">http://heqichen.cn/wp/?p=889</guid>
		<description><![CDATA[<p>NanoPi是FriendlyARM最新推出的一块开发板，因为体积小，引脚也和Raspberry Pi兼容，称之为NanoPi。同时板上搭载wifi和BLE通信芯片，加上最关键的只要99元的价格，可以拔使用多年703n+BBB+arduino的组合整个成一小块板子啦。 盼了好几天，终于盼来了送NanoPI的快递，打开一看发现一个小盒子。顿时眼前一亮。 小盒子的外观像是一本日记本，而不是一般买开发板仅仅见到一个自封袋或者时白色的纸盒包装，国产神器顿时高大上了。 看看背面，印有NanoPi的相关参数 打开在扉页里面印着pinmap，方便查阅引脚功能。 轻轻拿起装有NanoPi的包装。整个盒子里没有说明书，介绍全部印在了包装盒上面，相当简约。 仔细看看NanoPi 现在就要给NanoPi刷上系统了 ：-D 4,725&#160;total views, no views today</p>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/nanopi-unbox/">NanoPI 开箱</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p style="text-align: left;">NanoPi是FriendlyARM最新推出的一块开发板，因为体积小，引脚也和Raspberry Pi兼容，称之为NanoPi。同时板上搭载wifi和BLE通信芯片，加上最关键的只要99元的价格，可以拔使用多年703n+BBB+arduino的组合整个成一小块板子啦。</p>
<p style="text-align: left;">盼了好几天，终于盼来了送NanoPI的快递，打开一看发现一个小盒子。顿时眼前一亮。</p>
<p style="text-align: left;">小盒子的外观像是一本日记本，而不是一般买开发板仅仅见到一个自封袋或者时白色的纸盒包装，国产神器顿时高大上了。<a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2222.jpg"><img class="alignnone size-large wp-image-895" alt="IMG_2222" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2222-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;">看看背面，印有NanoPi的相关参数<a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2225.jpg"><img class="alignnone size-large wp-image-896" alt="IMG_2225" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2225-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;">打开在扉页里面印着pinmap，方便查阅引脚功能。<a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2237.jpg"><img class="alignnone size-large wp-image-897" alt="IMG_2237" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2237-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;"><span id="more-889"></span>轻轻拿起装有NanoPi的包装。整个盒子里没有说明书，介绍全部印在了包装盒上面，相当简约。<a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2258.jpg"><img class="alignnone size-large wp-image-898" alt="IMG_2258" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2258-1024x682.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2260.jpg"><img class="alignnone size-large wp-image-899" alt="IMG_2260" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2260-1024x682.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2270.jpg"><img class="alignnone size-large wp-image-900" alt="IMG_2270" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2270-1024x682.jpg" width="625" height="416" /></a></p>
<p style="text-align: left;">仔细看看NanoPi<a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2274.jpg"><img class="alignnone size-large wp-image-901" alt="IMG_2274" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2274-1024x682.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2277.jpg"><img class="alignnone size-large wp-image-902" alt="IMG_2277" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2277-1024x682.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2284.jpg"><img class="alignnone size-large wp-image-903" alt="IMG_2284" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2284-1024x682.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2311.jpg"><img class="alignnone size-large wp-image-904" alt="IMG_2311" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2311-1024x682.jpg" width="625" height="416" /></a>现在就要给NanoPi刷上系统了 ：-D</p>
<p style="text-align: left;">
<div class="pvc_clear"></div>
<p class="pvc_stats" element-id="889">4,725&nbsp;total views, no views today</p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/nanopi-unbox/">NanoPI 开箱</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heqichen.cn/wp/nanopi-unbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RC522读RFID卡</title>
		<link>http://heqichen.cn/wp/rc522-on-arduino/</link>
		<comments>http://heqichen.cn/wp/rc522-on-arduino/#comments</comments>
		<pubDate>Mon, 05 Oct 2015 10:54:58 +0000</pubDate>
		<dc:creator><![CDATA[heqichen]]></dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Hacker]]></category>

		<guid isPermaLink="false">http://heqichen.cn/wp/?p=879</guid>
		<description><![CDATA[<p>&#160; 为了造一套门禁系统，淘宝上搞来了一套RFID读卡器。 RC522，看上去是比较多的型号，哪家店都买得到。 本来想拔整个模块装进一个接线盒里，但是这尺寸刚刚好，如果放进去就没法盖盖子了。。。无奈，先裸奔。   &#160; Youtube连接：https://www.youtube.com/watch?v=4yIT7Gunn6c 也是网上找来的代码 &#160; #include &#60;SPI.h&#62; #define uchar unsigned char #define uint unsigned int //data array maxium length #define MAX_LEN 16 ///////////////////////////////////////////////////////////////////// //set the pin ///////////////////////////////////////////////////////////////////// const int chipSelectPin = 10; const int NRSTPD = 5; &#160; //MF522 command bits #define PCD_IDLE 0x00 //NO action; cancel current commands #define PCD_AUTHENT [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/rc522-on-arduino/">RC522读RFID卡</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<p>为了造一套门禁系统，淘宝上搞来了一套RFID读卡器。</p>
<p>RC522，看上去是比较多的型号，哪家店都买得到。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_1938.jpg"><img class="alignnone size-large wp-image-880" alt="IMG_1938" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_1938-1024x682.jpg" width="625" height="416" /></a> <a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_1978.jpg"><img class="alignnone size-large wp-image-881" alt="IMG_1978" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_1978-1024x682.jpg" width="625" height="416" /></a></p>
<p><span id="more-879"></span></p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2018.jpg"><img alt="IMG_2018" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2018-1024x682.jpg" width="625" height="416" /></a></p>
<p>本来想拔整个模块装进一个接线盒里，但是这尺寸刚刚好，如果放进去就没法盖盖子了。。。无奈，先裸奔。</p>
<p><a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2012.jpg"><img class="alignnone size-large wp-image-882" alt="IMG_2012" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2012-682x1024.jpg" width="625" height="938" /></a>  <a href="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2029.jpg"><img class="alignnone size-large wp-image-884" alt="IMG_2029" src="http://heqichen.cn/wp/wp-content/uploads/2015/10/IMG_2029-1024x682.jpg" width="625" height="416" /></a></p>
<p>&nbsp;</p>
<p><object width="480" height="400" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" align="middle"><param name="src" value="http://player.youku.com/player.php/sid/XMTM1MjU2Nzk2MA==/v.swf" /><param name="allowfullscreen" value="true" /><param name="quality" value="high" /><param name="allowscriptaccess" value="always" /><embed width="480" height="400" type="application/x-shockwave-flash" src="http://player.youku.com/player.php/sid/XMTM1MjU2Nzk2MA==/v.swf" allowfullscreen="true" quality="high" allowscriptaccess="always" align="middle" /></object></p>
<p>Youtube连接：<a href="https://www.youtube.com/watch?v=4yIT7Gunn6c">https://www.youtube.com/watch?v=4yIT7Gunn6c</a></p>
<p>也是网上找来的代码</p>
<blockquote><p>&nbsp;</p>
<p>#include &lt;SPI.h&gt;</p>
<p>#define uchar unsigned char<br />
#define uint unsigned int</p>
<p>//data array maxium length<br />
#define MAX_LEN 16</p>
<p>/////////////////////////////////////////////////////////////////////<br />
//set the pin<br />
/////////////////////////////////////////////////////////////////////<br />
const int chipSelectPin = 10;<br />
const int NRSTPD = 5;</p>
<p>&nbsp;</p>
<p>//MF522 command bits<br />
#define PCD_IDLE 0x00 //NO action; cancel current commands<br />
#define PCD_AUTHENT 0x0E //verify password key<br />
#define PCD_RECEIVE 0x08 //receive data<br />
#define PCD_TRANSMIT 0x04 //send data<br />
#define PCD_TRANSCEIVE 0x0C //send and receive data<br />
#define PCD_RESETPHASE 0x0F //reset<br />
#define PCD_CALCCRC 0x03 //CRC check and caculation</p>
<p>//Mifare_One card command bits<br />
#define PICC_REQIDL 0x26 //Search the cards that not into sleep mode in the antenna area<br />
#define PICC_REQALL 0x52 //Search all the cards in the antenna area<br />
#define PICC_ANTICOLL 0x93 //prevent conflict<br />
#define PICC_SElECTTAG 0x93 //select card<br />
#define PICC_AUTHENT1A 0x60 //verify A password key<br />
#define PICC_AUTHENT1B 0x61 //verify B password key<br />
#define PICC_READ 0x30 //read<br />
#define PICC_WRITE 0xA0 //write<br />
#define PICC_DECREMENT 0xC0 //deduct value<br />
#define PICC_INCREMENT 0xC1 //charge up value<br />
#define PICC_RESTORE 0xC2 //Restore data into buffer<br />
#define PICC_TRANSFER 0xB0 //Save data into buffer<br />
#define PICC_HALT 0x50 //sleep mode<br />
//THe mistake code that return when communicate with MF522<br />
#define MI_OK 0<br />
#define MI_NOTAGERR 1<br />
#define MI_ERR 2<br />
//------------------MFRC522 register ---------------<br />
//Page 0:Command and Status<br />
#define Reserved00 0x00<br />
#define CommandReg 0x01<br />
#define CommIEnReg 0x02<br />
#define DivlEnReg 0x03<br />
#define CommIrqReg 0x04<br />
#define DivIrqReg 0x05<br />
#define ErrorReg 0x06<br />
#define Status1Reg 0x07<br />
#define Status2Reg 0x08<br />
#define FIFODataReg 0x09<br />
#define FIFOLevelReg 0x0A<br />
#define WaterLevelReg 0x0B<br />
#define ControlReg 0x0C<br />
#define BitFramingReg 0x0D<br />
#define CollReg 0x0E<br />
#define Reserved01 0x0F<br />
//Page 1:Command<br />
#define Reserved10 0x10<br />
#define ModeReg 0x11<br />
#define TxModeReg 0x12<br />
#define RxModeReg 0x13<br />
#define TxControlReg 0x14<br />
#define TxAutoReg 0x15<br />
#define TxSelReg 0x16<br />
#define RxSelReg 0x17<br />
#define RxThresholdReg 0x18<br />
#define DemodReg 0x19<br />
#define Reserved11 0x1A<br />
#define Reserved12 0x1B<br />
#define MifareReg 0x1C<br />
#define Reserved13 0x1D<br />
#define Reserved14 0x1E<br />
#define SerialSpeedReg 0x1F<br />
//Page 2:CFG<br />
#define Reserved20 0x20<br />
#define CRCResultRegM 0x21<br />
#define CRCResultRegL 0x22<br />
#define Reserved21 0x23<br />
#define ModWidthReg 0x24<br />
#define Reserved22 0x25<br />
#define RFCfgReg 0x26<br />
#define GsNReg 0x27<br />
#define CWGsPReg 0x28<br />
#define ModGsPReg 0x29<br />
#define TModeReg 0x2A<br />
#define TPrescalerReg 0x2B<br />
#define TReloadRegH 0x2C<br />
#define TReloadRegL 0x2D<br />
#define TCounterValueRegH 0x2E<br />
#define TCounterValueRegL 0x2F<br />
//Page 3:TestRegister<br />
#define Reserved30 0x30<br />
#define TestSel1Reg 0x31<br />
#define TestSel2Reg 0x32<br />
#define TestPinEnReg 0x33<br />
#define TestPinValueReg 0x34<br />
#define TestBusReg 0x35<br />
#define AutoTestReg 0x36<br />
#define VersionReg 0x37<br />
#define AnalogTestReg 0x38<br />
#define TestDAC1Reg 0x39<br />
#define TestDAC2Reg 0x3A<br />
#define TestADCReg 0x3B<br />
#define Reserved31 0x3C<br />
#define Reserved32 0x3D<br />
#define Reserved33 0x3E<br />
#define Reserved34 0x3F<br />
//-----------------------------------------------</p>
<p>//4 bytes Serial number of card, the 5 bytes is verfiy bytes<br />
uchar serNum[5];</p>
<p>int AUTHED_ID_NUM = 8;</p>
<p>unsigned char AUTHED_ID_LIST[][4] =<br />
{<br />
{0x72, 0xBB, 0x7C, 0x6F},<br />
{0xF1, 0x6D, 0xB3, 0x85},<br />
{0x09, 0x11, 0x8F, 0x87},<br />
{0xCF, 0x9C, 0x24, 0x71},<br />
{0x88, 0x04, 0xBF, 0xC5},<br />
{0x88, 0x04, 0x5D, 0x9E},<br />
{0x88, 0x04, 0xF6, 0x8A},<br />
{0x88, 0x99, 0xA5, 0xCA}<br />
};</p>
<p>char *AUTHED_NAME_LIST[] =<br />
{<br />
"key-chain",<br />
"white-card",<br />
"Shanghai-transport",<br />
"Beijing-transport",<br />
"Guangzhou-Metro",<br />
"Shenzhen-Metro",<br />
"train-ticket #1",<br />
"train-ticket #2"<br />
};</p>
<p>&nbsp;</p>
<p>void setup()<br />
{<br />
Serial.begin(57600);</p>
<p>SPI.begin();</p>
<p>pinMode(chipSelectPin,OUTPUT); // Set digital pin 10 as OUTPUT to connect it to the RFID /ENABLE pin<br />
digitalWrite(chipSelectPin, LOW); // Activate the RFID reader<br />
pinMode(NRSTPD,OUTPUT); // Set digital pin 5 , Not Reset and Power-down</p>
<p>MFRC522_Init();</p>
<p>pinMode(4, OUTPUT);<br />
digitalWrite(4, LOW);<br />
}</p>
<p>void showCardDetail()<br />
{</p>
<p>uchar status;<br />
uchar str[MAX_LEN];<br />
// Show card type<br />
ShowCardType(str);</p>
<p>//Prevent conflict, return the 4 bytes Serial number of the card<br />
status = MFRC522_Anticoll(str);</p>
<p>// str[0..3]: serial number of the card<br />
// str[4]: XOR checksum of the SN.<br />
if (status == MI_OK)<br />
{<br />
Serial.print("The card's number is: ");<br />
memcpy(serNum, str, 5);<br />
ShowCardID(serNum);</p>
<p>// Check people associated with card ID<br />
uchar* id = serNum;<br />
if( id[0]==0x4B &amp;&amp; id[1]==0xE6 &amp;&amp; id[2]==0xD1 &amp;&amp; id[3]==0x3B ) {<br />
Serial.println("Hello Mary!");<br />
} else if(id[0]==0x3B &amp;&amp; id[1]==0xE6 &amp;&amp; id[2]==0xD1 &amp;&amp; id[3]==0x3B) {<br />
Serial.println("Hello Greg!");<br />
}else{<br />
Serial.println("Hello unkown guy!");<br />
}<br />
}</p>
<p>}</p>
<p>unsigned long lastFoundTime = 0;<br />
int lastFoundCard = -1;</p>
<p>void loop()<br />
{</p>
<p>uchar status;<br />
uchar str[MAX_LEN];<br />
// Search card, return card types<br />
status = MFRC522_Request(PICC_REQIDL, str);<br />
if (status != MI_OK)<br />
{<br />
return;<br />
}</p>
<p>//showCardDetail();<br />
status = MFRC522_Anticoll(str);<br />
if (status == MI_OK)<br />
{<br />
memcpy(serNum, str, 5);<br />
uchar* id = serNum;<br />
int authedId = findInAuthedList(id);<br />
if (authedId &gt;= 0)<br />
{<br />
if (lastFoundCard != authedId || (millis() - lastFoundTime) &gt; 2000)<br />
{<br />
Serial.print("Card read: ");<br />
Serial.println(AUTHED_NAME_LIST[authedId]);<br />
lastFoundTime = millis();<br />
digitalWrite(4, HIGH);<br />
delay(50);<br />
digitalWrite(4, LOW);<br />
}</p>
<p>}<br />
else<br />
{<br />
Serial.print("unknown card found: ");<br />
ShowCardID(serNum);<br />
}<br />
lastFoundCard = authedId;<br />
}</p>
<p>MFRC522_Halt(); //command the card into sleep mode</p>
<p>delay(200);<br />
}</p>
<p>int findInAuthedList(uchar *id)<br />
{<br />
int i;<br />
int j;<br />
for (i=0; i&lt;AUTHED_ID_NUM; ++i)<br />
{<br />
for (j=0; j&lt;4; ++j)<br />
{<br />
if (AUTHED_ID_LIST[i][j] != id[j])<br />
{<br />
break;<br />
}<br />
}<br />
if(j &gt;= 4)<br />
{<br />
return i;<br />
}<br />
}<br />
return -1;<br />
}</p>
<p>/*<br />
* Function：ShowCardID<br />
* Description：Show Card ID<br />
* Input parameter：ID string<br />
* Return：Null<br />
*/<br />
void ShowCardID(uchar *id)<br />
{<br />
int IDlen=4;<br />
for(int i=0; i&lt;IDlen; i++){<br />
Serial.print(0x0F &amp; (id[i]&gt;&gt;4), HEX);<br />
Serial.print(0x0F &amp; id[i],HEX);<br />
}<br />
Serial.println("");<br />
}</p>
<p>/*<br />
* Function：ShowCardType<br />
* Description：Show Card type<br />
* Input parameter：Type string<br />
* Return：Null<br />
*/<br />
void ShowCardType(uchar* type)<br />
{<br />
Serial.print("Card type: ");<br />
if(type[0]==0x04&amp;&amp;type[1]==0x00)<br />
Serial.println("MFOne-S50");<br />
else if(type[0]==0x02&amp;&amp;type[1]==0x00)<br />
Serial.println("MFOne-S70");<br />
else if(type[0]==0x44&amp;&amp;type[1]==0x00)<br />
Serial.println("MF-UltraLight");<br />
else if(type[0]==0x08&amp;&amp;type[1]==0x00)<br />
Serial.println("MF-Pro");<br />
else if(type[0]==0x44&amp;&amp;type[1]==0x03)<br />
Serial.println("MF Desire");<br />
else<br />
Serial.println("Unknown");<br />
}</p>
<p>/*<br />
* Function：Write_MFRC5200<br />
* Description：write a byte data into one register of MR RC522<br />
* Input parameter：addr--register address；val--the value that need to write in<br />
* Return：Null<br />
*/<br />
void Write_MFRC522(uchar addr, uchar val)<br />
{<br />
digitalWrite(chipSelectPin, LOW);</p>
<p>//address format：0XXXXXX0<br />
SPI.transfer((addr&lt;&lt;1)&amp;0x7E);<br />
SPI.transfer(val);</p>
<p>digitalWrite(chipSelectPin, HIGH);<br />
}<br />
/*<br />
* Function：Read_MFRC522<br />
* Description：read a byte data into one register of MR RC522<br />
* Input parameter：addr--register address<br />
* Return：return the read value<br />
*/<br />
uchar Read_MFRC522(uchar addr)<br />
{<br />
uchar val;</p>
<p>digitalWrite(chipSelectPin, LOW);</p>
<p>//address format：1XXXXXX0<br />
SPI.transfer(((addr&lt;&lt;1)&amp;0x7E) | 0x80);<br />
val =SPI.transfer(0x00);</p>
<p>digitalWrite(chipSelectPin, HIGH);</p>
<p>return val;<br />
}</p>
<p>/*<br />
* Function：SetBitMask<br />
* Description：set RC522 register bit<br />
* Input parameter：reg--register address;mask--value<br />
* Return：null<br />
*/<br />
void SetBitMask(uchar reg, uchar mask)<br />
{<br />
uchar tmp;<br />
tmp = Read_MFRC522(reg);<br />
Write_MFRC522(reg, tmp | mask); // set bit mask<br />
}<br />
/*<br />
* Function：ClearBitMask<br />
* Description：clear RC522 register bit<br />
* Input parameter：reg--register address;mask--value<br />
* Return：null<br />
*/<br />
void ClearBitMask(uchar reg, uchar mask)<br />
{<br />
uchar tmp;<br />
tmp = Read_MFRC522(reg);<br />
Write_MFRC522(reg, tmp &amp; (~mask)); // clear bit mask<br />
}<br />
/*<br />
* Function：AntennaOn<br />
* Description：Turn on antenna, every time turn on or shut down antenna need at least 1ms delay<br />
* Input parameter：null<br />
* Return：null<br />
*/<br />
void AntennaOn(void)<br />
{<br />
uchar temp;</p>
<p>temp = Read_MFRC522(TxControlReg);<br />
if (!(temp &amp; 0x03))<br />
{<br />
SetBitMask(TxControlReg, 0x03);<br />
}<br />
}<br />
/*<br />
* Function：AntennaOff<br />
* Description：Turn off antenna, every time turn on or shut down antenna need at least 1ms delay<br />
* Input parameter：null<br />
* Return：null<br />
*/<br />
void AntennaOff(void)<br />
{<br />
ClearBitMask(TxControlReg, 0x03);<br />
}<br />
/*<br />
* Function：ResetMFRC522<br />
* Description： reset RC522<br />
* Input parameter：null<br />
* Return：null<br />
*/<br />
void MFRC522_Reset(void)<br />
{<br />
Write_MFRC522(CommandReg, PCD_RESETPHASE);<br />
}<br />
/*<br />
* Function：InitMFRC522<br />
* Description：initilize RC522<br />
* Input parameter：null<br />
* Return：null<br />
*/<br />
void MFRC522_Init(void)<br />
{<br />
digitalWrite(NRSTPD,HIGH);</p>
<p>MFRC522_Reset();</p>
<p>//Timer: TPrescaler*TreloadVal/6.78MHz = 24ms<br />
Write_MFRC522(TModeReg, 0x8D); //Tauto=1; f(Timer) = 6.78MHz/TPreScaler<br />
Write_MFRC522(TPrescalerReg, 0x3E); //TModeReg[3..0] + TPrescalerReg<br />
Write_MFRC522(TReloadRegL, 30);<br />
Write_MFRC522(TReloadRegH, 0);</p>
<p>Write_MFRC522(TxAutoReg, 0x40); //100%ASK<br />
Write_MFRC522(ModeReg, 0x3D); //CRC initilizate value 0x6363 ???</p>
<p>//ClearBitMask(Status2Reg, 0x08); //MFCrypto1On=0<br />
//Write_MFRC522(RxSelReg, 0x86); //RxWait = RxSelReg[5..0]<br />
//Write_MFRC522(RFCfgReg, 0x7F); //RxGain = 48dB</p>
<p>AntennaOn(); //turn on antenna<br />
}<br />
/*<br />
* Function：MFRC522_Request<br />
* Description：Searching card, read card type<br />
* Input parameter：reqMode--search methods，<br />
* TagType--return card types<br />
* 0x4400 = Mifare_UltraLight<br />
* 0x0400 = Mifare_One(S50)<br />
* 0x0200 = Mifare_One(S70)<br />
* 0x0800 = Mifare_Pro(X)<br />
* 0x4403 = Mifare_DESFire<br />
* return：return MI_OK if successed<br />
*/<br />
uchar MFRC522_Request(uchar reqMode, uchar *TagType)<br />
{<br />
uchar status;<br />
uint backBits; //the data bits that received</p>
<p>Write_MFRC522(BitFramingReg, 0x07); //TxLastBists = BitFramingReg[2..0] ???</p>
<p>TagType[0] = reqMode;<br />
status = MFRC522_ToCard(PCD_TRANSCEIVE, TagType, 1, TagType, &amp;backBits);</p>
<p>if ((status != MI_OK) || (backBits != 0x10))<br />
{<br />
status = MI_ERR;<br />
}</p>
<p>return status;<br />
}<br />
/*<br />
* Function：MFRC522_ToCard<br />
* Description：communicate between RC522 and ISO14443<br />
* Input parameter：command--MF522 command bits<br />
* sendData--send data to card via rc522<br />
* sendLen--send data length<br />
* backData--the return data from card<br />
* backLen--the length of return data<br />
* return：return MI_OK if successed<br />
*/<br />
uchar MFRC522_ToCard(uchar command, uchar *sendData, uchar sendLen, uchar *backData, uint *backLen)<br />
{<br />
uchar status = MI_ERR;<br />
uchar irqEn = 0x00;<br />
uchar waitIRq = 0x00;<br />
uchar lastBits;<br />
uchar n;<br />
uint i;</p>
<p>switch (command)<br />
{<br />
case PCD_AUTHENT: //verify card password<br />
{<br />
irqEn = 0x12;<br />
waitIRq = 0x10;<br />
break;<br />
}<br />
case PCD_TRANSCEIVE: //send data in the FIFO<br />
{<br />
irqEn = 0x77;<br />
waitIRq = 0x30;<br />
break;<br />
}<br />
default:<br />
break;<br />
}</p>
<p>Write_MFRC522(CommIEnReg, irqEn|0x80); //Allow interruption<br />
ClearBitMask(CommIrqReg, 0x80); //Clear all the interrupt bits<br />
SetBitMask(FIFOLevelReg, 0x80); //FlushBuffer=1, FIFO initilizate</p>
<p>Write_MFRC522(CommandReg, PCD_IDLE); //NO action;cancel current command ???</p>
<p>//write data into FIFO<br />
for (i=0; i&lt;sendLen; i++)<br />
{<br />
Write_MFRC522(FIFODataReg, sendData[i]);<br />
}</p>
<p>//procceed it<br />
Write_MFRC522(CommandReg, command);<br />
if (command == PCD_TRANSCEIVE)<br />
{<br />
SetBitMask(BitFramingReg, 0x80); //StartSend=1,transmission of data starts<br />
}</p>
<p>//waite receive data is finished<br />
i = 2000; //i should adjust according the clock, the maxium the waiting time should be 25 ms???<br />
do<br />
{<br />
//CommIrqReg[7..0]<br />
//Set1 TxIRq RxIRq IdleIRq HiAlerIRq LoAlertIRq ErrIRq TimerIRq<br />
n = Read_MFRC522(CommIrqReg);<br />
i--;<br />
}<br />
while ((i!=0) &amp;&amp; !(n&amp;0x01) &amp;&amp; !(n&amp;waitIRq));</p>
<p>ClearBitMask(BitFramingReg, 0x80); //StartSend=0</p>
<p>if (i != 0)<br />
{<br />
if(!(Read_MFRC522(ErrorReg) &amp; 0x1B)) //BufferOvfl Collerr CRCErr ProtecolErr<br />
{<br />
status = MI_OK;<br />
if (n &amp; irqEn &amp; 0x01)<br />
{<br />
status = MI_NOTAGERR; //??<br />
}</p>
<p>if (command == PCD_TRANSCEIVE)<br />
{<br />
n = Read_MFRC522(FIFOLevelReg);<br />
lastBits = Read_MFRC522(ControlReg) &amp; 0x07;<br />
if (lastBits)<br />
{<br />
*backLen = (n-1)*8 + lastBits;<br />
}<br />
else<br />
{<br />
*backLen = n*8;<br />
}</p>
<p>if (n == 0)<br />
{<br />
n = 1;<br />
}<br />
if (n &gt; MAX_LEN)<br />
{<br />
n = MAX_LEN;<br />
}</p>
<p>//read the data from FIFO<br />
for (i=0; i&lt;n; i++)<br />
{<br />
backData[i] = Read_MFRC522(FIFODataReg);<br />
}<br />
}<br />
}<br />
else<br />
{<br />
status = MI_ERR;<br />
}</p>
<p>}</p>
<p>//SetBitMask(ControlReg,0x80); //timer stops<br />
//Write_MFRC522(CommandReg, PCD_IDLE);</p>
<p>return status;<br />
}<br />
/*<br />
* Function：MFRC522_Anticoll<br />
* Description：Prevent conflict, read the card serial number<br />
* Input parameter：serNum--return the 4 bytes card serial number, the 5th byte is recheck byte<br />
* return：return MI_OK if successed<br />
*/<br />
uchar MFRC522_Anticoll(uchar *serNum)<br />
{<br />
uchar status;<br />
uchar i;<br />
uchar serNumCheck=0;<br />
uint unLen;</p>
<p>//ClearBitMask(Status2Reg, 0x08); //strSensclear<br />
//ClearBitMask(CollReg,0x80); //ValuesAfterColl<br />
Write_MFRC522(BitFramingReg, 0x00); //TxLastBists = BitFramingReg[2..0]</p>
<p>serNum[0] = PICC_ANTICOLL;<br />
serNum[1] = 0x20;<br />
status = MFRC522_ToCard(PCD_TRANSCEIVE, serNum, 2, serNum, &amp;unLen);</p>
<p>if (status == MI_OK)<br />
{<br />
//Verify card serial number<br />
for (i=0; i&lt;4; i++)<br />
{<br />
serNumCheck ^= serNum[i];<br />
}<br />
if (serNumCheck != serNum[i])<br />
{<br />
status = MI_ERR;<br />
}<br />
}</p>
<p>//SetBitMask(CollReg, 0x80); //ValuesAfterColl=1</p>
<p>return status;<br />
}<br />
/*<br />
* Function：CalulateCRC<br />
* Description：Use MF522 to caculate CRC<br />
* Input parameter：pIndata--the CRC data need to be read，len--data length，pOutData-- the caculated result of CRC<br />
* return：Null<br />
*/<br />
void CalulateCRC(uchar *pIndata, uchar len, uchar *pOutData)<br />
{<br />
uchar i, n;</p>
<p>ClearBitMask(DivIrqReg, 0x04); //CRCIrq = 0<br />
SetBitMask(FIFOLevelReg, 0x80); //Clear FIFO pointer<br />
//Write_MFRC522(CommandReg, PCD_IDLE);</p>
<p>//Write data into FIFO<br />
for (i=0; i&lt;len; i++)<br />
{<br />
Write_MFRC522(FIFODataReg, *(pIndata+i));<br />
}<br />
Write_MFRC522(CommandReg, PCD_CALCCRC);</p>
<p>//waite CRC caculation to finish<br />
i = 0xFF;<br />
do<br />
{<br />
n = Read_MFRC522(DivIrqReg);<br />
i--;<br />
}<br />
while ((i!=0) &amp;&amp; !(n&amp;0x04)); //CRCIrq = 1</p>
<p>//read CRC caculation result<br />
pOutData[0] = Read_MFRC522(CRCResultRegL);<br />
pOutData[1] = Read_MFRC522(CRCResultRegM);<br />
}</p>
<p>&nbsp;</p>
<p>/*<br />
* Function：MFRC522_Write<br />
* Description：write block data<br />
* Input parameters：blockAddr--block address;writeData--Write 16 bytes data into block<br />
* return：return MI_OK if successed<br />
*/<br />
uchar MFRC522_Write(uchar blockAddr, uchar *writeData)<br />
{<br />
uchar status;<br />
uint recvBits;<br />
uchar i;<br />
uchar buff[18];</p>
<p>buff[0] = PICC_WRITE;<br />
buff[1] = blockAddr;<br />
CalulateCRC(buff, 2, &amp;buff[2]);<br />
status = MFRC522_ToCard(PCD_TRANSCEIVE, buff, 4, buff, &amp;recvBits);</p>
<p>if ((status != MI_OK) || (recvBits != 4) || ((buff[0] &amp; 0x0F) != 0x0A))<br />
{<br />
status = MI_ERR;<br />
}</p>
<p>if (status == MI_OK)<br />
{<br />
for (i=0; i&lt;16; i++) //Write 16 bytes data into FIFO<br />
{<br />
buff[i] = *(writeData+i);<br />
}<br />
CalulateCRC(buff, 16, &amp;buff[16]);<br />
status = MFRC522_ToCard(PCD_TRANSCEIVE, buff, 18, buff, &amp;recvBits);</p>
<p>if ((status != MI_OK) || (recvBits != 4) || ((buff[0] &amp; 0x0F) != 0x0A))<br />
{<br />
status = MI_ERR;<br />
}<br />
}</p>
<p>return status;<br />
}<br />
/*<br />
* Function：MFRC522_Halt<br />
* Description：Command the cards into sleep mode<br />
* Input parameters：null<br />
* return：null<br />
*/<br />
void MFRC522_Halt(void)<br />
{<br />
uchar status;<br />
uint unLen;<br />
uchar buff[4];</p>
<p>buff[0] = PICC_HALT;<br />
buff[1] = 0;<br />
CalulateCRC(buff, 2, &amp;buff[2]);</p>
<p>status = MFRC522_ToCard(PCD_TRANSCEIVE, buff, 4, buff,&amp;unLen);<br />
}</p></blockquote>
<div class="pvc_clear"></div>
<p class="pvc_stats" element-id="879">6,633&nbsp;total views, no views today</p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="http://heqichen.cn/wp/rc522-on-arduino/">RC522读RFID卡</a> appeared first on <a rel="nofollow" href="http://heqichen.cn/wp">HE Qichen&#039;s Hackspace</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heqichen.cn/wp/rc522-on-arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
