Saturday, April 29, 2006

关于ThinkPad飞线

关于联想ThinkPad飞线


相关报道:
ThinkPad T60现重大缺陷!主板居然飞线 (替代链接)
联想承认ThinkPad飞线 否认质量问题 (替代链接)

这个是联想ThinkPad T60(P)主板背面的飞线,X60上也有类似的飞线。ThinkPad竟然也有飞线,粗看着实吓了一跳。不过仔细分析的话,其实也不是什么大问题,对本本质量没有影响。

首先,这条线还是焊得比较精细的,而且用蜡封固定,走线方向也没有大问题,所以这条线本身不会出什么大问题。

其次更为重要的是,这条线到底是干什么的。

先看看这块芯片,Maxim 1540E,根据1540A/1541的Datasheet,此芯片是专用于笔记本电脑,提供0.7~5.5V电源电压,双PWM控制器。可输出两个电压,可用于DDR或其他低电压IC的供电。相当重要的哦。

根据Datasheet,这条飞线是第13个引脚,也就是PGOOD2,Open-Drain Power-Good Output。Function: PGOOD2 is low when the output voltage is more than 10% (typ) above or below the normal regulation point, during soft-start, and in shutdown. After the soft-start circuit has terminated, PGOOD2 becomes high impedance if the output is in regulation. 就是说当输出电压异常的时候这个引脚会变成低电平。否则是高阻态。有可能原先是悬空的,估计这条飞线让他接上一个上拉电阻,既没有大电流,也不是高频率,正常的时候变成高电平而不再是高阻。所以这个脚只是一个报错信号,平常是用不到的。即使出错了,也仍然会报错,即使没有这条线也没关系。

分析了一大通,就算剪掉这条线也没有关系。好像对面的PGOOD1也没有接上拉电阻,不过预留了电阻的空位。

顺便转一个forum.thinkpads.com的评论:
After a 30 year career with IBM, engineering changes to circuit boards were a way of life. When engineers design a circuit board, it is nearly impossible to foresee every condition that will ever be presented to that design. Therefore when that change is needed, the “yellow wire” is applied to the existing boards to allow their use in the production cycle. Hence engineering change numbers are applied to circuit boards, as they are manufactured, to show their level in the ongoing design process. In software or application development, this process is called “bug fixes” or “patches”, you could look at these changes as the “yellow wire” wire applied to programs. Frequently these corrections to code are added to enhancements, and called upgrades.



Tuesday, April 25, 2006

How to create an ISE project including an embedded submodule

Embedded Submodule Design Overview

Adding an Embedded Submodule to ISE

Top-down

Bottom-up

Creating an XPS Design as an ISE Submodule
Only the XMP file must be added as the source file. The BMM file should not be added to the ISE project.
Including an Embedded Submodule in Your Top-Level Design

And next...
del.icio.us Tags:

Emacs for windows 注册表配置

Emacs for windows 注册表配置

参考heriberaht@smth转发的Windows下Emacs启动时最大化设置步骤

Environment:Windows xp + emacs-version "22.0.50.1" (CVS20060320)

注:Sams 一书有这样一句
Any variable that the UNIX user can set with the Xdefaults file is one
that the NT Emacs user can set in the Registry.

Windows 下 Emacs 启动时最大化设置步骤
=====================================

1. 去掉 MenuBar/ToolBar/ScrollBar 查 Emacs 最大化时的 Geometry 参数
在 *scratch* 中输入 (frame-parameters (selected-frame)) C-j
其中有四个参数:(top + -4) (left + -4) (width . 111) (height . 39)
这里的宽和高每台机器的配置或许不同,字体改变后,这个两个值也会变化。我的Laptop上甚至得不到height的值。

