海角七號......雖然還沒有看, 但是還是要看看.
因為近三個月來聽說好多, 問過家人, 聽說香港還沒有, 不過快要上影了, 會翻譯成廣東話.

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()

目地地 - 香港九龍尖沙咀彌敦道20號
亦即地址同 香港喜來登酒店 Sheraton Hotel Hong Kong
要求, 2床, 早餐, INTERNET, Nov/04/2008 check-in, Nov/06/2008 check-out, 便宜就好, 她說從美國網站找到Luxemanor, 改裝過, 原名溫莎, 金巴利道39號, 可是要價 HK1xxx, 香港酒店附加費好像從13% 減到 10%...............................
原來俺對香港的酒店一無所知.....
(港燦平常沒事不會在

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()



嚐鮮過後.......
DVB-T DMB-TH, 數碼電視廣播的專業名詞
終於有機會看看到底所謂香港的高清電視節目. 拍攝時用了16:9, 播放也可以16:9, 解析度果然有改進
Panoramio logo

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()


外埠見慣 CHINA TOWN, 想不到台南居然也有個 [台南中國城].
本來就比較優閒的台南, 使外表看起來就不是十分熱鬧的 [台南中國城] 更加安靜. 既然來到就湊湊熱鬧, 原來真的是已經是退色的地方.
不過, 裡面還有一個景點, 稱作 [練歌場], 特別的不是平民卡拉OK, 而是牆壁上所寫的, 可以稱作對聯的字句....
寒夜你我情綿綿, 唱首情歌憶當年

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()


連續三個星期, 每次放假就來個颱風. 今天來的颱風名字叫作 [薔蜜], 同樣地搞到安排好的行程亂亂, 假日旅遊的計畫告吹. 無處可去, 整理筆記.
問題 1: 10bit 的ADC數據, 可以表示的數目為 0x000 - 0x3FF, 或者 0 - 1023, 但是轉換後的數據, 大約在 +/-2的範圍內跳動, 雖然並沒有測量實際的溫度, 但轉換後的溫度讀數, 因此大約在+/-1度C的範圍跳動, 這樣的結果並不合理, 因為實際的空氣溫度的變動不可能在一秒內如此跳動. 可能的原因是轉換電壓的過程中, 種種 [噪聲] 或電壓波動引至.
簡單而有效的方法是重複取樣, 把最高最低的值去掉, 再以算術平均法求得結果並且顯示. 這不是新發明, 而是數百年的數學結論 - standard deviation, 標準差的求取, 好像小學的數學或高中的統計學都有教過.
問題 2: 每個溫度傳感器的特性都不一, 所以需要每個做校正, 但是如果需要用到很精密的校正設備, 就違背了DIY簡單易行的原則. 不過只要用心設計, 性能相當於市賣HK$$$$的儀器. 只是人家是賣錢的, 因為不是人人都想DIY, 付錢買簡單了事.

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()

中秋前夕, 颱風來台, 無處可去, 整理筆記.
 
軟件模擬的 RS232, 需要知道幾個參數, 方便設計如下,
1) CPU 的速度 f, 如 1.55 MHz
2) RS232 通訊的速度 BAUD RATE, 如 9600 bit / second

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()


主要是好多贈品可以拿, 看到什麼不是很重要.
http://www.panoramio.com/photos/original/13963266.jpg

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()


要顯示 ADC 的結果到 PC 的螢幕, 不是新問題, 也不是難題, 不過就是要特別給這個 ATTINY26 量身訂造一個. 不是最好的寫法, 不過最直接.


接好線, DEMO 會在 PC 螢幕顯示一個字母 A
 
實際上, 只要計算好 delay_bit_rate, baud rate 可以做到 115200, crystal 可以是任何速度, 只要保證 bit rate 的計算符合下面註解的方式, 早在 68705 的年代, 這個方法一直沿用到今天, 不管哪一家的MCU / CPU, 這個都是最簡單的方法, 除非有硬件 UART.
 
例如 : 
Tb (Bit time) = 1 / baud rate * 10^6 (unit : us) = 1/9600 * 10^6 = 104.16 us 
Tc (CPU cycle time) = 1 / crystal frequency (unit : us) = 1 / 12MHz = 0.083 us
Tt (Cycle time for Tx operation) = 12 CPU cycles of this case = 12 x 1 / 12MHz = 1 us
 
hence, 
delay_bit_rate = (Tb - Tt) / Tc
 
usually, no more than 3% of bit timing drift, byte will be received correctly because RS232 receiver will sync every start bit at its' falling edge in logically (raising edge in electrically)
 
 
 

