Monday, April 27, 2009

adopt an ... attitude to sth. 对...的态度
faith is believing what you know aint so. 信仰就是相信你明知道不是的东西。(mark twains)
 

Wednesday, April 22, 2009

大克鼎

铸刻的铭文告知我们:大克鼎的最初主人是克,西周孝王(距今两千八百多年)时的膳夫,专管周天子的饮食,属于“天官”。克的祖父师华父是周室重臣,辅弼王 室,德厚功高。周天子感念师华父的功绩,就任命克为出传王命、入达下情的宫廷大臣。官职爵禄世袭,单传嫡长子、孙。克知道自己的一切都得之祖父的余荫,于 是作了这个大鼎,用来祭祀祖父师华父。这铭文是周天子把土地赏给臣民的记录,对于西周的土地制度、社会制度的研究,都提供了极其珍贵的史料。
潘达于女士捐赠。
本家姓丁的潘达于出生官宦人家,1923年嫁入苏州潘家,成为潘祖荫的孙媳妇。潘氏当时家境殷实,家藏丰 富,有“滂喜斋”专藏珍本书籍和“攀古楼”专藏青铜器。虽然家中有万宝,但她坚守祖训:“谨守护持、绝不示人。”抗日战争期间,她在家人协助下,将包括大 盂鼎、大克鼎在内的家藏珍贵器物深埋在地下,书画及部分古董则安放在隐蔽的隔间中。由于安排周密,日军多次冲进潘家,威逼利诱,却始终没有发现埋于地下和 藏于隔间中的文物,珍宝安全地度过了战火纷飞的岁月。
大克鼎与光绪中期出土于陕西的扶风法门寺地区。同事出土的还有仲义父
2007年8月8日,国之重器西周青铜器大克鼎和大盂鼎的捐赠者———百岁老人、上海文史馆馆员潘达于女士无疾而终,安然辞世,享年104岁。
ref: http://www.9wh.net/News_Show.asp?NewsID=10053
ref: http://bbs.tiexue.net/post2_2306832_1.html

FPGA debug 1


FPGA debug 2


Sunday, April 5, 2009

TC vs. RTD

TC: thermoelectric couple
RTD: resistance temperature detector
===============
RTD: Cu, Pt
Cu material: low precision, cheap
Pt material: high precision, expensive
when (>-200`C && <0`C):: Rt=Ro[1+At+Bt^2+C(t-100)t^3]
when(>0`C && <650`C):: Rt=Ro[1+At+Bt^2]
Cu material:
used between -50`C and 150`C:: Rt=Ro[1+at]

Contact resistance of relay

__I consider there are “contact resistance” and “contact electric potential” between leads for all relays.
But it seems wrong. If the materials of leads are the same, there is no such “contact electric potential” thing.
Or there is, but less than 1uV and I can’t observe it use 34401 multimeter.
__All relays have their contact resistance. This resistance is in the scale of mOhm level.
__I measure ten power-relays (IDEC RJ1V-C-D24, power relay, 12A), results are bellow:
____Always-On ports: 105mOhm->37mOhm (when sudden off, shows 105mOhm, then turn small slow)
____Always-Off ports: 6mOhm+/-3mOhm (stable in one second)
__At the same time, not only there are differences between relays on alway-on ports resistance, also unstable for one same relay.
Summery:
1. In general, contact resistance of power relay is small than signal relays because power relays are used under high current.
2. If you want to control the resistance, use always-off ports of relays.
3. Different relays may have different contact resistance, read the data-sheet and measure yourself.

有意義,就是好好活著

……這裡人又黑又橫,可真有貨……而且人家怎么活關你什麽事呢?給你添點堵,事情就做不了,這不是自己把自己給寵的嗎?
–《士兵突擊》

debug: AI_mav

CPU: siliconlabs C8051F363
read Pdata error when WTD want to low but we pull up this pin.
当WTD企图复位但是被拉高(插仿真器)时,P口读数据错误(读到端口地址)。
when read error, VCC steable, /RST fall about 100mv.
出错时,电源稳定,/RST上有小于100mv的扰动。
root cause:
錯誤是由於FPGA的全局reset信號腳由WTD控制,當FPGA被復位時有一次P口數據即讀錯。
conclusion:
只要有正常的驅動,微小的電平浮動不會干擾數字信號至出錯。

Art never improves

Art never improves, but…the material of art is never quit the same.
–T.S.Eliot.

區分RS232-DB9接口類型

作為底板上的插座,
公頭使用定義:235-RTG
母頭使用定義:235-TRG
這樣,當連接相同類型的插座,使用交叉線(235-325);連接不同類型的插座,使用平行接線(235-235)。

RS485與RS422接口

RS485最少只要兩根線,Data-和Data+。
RS422最少要4根線,相當于全雙工的485。
RS485是半雙工接口,所以需要告知接口什麽時候收數據,什麽時候發數據。這個控制信號就是RTS。軟件編程時,常用的變成空間并不關心底層使用的是232接口還是485接口還是422接口,處理基本是一樣的,但是對於班上共的485接口,軟件還是要控制RTS這個信號。
以下代碼從 http://blog.csdn.net/dijkstar/archive/2007/08/17/1748609.aspx 轉過來:
==============
方法1:让操作系统正确的控制RTS信号。
hCOM = CreateFile(…)