2. 根据查到的参数设置注册表和 .emacs 文件
( width 和 height长宽可能要加 1,可以自行调试。如果把windows外观主题设为windows classic, 效果比较好)
(1) 注册表设置

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs]
"Emacs.Background"="Black"
"Emacs.Foreground"="Wheat"
"Emacs.ScrollBars"="OFF"
"Emacs.MenuBar"="OFF"
"Emacs.ToolBar"="OFF"
"Emacs.Geometry"="124x45+-4+-4"
"Emacs.Font"="-*-Courier New-normal-r-*-*-13-*-*-*-c-*-*-*"


设置 Emacs.Font 避免启动时窗口有一个由小到大的变化过程,字体串取自 .emacs
中 (create-fontset-from-fontset-spec ...) 相应设置,如下第一行。
这段没有测试过
(create-fontset-from-fontset-spec
"-*-Bitstream Vera Sans Mono-normal-r-*-*-15-*-*-*-c-*-fontset-most,
chinese-gbk:-*-宋体-normal-r-*-*-18-*-*-*-*-*-gbk*-*,
chinese-gb2312:-*-宋体-normal-r-*-*-18-*-*-*-*-*-gb2312*-*,
chinese-cns11643-5:-*-宋体-medium-r-*-*-18-*-*-*-*-*-gbk*-*,
chinese-cns11643-6:-*-宋体-medium-r-*-*-18-*-*-*-*-*-gbk*-*,
chinese-cns11643-7:-*-宋体-medium-r-*-*-18-*-*-*-*-*-gbk*-*,
korean-ksc5601:-*-Batang-normal-r-*-*-18-*-*-*-c-*-ksc5601.1987*-*,
chinese-big5-1:-*-宋体-normal-r-*-*-18-*-*-*-*-*-big5*-*,
chinese-big5-2:-*-宋体-normal-r-*-*-18-*-*-*-*-*-big5*-*,
japanese-jisx0208:-*-MS UI
Gothic-medium-r-*-*-18-*-*-*-*-*-jisx0208*-*" t)



(2) 设置 .emacs 文件(可以不设,设了可使 C-x 5 2 开 Frame 也最大化)
(setq default-frame-alist
(append '((top + -4)(left + -4)(width . 124) (height . 45))
default-frame-alist))
del.icio.us Tags:

Xilinx EDK Error and solution (1)

最近在用xilinx EDK 8.1i (embedded design kit),又叫 XPS(xilinx platform studio)。期间遇到一些错误及解决方法,顺手记录下来。

ERROR:
In function ‘write’: undefined reference to 'outbyte' or in function ‘read’: undefined reference to ‘inbyte’

Solution:
Define peripheral as standard-out and standard-in by using the Software Platform Settings dialog box.

FATAL_ERROR:Xst:Portability/export/Port_Main.h:127:1.16 - This application has discovered an exceptional condition from which it cannot recover.

Solution:
Delete an unused GPIO instance.

ERROR:Place:207 - Due to SelectIO banking constraints, the IOBs in your design cannot be automatically placed.

Solution 1:

Modify the IOstandard in FPGA Editor and run BitGen without the DRC check (bitgen -d).

Solution 2:

Some pins are not defined. Define all used ports in Project_Dir\data\system.ucf. The complete ports definition is in the EDK directroy: D:\EDK\board\Xilinx\boards\... It is an xbd file. Here I am using a xilinx eva-board, for other boards or customized boards the definition file may be different.






del.icio.us Tags:

Monday, April 24, 2006

Emacs 一些常用包

Emacs 一些常用包

参考newsmth.net的emacs版,bethoven@smth的windows下使用Emacs

1. mule-gbk
用于中文编码,直接复制里面的.el文件就可以用了。
参见这里
emacs 23 就不需要这个包了。不过据说现在23版本还有很多Bug, 而且没有正式的预编译版本,所以暂时先搁着了。

2. wdired
用于在dired模式下直接修改文件或目录名(默认配置按r)
下载wdired.el到%HOME%/site-lisp/
在.emacs添加:
(require 'wdired)
(autoload 'wdired-change-to-wdired-mode "wdired")
(define-key dired-mode-map "r"
'wdired-change-to-wdired-mode)


3. color-theme
很多漂亮的配色主体。我现在用gnome2感觉挺舒服的。下载
(require 'color-theme)
(color-theme-gnome2) ;; change the theme here


4. cygwin-mount
windows下Emacs最好配合cygwin使用,这样就能用ediff(文件比较)这样的功能了。
参见这里

5. ido
加强c-x c-f(find file)和c-x b(切换buffer)功能。由于备选文件和备选Buffer存在Cache里,所以切换Buffer和寻找文件非常迅速。有点像i-search那样,只要输入文件名的一部分就能找到文件了。按方向键或者C-s, C-r可以在ido-find-file切换匹配的Buffer或文件名。
(require 'ido)
(ido-mode t)

用了ido后有一些“副作用”,比如回去访问过的ftp上找匹配的文件名,这样会很慢,解决方法看这里

6. ibuffer
加强c-x c-b (buffer list)的功能,用起来和目录差不多, 按 g 刷新
(require 'ibuffer)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(autoload 'ibuffer "ibuffer" "List buffers." t)

7. dired-single
只产生一个dired buffer.
(require 'dired-single)
(define-key dired-mode-map (kbd "RET") 'joc-dired-single-buffer)
(define-key dired-mode-map (kbd ".")
'(lambda ()
(interactive)

(joc-dired-single-buffer "..")))

副作用是回上层目录不能选..了,只能另找个按键代替,这里用了"."
刚改进了一下dired-single返回上层目录的功能,返回上层目录后光标停在原先的目录名上。

8. midnight
自动整理Buffer. 到午夜会自动关闭一些很久不用的buffer。

9. rect-mark
矩形操作或者说列操作。使用方法在rect-mark.el里有。基本上就是C-x r + 常规区域操作。

10. gnuserv/gnuclient
可以让emacs代替notepad了。
参见这里
如果使用TC的话可以用ChoiceEditor把文本文件绑定到gnuclientw.exe上。就可以非常方便地用F4启用Emacs了。
更新 2007/3/20:
最新的NT Emacs 22 和 23 已经带了 emacsclient.exe 和 emacsclientw.exe,所以gnuserv就不用装了。使用方法是,在~/.emacs里加上这些:
(server-start)
;;退出的时候删掉server文件
(add-hook 'kill-emacs-hook
(lambda()
(if (file-exists-p "~/.emacs.d/server/server")
(delete-file "~/.emacs.d/server/server"))))
用emacsclientw.exe打开文件的方法是:
d:\Emacs\bin\emacsclientw.exe -f "d:\Emacs\home\.emacs.d\server\server" -n -a "d:\Emacs\bin\runemacs.exe" path\to\file
11. w32-browser
在windows里相当好用。
加上下面几句:
(require 'w32-browser)
(eval-after-load "dired"
'(define-key dired-mode-map [f4] (lambda ()
(interactive)
(w32-browser
(dired-replace-in-string
"/" "\\"
(dired-get-filename))))))


在dired浏览文件时只要按F4就能用对应的windows程序打开文件了。
del.icio.us Tags:

Emacs 常用快捷键

Emacs 常用快捷键

Emacs的快捷键都是绑定于ctrl和alt(或称meta)上的,例如c-x就是ctrl+x,m-x就是alt+x.
当然所有的按键都可以自定义。

常用的帮助按键:
c-h a : 查询一个命令
c-h c : 查询一个按键
c-h t : Tutorial
m-x customized-group RET ... 自定义模式
m-x describe-... RET 各种各样的帮助信息


光标操作:
m-< : 光标到buffer头 m-> : 光标到buffer尾
m-a : 光标到前一
m-e : 光标到后一
c-up : 光标到前一
c-down : 光标到后一
c-left 或 m-left : 光标到前一个词
c-right 或 m-right : 光标到后一个词

常用按键:
c-g : 取消当前命令或者按键

文件操作:
c-x c-f : 打开文件或目录
c-x c-s : 保存当前文件
c-x c-w : 当前文件另存为
c-x u : undo

剪切操作:
c-spc : 选定区域,建议自行绑定此键,因为和windows的ctrl+space冲突。
c-x h : 全选
m-w : 复制
c-w : 剪切
c-y : 粘贴 (handy for german keyboard :)
m-y : 粘贴剪贴板前一项内容
c-k : 剪切一行

查找和替换:
c-s : 向后寻找 (i-search)
c-r : 向前寻找(i-search)
m-% : 查找并替换

窗口操作:
c-x l : 显示文件(buffer)总行数
c-x 1 : 当前窗口最大化
c-x 2 : 上下两窗口模式
c-x 3 : 左右两窗口模式
c-x 0 : 关闭当前窗口(Buffer仍然存在)
c-x o : 切换窗口

Buffer操作:
c-x b : 切换buffer
c-x c-b : buffer 列表
c-x k : 关闭buffer
g : 刷新目录(dired)或者buffer列表

编码操作:
c-x RET r : 改变当前buffer的编码
c-x RET f : 改变保存当前文件所使用的编码

几个好用的自定义按键:
(global-set-key [(meta g)] 'goto-line) ;; m-g 跳到某一行
(global-set-key [(ctrl tab)] 'kill-this-buffer) ;; c-tab 关闭当前buffer
(global-set-key [(ctrl c) (ctrl c)] 'comment-or-uncomment-region) ;;c-c c-c区域注释或取消注释
(global-set-key [(meta r)] 'eval-buffer) ;; m-r 执行buffer中的lisp代码
(global-set-key [(ctrl <)] 'set-mark-command) ;; c-< 选定区域

dired操作尚在研究中,据说可以有替代TC的可能。

ps:
Emacs是什么? Emacs是世界上最强大的编辑器,但他不仅仅是编辑器,Emacs是一种生活方式。
世界上有三种人,一种使用 Emacs,一种使用 vi,另一种包括其他所有人。wakaka



del.icio.us Tags:

Startup with Blogger

之所以用Blogger是想换换环境,之前一直用msn space的。
注册了之后发现国内原来是上不了blogspot.com的,郁闷。后来google了很久,原来可以找个免费空间当载体,把Blogger当作一个发布器。
具体方法可以见这里:玩转Blogger 或者 妖精の翼
免费ftp空间我找的是 3000mb.com, 大概有3G吧,短期内肯定足够用了。使用ftp发布的坏处就是发文非常慢。

之后的一个问题是tag. 用过Gmaildelicious之后越来越喜欢这个功能了。而这个大名鼎鼎的Blogger竟然默认是没有标签的,虽然space也没有标签,但至少也有目录功能嘛。不过既然是用户最多的blog,那网上的大牛们肯定早有解决方法了吧。
我现在采用的方法是: Firefox + GreaseMonkey + delicious. 步骤如下:
1. 使用Firefox并安装插件GreaseMonkey,重起Firefox.
2. Install user script 2182,重起Firefox.
3. 申请一个del.icio.us帐号.
4. 登陆Blogger,settings->formatting->show link field,yes.
5. 现在可以发文了,或者编辑原来的Blog,在标题下方会多出一栏Tags,单击Tags可以设定标签栏的名称,默认的标签名,和将要加入del.icio.us的帐户名。
6. 发表文章,上传完毕后会多一个links at del.icio.us,单击这里跳出del.icio.us的提示窗口,文章链接、标题、发表时间、标签等都已经设好,直接save即可。


Sunday, April 23, 2006

Getting started from here

这个Blog将作为我的学习笔记。
有一些上手比较难的工具,比如Emacs,曾经有段时间用得比较熟,隔了两三个月基本没用后,就几乎全忘了。这时候感觉到有个学习笔记还是很有用的。
恩,这里就这样开始吧。



del.icio.us Tags: