2012年9月24日星期一

人在硅谷 (二)

加州的天气真很特别,虽然靠着太平洋,但是异常干燥。打开的食物也不用担心变潮, 晚上洗的衣服,第二天早上肯定会干。太阳出来暖洋洋,不见太阳就冷飕飕。。。

周日去了monterey bay aquarium 和 加州州立公园,真是天蓝蓝,海蓝蓝啊!喜欢自然的人在这里乐此不疲,很难讲清楚有多少美丽的自然景观。在公司我看见了松鼠,在公园我看见了鹿,开车回来途径小径又发现了一堆Otter在晒太阳,貌似这里随处可见动物。。。

快来了半个月了,吃了各种国家的菜肴,但。。最新欢的还是印度菜。印度的香料真是一绝啊,用饼沾着吃可口无比,还有意大利的面食也很不错。韩国菜/泰国菜/日本菜 这些我觉得算是第二梯队吧,最不喜欢的是墨西哥食品,上次吃了个鱼,最后。。。吐了。。。 忙完工作,回Hotel大家晚上偶尔买些Grape Tomato,Blueberry,Grape and Chips,吹着水,吃着水果,吃着薯片+Salsa酱,我比较喜欢做一个Couch Potato。 ;)



 

2012年9月16日星期日

人在硅谷 (一)

9.11登上了万恶的资本主义过度米国,第一次过来,觉得还是蛮新鲜的。下飞机过海关后去租车,过往的人精神面貌都很不错,感觉大家都很Happy!

去SafeWay超市,收银员对客户都很友善,笑着问你How you doing?

去GILROY购物,售货员会问你 Are you fun with everything here?有时还会给你优惠券。CK的T-shirt $19.99一件,拿优惠券还能来个85折,老大一直在说不买是犯罪!!!国内的价格应该是5倍的样子。





2012年7月27日星期五

Useful Linux commands

1 control-r in bash
A efficient way to search history command.
pbzip2 -9 < /dev/urandom > /dev/null 
This command will tell you how hot your computer can be.

2011年10月4日星期二

Arduino LCD programming

Today, I wrote an arduino program to control the LCD at Chaihuo. There are eight channels on the LCD, you can press the button to change the channel, current channel has a asterisk "*" mark, and tuning the knob will adjust current channel's value.



P.S: I think Tully is very good at photography, I like his photos so much :-)

2011年9月12日星期一

Be the change you want to see!

These days, I am so happy to meet a guy whose name is Mitch, a versatile person from Australia. While talking about software, I am convinced that he is a software engineer; while talking about hardware, I am also sure he is a hardware engineer; while even talking about economy, I was wondering if he is a economist? With so many deep understanding :-) .

Moreover, he is a guy who fully understands the spirit of open source. He brought beer, playpause and lots of interesting projects to SZDIY, and all of these projects are open source. So Mitch really truly thoroughly makes a change to SZDIY, that is why SZDIY has a big day called "Mitch joins SZDIY".

For me, he suggested me that "be the change you want to see". I think I am ready to go, even every step is tiny, the combination will make that change!

Thank you Mitch, I appreciate all the help you've given me!

2011年8月10日星期三

AMCC 1.0 release

I am happy to announce that AMCC 1.0 is coming, have fun!
AMCC github









/*
* AMCC (Anders Ma Copter Control)
* (www.andersma.net)
*/


General Information
===================

AMCC is an utility for copter development.
With AMCC you can monitor copter's sensors data, you can use sensors data
to develop flight control algorithm. In the future, you can use AMCC to
config and operate copter.

Licensing
=========

AMCC is released under BSD license.

Requirements
============

To compile AMCC, you must install following packages:

* libgtk2.0-dev
* libgtkglext1-dev
* freeglut3-dev
* lib3ds-dev
* libxml2-dev

HOW-TO
============

To use AMCC to monitor/control copter, copter must support AMCC protocol, How?

1) Copter MCU software must contain following code and linked with src/packet.c:

#include "packet.h"

char buffer[50];
packet_t p;

p.type = ANALOG_DATA_RESPONSE;
p.raw.analog_data.channel_number = 6;
p.raw.analog_data.value[0] = accx; /* accelerometer X axes data got from ADC */
p.raw.analog_data.value[1] = accy; /* accelerometer Y axes data got from ADC */
p.raw.analog_data.value[2] = accz; /* accelerometer Z axes data got from ADC */
p.raw.analog_data.value[3] = gyrox; /* gyroscope X axes data got from ADC */
p.raw.analog_data.value[4] = gyroy; /* gyroscope Y axes data got from ADC */
p.raw.analog_data.value[5] = gyroz; /* gyroscope Z axes data got from ADC */

packet_encode(&p);
memcpy(buffer, &p.data, p.data_length);
txd_buffer[p.data_length] = 0;
printf("%s", buffer); /* output data over serial port */

2)connecting PC with copter as below:

[PC] ---serial line----- [Copter]

3) #./amcc -d /dev/SERIALDEV -s SPEED
(replace SERIALDEV and SPEED according your environment, default is ttyUSB0, 57600)

4) Click menuitem "Monitor->Start", if copter is sending sensors data, AMCC will draw Acc & Gyro voltage graph and render 3D copter.



2011年8月6日星期六

日记 2009 07~09

2009年折腾一款STM32F103开发板的日记。回顾日记,发觉自己每年七月八月很多产,很努力!

