2016年9月29日 星期四

認識ARM-based SoC 原廠開發工具


Bare Metal 開發或Boot loader設計, 若有一個好的開發工具,可以加速開發速度。

針對ARM Cortex-A系列, ARM 原廠提供的是DS-5 (Download ARM Development Studio 5 (DS-5)。Note: 針對ARM Cortex-M系列 , 原廠開發工具, 則是MDK-ARM

若只是針對ARM Classic , 即ARM7、ARM9、ARM11 這類的, 也可以使用先前的 RVDS (Real View Development Suite) 開發工具或更早的ADS (ARM Development Suite) 來開發,但目前ARM已不再更新這些軟體了。

DS-5 是Eclipse-based IDE,加入C/C++編輯器及ARM編譯器5或6(Ultimate edition only)及Debugger、ICE工具 及profiling 分析。(下載30天試用版)

ARM DS-5 包含免費的community Edition(使用gcc compiler), Profession Edition, Ultimate Edition。Ultimate Edition 主要針對64位元 ARMv8 架構且具備Fixed Virtual Platform (FVP), 如果沒有Target Board的話也可以模擬。

2016年9月26日 星期一

數位課程討論板




數位學習平台功能列

平台功能選單(強化學習效果),包含我的課程、我的學習中心、學習歷程、行事曆、筆記本、最新消息、學員課後技術分享

平台主功能選單

影片分節分段觀看(並有記錄點)

新增自己的學習筆記本

學員發問區: 


學員發問區提問問題列表(可以看別人問了什麼,也許您也有相同欵問喔)

截圖1: 學員發問與老師回答 


截圖2: 學員發問與老師回答 

2016年9月20日 星期二

Voltage Regulator



A voltage regulator is a device which takes an input voltage and outputs a stable fixed voltage


1.齊納二極體 (Zener Diode)
  • 1.12V-->5V (Select a proper Zener Diode voltage)
  • 2.最小輸入電壓須比輸出的穏壓大2V以上
2.Fixed voltage regulators
  • 1.LM7805 ==> 5V; LM7812==> 12V
  • 2.最小輸入電壓須比輸出的穏壓大2V以上
3.Adjustable output voltage

  • max allowed IN/OUT voltage difference which is 40v
  • OUT = 1.25*(1+R2/R1)
  • 「LM317」的圖片搜尋結果

4.參考電壓IC : LM385 , AD580



那如何做5V--> 3.3V ? or 3.3v --> 1.8v

  • 使用線性穩壓器 LDO (Low Dropout) , 只需要差到0.5V以上
  • LM2940, LM2941
  • LM317
資料來源為課程講義: https://goo.gl/K5FJ6U



2016年9月10日 星期六

Web 前後端技術架構


瀏覽器的能力將會愈來愈強,, 別停留在只是傳輸網頁文件而已, 那已經是20年以前的時代。Web APP 程式開發將成為應用程式開發的主流, 未來任何東西都會在網路上, 應用程式也幾乎依賴瀏覽器來執行! 


換言之,瀏覽器存在就可以跑任何應用程式, 我們開發者不須要再各別為Windows、Linux、MacOS, Android APP、iPhone/iPad 等平台寫程式了, 真的寫不完,不要說寫連維護都很難,因為沒有這多資源,可以養這麼多人去維護這麼多平台的程式碼,。

當然,可以去找一個可以精通兩個平台以上的工程師, 但實在太少了

瀏覽器的功能會逐漸增強, 用AJAX, WebSocket(一種TCP Socket) 就可以用瀏覽器進行雙向多工通訊,透過Canvas就可以在瀏覽器進行2D/3D繪圖, 這些都是瀏覽器功能不斷演進才有的面貌。

程式在那裡下載??  阿榮福利味 ?! No, 你會在類似 Chrome 線上應用程式商店 找軟體, 如同手機習慣在Google Play, APP Store 線上安裝。而程式開發者,也剛好透過這樣的線上APP 電商, 銷售你的軟體! 不用再自己壓CD及做說明手冊,還要實體盒裝上架,也不用自己做平台做軟體發佈及版本更新。這很重要,因為以前軟體要行銷到不同國家,這太有難度了,. 現在已有建好的一個共通平台,如Google play,使得軟體行銷全球的門檻降低了, 就只怕軟體功能不夠牛而已。

另一方面,因為都是用瀏覽器來跑程式,有一天很多人將會忘記 Install Wizard這個東西,  就是那個用來不斷按[下一步] 安裝程式動作的工具軟體,Install Wizard將成為少數人的開發經驗。現在,不能執行程式, 多半是網路登入帳密自己忘記。



底下整理了 Web 前後端技術架構, 希望對新手在學習Web APP開發上,有一個明確的方向

Web Front-end:

  1. HTML/CSS
  2. JavaScript
  3. JQuery
  4. AJAX
  5. WebSocket (socket.io-client)
\


IOT

Web Back-end (以Node.js架構為例)

1.使用Express作為 node.js web框架
2.使用Handlebars 作為 HTML template engine
3.使用Socket.io作為WebSocket
4.使用Mongoose 存取NoSQL MongoDB資料庫








2016年8月31日 星期三

Pi 新手教學(二) ---如何使用UART Console 登入Raspberry Pi




紅色Raspberry Pi Shield上內建  USB-to-Serial (PL2303)晶片, 故可以用電腦透過USB界面連接到Raspberry Pi。

硬體安裝


Raspberry Pi 紅色子卡插在Raspberry Pi 上,如下圖所示。





下方是給Pi的電源, 上方紅色子板是作 Console 用 



注意:
  1. Serial-to-USB 的連接器是 microUSB,即手機常用的那種接頭.
  2. Serial-to-USB 線不用時要拔掉不要插在板子上, 以免不小心壓到使連接器折斷或把板子上的PCB pad(銲接點)連根拔起而無法修復.

2016年8月7日 星期日

ARM mbed client Code


What is mbed client?

ARM mbed Client is a library that provides the means to connect constrained embedded devices to mbed Device Connector Service, mbed Device Server and to mbed-enabled cloud services from our partners.


  • Manage devices on mbed Device Server.
  • Securely communicate with internet services over the industry standard TLS/DTLS.
  • Fully control the endpoint and application logic.
class MbedClient: public M2MInterfaceObserver {
public:
    MbedClient(){
        _security = NULL;
        _interface = NULL;    // 產生M2M Interface : M2MInterfaceFactory::create_interface
        _device = NULL;     // 產生Device Object : M2MInterfaceFactory::create_device();
        _object = NULL;    // 產生Resource Object : M2MInterfaceFactory::create_object("Monitor");
_object_gpio = NULL;
        _error = false;
        _registered = false;   //,一旦 M2MObjectList object_registered 成功後, 將 _registered設為true
        _unregistered = false;
        _registration_updated = false;

    }

 ....

}


M2MInterface  --> register_object()          ----callback--> object_register()
                               unregistered_object()  ----callback--> object_unregister()
                               update_registration()    ----callback--> registration_updated()



M2MInterfaceObserver 類別上的5個Callback函式列表

virtual void bootstrap_done (M2MSecurity *server_object)=0
A callback indicating that the bootstap has been performed successfully. More...
virtual void object_registered (M2MSecurity *security_object, const M2MServer &server_object)=0
A callback indicating that the device object has been registered successfully to the LWM2M server. More...
virtual void object_unregistered (M2MSecurity *server_object)=0
A callback indicating that the device object has been successfully unregistered from the LWM2M server. More...
virtual void registration_updated (M2MSecurity *security_object, const M2MServer &server_object)=0
A callback indicating that the device object registration has been successfully updated on the LWM2M server. More...
virtual void error (M2MInterface::Error error)=0
A callback indicating that there was an error during the operation. More...
virtual void value_updated (M2MBase *base, M2MBase::BaseType type)=0
A callback indicating that the value of the resource object is updated by the server.Whenever there is a valid PUT operation for any of the resources, the application will receive a callback:


void error(M2MInterface::Error error){
        _error = true;
        String error_code;
switch(error) {
        case M2MInterface::ErrorNone:
             error_code += "M2MInterface::ErrorNone";
             break;
        case M2MInterface::AlreadyExists:
             error_code += "M2MInterface::AlreadyExists";
             break;

  .....


           }
        printf("\nError occured  : %s\n", error_code.c_str());
    }



There are two types of resources you can create
Dynamic: 值會改變, 當server 請求時要負責傳回值
Static: 值不改變
 configure different types of Objects, Object Instances and Resources 



  • mbed client Document

  1. ARM mbed Client Guide
  2. ARM mbed Client API