DCB dcb;
memset( &dcb, 0, sizeof(dcb) );
dcb.DCBlength = sizeof(DCB);
dcb.fBinary = TRUE; // binary mode, no EOF check
dcb.fParity = FALSE; // enable/disable parity checking
dcb.fOutxCtsFlow = FALSE; // CTS output flow control
dcb.fOutxDsrFlow = FALSE; // DSR output flow control
dcb.fDtrControl = DTR_CONTROL_DISABLE; // DTR flow control type DTR_CONTROL_HANDSHAKE;
dcb.fDsrSensitivity = FALSE; // DSR sensitivity
dcb.fTXContinueOnXoff = FALSE; // XOFF continues Tx
dcb.fOutX = FALSE; // XON/XOFF out flow control
dcb.fInX = FALSE; // XON/XOFF in flow control
dcb.fErrorChar = FALSE; // enable error replacement
dcb.fNull = FALSE; // enable null stripping
dcb.fAbortOnError = FALSE; // abort on error
dcb.BaudRate = …; // current baud rate
dcb.ByteSize = …; // number of bits/byte, 4-8
dcb.Parity = …; // 0-4=no,odd,even,mark,space
dcb.StopBits = …; // 0,1,2 = 1, 1.5, 2
dcb.fRtsControl = RTS_CONTROL_TOGGLE;//关键啊,什么意思请参考MSDN
SetCommState( hCOM, &dcb );

然后就可以使用ReadFile/WriteFile执行RS485的收发了。
方法2: 人工控制。当有特殊要求,不能采用系统控制时采用。
2.a)空闲时,让串口进入接收状态。必须使用ComSend代替WriteFile
dcb.fRtsControl = RTS_CONTROL_DISABLE;//关键啊,什么意思请参考MSDN
SetCommState( hCOM, &dcb );
int ComSend( HANDLE hCOM, const void* pBuf, int iBufSize )
{
EscapeCommFunction( hCOM, SETRTS );
WriteFile(…)
EscapeCommFunction( hCOM, CLRRTS )

}
2.b)空闲时,让串口进入发送发送状态,进入接收状态时清除RTS,退出接收状态时设置RTS。
这种流程要复杂一些,有这种要求的不多吧?自己参照上面的办法去做吧。
使用以上这些办法,完全可以兼容3、5、7、9线制232和485,422,软件不用关心串口的工作模式。
最后,如果板子上的485发送、接收使能没有连到RTS上,你可得向卖板子的问清楚,如何设置这些使能端。否则,你就是改驱动,也无从下手啊。
顺便说一句,VxWorks下,默认就是RTS_CONTROL_TOGGLE。所以这种串口用在VxWorks下,倒真的跟RS232一样了。

Giving Presentation

Mentor: Mark Woodmansee
Venue: Xinhua Training Room
Date: 2008/20/3
==
Principle:(Try to)
1. Duration no more than 40min
2. Total slides no more than 30
3. Spend on each slide no more than 2min
4. Always arrive at least 10 minutes before the presentation will begin to ensure that all of the audio and visual equipment works.
Three “Ps” to giving good presentation
1. Plan what you are going to say.
a. If you are using Microrsoft PowerPoint, write down the 3 or 4 key points for each slide on a seperate piece of paper.
b. Make sure that you discuss each slide for at least 2 minutes. If the slide does not contain a lot of information, delete it or combine it with others.
2. Prepare for your talk (Anticipate)
a. After you introduce yourself, state the purpose of this presentation.
b. Think about what questions you will be asked.
c. If presenting bad news, be sure to think about how to make the situation better. Create backup slides.
d. Think about your audience. Will they understand what you are talking about? Will they know more about the subject than you do?
3. Practice your presentation
a. Close your office door and practice the presentation speaking out loud.
b. Make sure your key points are captured on a page of notes.
Key Points
* Speak slower that you normally do. Annunciate every word.
* The best presentations usually involve the audience participation. Be sure to ask questions of people in the room.
* Always thank the audience for their time.(Show respect)
* Remember that the audience is not your enemy. They want to learn from you.
* Always repeat a question that is asked. This ensures that everyone hears the question.
* It is OK to say to answer a question with “I don’t know.” Be sure to state how you plan to find the answer.
* Shorter presentation are usually the best. People like to be surprised with free time.
* Turn your cell phone off.
* If using your computer, make sure it works. Have all of the computer files open and ready.
Key Phrases
Opening Statements
* Good morning ladies and gentlemen. My name is …
* Good morning everyone. My name is …
Purpose of your presentation (both at the beginning and the end)
* What I’m going to talk about is…
* I’m going to tell you about…
Repeat what you have discussed
* So, what are the important points I’ve made? Well, first…
* So, to summarize…
At the end, ask for questions
* Thank you very much for listening. Now, do you have any questions?
* If you have any questions, I’ll be glad to answer them.
NOTE: ask questions at the end make you get the feedback, include 1)make your presentation clear. 2)talk about other issue with audience. 3)Audience provide their opinion.
Responses to difficult questions
* I need to think about that one. Could we come back to it later?
* I really don’t know the answer to that. Could we discuss it later?
* Is there anyone else in the audience that can answer that question?
NOTE:if you just say “I don’t know, it’s impoliteNOT GOOD when giving a presentation
* can’t answer
* forgot points
* “um…”, “ah…”
* nervous
* speak quickly
* read the text
Good material:
http://www.maa.org/images/presentation.pdf