7/27/2009
Vista上安装MDK 设置J8J9启动方式
7/28/2009
NOR/SRAM/NAND
仿真软件Openocd JLINK读回Flash数据并做了对比,发现板子程序与我编译出来的程序只有时间上的差异。
用MDK生成bin文件方法:fromelf.exe --bin -o $L@L.bin #L
7/29/2009
STM32 demo using Eclipse, OpenOCD and GCC http://developers.stf12.net/eclipse-demo
根据"图解MDK 3.5+Jlink V7在STM32中SRAM调试成功"文档, 成功下载GPIO程序到板子上,在不烧FLASH的情况下对程序进行了验证,非常好玩!
7/30/2009
学习 cortexm3_macro.s & stm32f10x_vector.s 文件
使用Keil Simulator 来仿真调试,查看汇编代码 分析Keil Linker control code: --ro-base 0x08000000 --entry 0x08000000 --rw-base 0x20000000 --entry Reset_Handler --first __Vectors -结论是编译出来的程序以__Vectors文本区块打头
7/31/2009
阅读STM32103XX参考手册
8/10/2009 研究用串口烧写程序,用那个Demonstrator总是不能成功操作,非常不爽 :(
8/13/2009
从Micrium官方下载了 STM32的uC/OS-II,看了些文档,并与红牛板子的包做了些对比。
8/14/2009
看了一些LCD的接口,了解了大概操作LCD的步骤。下面是红牛板子的相关信息:
LCD 采用FSMC_NE4 PIN做片选,访问地址为 0X6C000000
NOR 采用FSMC_NE2 PIN做片选,访问地址为 0X64000000
SRAM 采用FSMC_NE3 PIN做片选,访问地址为 0X68000000
NAND 采用FSMC_NCE2 PIN做片选,访问地址为 0X70000000
回家把ouravr网友的tft程序放到我的板子里,可以看到屏幕显示文字,不过字却是反的,需要继续debug。
8/15/2009
合并了板子自带的LCD驱动初始化代码,依然没有解决问题,反而不显示文字了,看来需要更深入的读一下DS。
8/16/2009
修改了一下绘制行和字符的函数,目前可以正常显示字符。
8/17/2009
阅读了ILI9325的DS 1-7章
8/21/2009
阅读STM32103XX参考手册ADC章节[ST11.3.7]
8/22/2009
阅读STM32103XX参考手册ADC章节[ST11.9]
折腾串口程序,发现接收卡死在那里,最后我认定是串口有问题,与卖家协商更换。
深圳市龙岗区布吉荣超花园xx栋x单元xxx,胡先生,13392xxxxxx
8/23/2009
1. 粗略阅读STM32103XX参考手册 Memory and Bus Architecture 和 RCC 章节, 基本掌握系统架构
2. 弄清楚Rcc_Configuration()函数细节
3. 粗略阅读STM32103XX参考手册 Interrupts and Events 章节
8/24/2009
1. 阅读一下ST ADC3的例子
2. 阅读Cortex-M3 Tech Ref Manual NVIC 部分
8/25/2009~8/26/2009
1. 拿回来了板子,在家做测试
2. 目前串口可以烧写程序了,之前烧写不成功主要是速度过快的问题,设置低速比较好
3. 烧写程序应该使用hex的格式,bin的烧进去不能执行
8/26/2009
1. 晚上花了2个小时对加速度传感器模块进行实验,得出如下结论
a. SLEEP PIN 需要拉高(3.3V),才能使加速度传感器进入工作模式
b. Z轴长期处于+-g的输出电压模式,其他轴如果水平状态下呈0g电压状态
c. 实验数据:X 1.69,Y 1.50, 0.83
备注:中途实验不成功,我打算明天焊接实验班再做实验,不过时间足够,我逼迫自己继续下去,我又一次战胜自己的懒惰!
8/27/2009
1. 白天在公司写了ADC数据处理程序,带串口和LCD数据输出
2. 晚上回来对程序进行验证,串口和LCD都正常,靠,有点佩服自己了,哈~
3. 接好ADC线,发现数据正常,ADC用[0~4096]来诠释[0~3.3v]电压,目前我的XYZ轴数据分别为
8/28/2009
1. 阅读MK 0.71代码,
a 寻找如何传送加速度计调试数据
b 寻找MK如何处理加速度计的方法(起飞前用200次的数据校正加速度计,Nature/Mean方式设计得还算巧妙)
2. MK 利用了"卡尔曼滤波"理论来控制飞行姿态
3. 晚上回来调试程序,目前可以用MK的程序来显示我ADC的变化了,哈哈啊哈~
8/28/2009
1.开始重头学习高等数学
2. 尝试使用SD卡程序,结果不能读,看来是SD卡读那块有问题,需要继续解决。
1/9/2009~2/9/2009
1 研究飞控算法,有些突破的就是明白如何校正那些传感器。(a 左上校正sensor,同时NICK&ROLL的数值决定选择哪套参数 b 右上保存传感器信息到EEPROM c 右下开启马达准备飞行)
2 ENC03采用科里奥里力来获取角速度,所以我需要弄清楚陀螺仪原理 http://zh.wikipedia.org/wiki/科里奥利力
3/9/2009
1 了解电磁波/射频(>100KHZ的电磁波)定义 a c=λf
2 雷达是用电磁波来探测目标,并检测其速度和其他特征的一种电子设备
3 回想起当初TVBGONE 38K红外载波的意思,只是形成频率是38K的脉冲去驱动红外发射LED而已。
4 UAV unmanned aerial vehicles
5 1 000 000 nm = 1m
6 微波波长范围在 1mm~1m
5/9/2009
1 飞控算法电机调整口诀: 左+右-;前+后- (+-pd_result)
7/9/2009
1 为什么MK中计算陀螺仪的积分就变成了单纯的ADC差值?
13/9/2009
1 这个周末去学校玩了一下飞行器,基本掌握如何操纵它