;*------------------------------Mnamonic code below
; software RS232 transmission, 依照 RS232 的格式發送一個BYTE
; I/O direct drives the PC com port, no need MAX232
; wayen_cwwong@yahoo.com, 2008-Sep-03
; 12MHz crystal, every instruction cycle is 1/1.2us
; RS232 bit time (depends) = 1 / baud rate, ie. 1 / 9600 = 104,16us per bit
; RS232 format, N81, LSB first
; input : 2 bytes will be sent over RS232, r17:r16 (this demo, send one byte only)
; output : N/A
; uses : r0, scratch register


; RS232 frame for a byte of data & voltage level
;  ____                           _____  idle or logic 1 of RS232, 0 to -12V, I/O pin = 0
;           |_XXXXXXXX              logic 0 of RS232, +3V to + 12V, I/O pin = 1
;
; the I/O direct drive technique, it is not 100% comply 
; to EIA232, but it works for this our purpose.


.equ Tx =1 ; 0 to 7, any pin of PortA is ok to used as Tx line of RS232
.def bit_counter = r17 ;
.def data_8bit = r0 ;


Tx_8bit_data:
; ldi r17, 0b10000001 ; test pattern of 8 bit data = 1000,0001 for debug purpose
ldi r17, "A" ; test pattern of 8 bit data = letter A
mov data_8bit, r17 ; save the test pattern to defined register

ldi bit_counter,10 ; 1 start bit + 8bit char + 1 stop bit = 10
; setup the counter, total 10bit need to sent

clc ; (C)( 76543210 ) ; C bit and bit name of data_8bit
   ; (0)( ???????? ) ;current status, C=0, data_8bit is ready to sent

send_0_or_1: ; decide to send 0 or 1
brcs send_logic_1 ; **[2] if C=1, jump, [2] means 2 machine cycles
; [1] if C=0, no jump, [1] means 2 machine cycles 
nop ; [1] compensate 1 cycle if no jump above

send_logic_0: ; start bit is always logic_0, reach here
sbi porta,Tx ; **[2] I/O pin = +5v (high), Tx = logic 0 of RS232 signal, C bit no change
rjmp delay_bit_rate ; **[2] delay until time for 1bit is over. C bit no change

send_logic_1:
cbi porta,Tx ; [2]I/O pin = 0v (low), Tx = logic 1 of RS232 signal, C bit no change
rjmp delay_bit_rate ; [2] delay until time for 1bit is over. C bit no change

delay_bit_rate: ; delay_cycles = 104.16 x 1.2 - 12 cycle  =113 (9600 baud & 12MHz crystal)
nop ; software delay loop, detial is TBA
.......

dec bit_counter ; **[1] one bit sent, decrease the counter
breq complete ; **[1] if counter=0, 10 bits sent, jump to complete

sec ; **[1] no jump above, reached here, not finish yet
ror data_8bit ; **[1] (C)[ C7654321 ] ;next data bit shift to C
   ;       (1)[ 1xxxxxxx ] ; when finish, data_8bit changed to 0xff
rjmp send_0_or_1 ; **[2] go back to the loop, send next bit

complete:
ret ; no more bit need to send, complete

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()


今日收到第一封, 實在很高興, 因為溝通有很多媒介, 寫信有助語文能力.

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()


最初實驗, 純粹為了幫朋友完成她的 Wii 改機, 所以接觸了 Atmel 這個 AVR 系列的MCU, 完全沒有想過真的需要使用, 因為要把編寫好的程序燒錄到 MCU 裡面, 需要一個最基本最簡單的 Programmer (燒錄器), 必須用到 PC 的 Parallel port. 或是使用 Atmel 原廠介紹的 AVR910 Application Note 所用的 Serial Port 的方法. (另外有人也做過類似的設計, 需要簡單的零件連接Serial Port, http://elecrom.wordpress.com/2007/10/15/make-your-own-ultra-simple-universal-avr-programmer/)

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()

this is short description of the DMX512, it is easy for us to reveal the core of this procotol and the application requirment. save time for reading those basic information but a rather deep in description, we still recommend to have reading throught the technical manual.
 
http://www.arduino.cc/playground/Learning/DMX
not simple but easy as we had have experience of developement for a pure software RS232 transceiver, the bit rating is the almost the same as N82 of a RS232 but a differential in-out in electronics data packet of protocol is as following, 
http://www.arduino.cc/playground/DMX/Protokoll

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()


上次看不到 http://hk.myblog.yahoo.com/xiao-laba/article?mid=1346
這次還要看, 但是還是只能在晚上現...拜定時攝影的小工具所賜, 終於看到了.

 

xiaolabaDIY 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。