Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Raspberry Pi 應用與軟硬整合介紹
Search
台灣樹莓派
PRO
March 14, 2014
Technology
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Raspberry Pi 應用與軟硬整合介紹
Raspberry Pi的應用介紹,並以透過GPIO點亮LCD的實例示範軟硬整合的過程
台灣樹莓派
PRO
March 14, 2014
More Decks by 台灣樹莓派
See All by 台灣樹莓派
Raspberry Shake - 用 Raspberry Pi 與 Python 偵測地震和監控地球活動
piepie_tw
PRO
0
51
Raspberry Pi AI HAT+ 2 介紹(#49)
piepie_tw
PRO
0
3.8k
當 Raspberry Pi 遇到 AI
piepie_tw
PRO
0
190
快快樂樂購買Pi 5週邊商品(#JAM2024)
piepie_tw
PRO
0
240
2024-10 到 2025-01 的 Raspberry Pi新產品介紹(Pi 5/16GB, Touch Display 2, Pi 500, Raspberry Pi Monitor, Pico 2W, USB 3 Hub, Raspberry Pi Carbon Removal Credit)(#JAM2025)
piepie_tw
PRO
0
300
2024-08 到 2024-10 的 Raspberry Pi新產品介紹(Pico 2, microSD, Bumper, AI Camera, AI HAT+)(#44)
piepie_tw
PRO
0
160
Raspberry Pi AI Kit介紹(#43)
piepie_tw
PRO
0
2.3k
Duckiedrone - 基於 Raspberry Pi 與 Python 的小型無人機專案介紹
piepie_tw
PRO
0
3k
Raspberry Pi新產品介紹(Raspberry Pi M.2 HAT+ 和 Raspberry Pi AI Kit)(#42)
piepie_tw
PRO
0
220
Other Decks in Technology
See All in Technology
kintone の AI コワーカーを、 Anthropic にエージェントを"ホストさせて"作った話 #devkinmeetup
sugimomoto
0
110
DatabricksにおけるMCPソリューション
taka_aki
1
270
ヘルスケア領域における AI 活用と その安全性担保のための取り組み (Leveraging AI in Healthcare and Our Efforts to Ensure Its Safety) - Google I/O Extended Tokyo 2026, July 11, 2026
zettaittenani
0
420
ruby.wasmとPicoRuby.wasmに対応した仮想DOMライブラリを作ってる話 #kaigieffect_kaigi
sue445
PRO
0
150
「早く出す」より「事業に効く」 ── 顧客の業務サイクルから逆算するAI時代の二重ループ開発と「変化の設計者」 / devsumi2026
rakus_dev
1
360
AI時代の闇と光
tatsuya1970
0
110
個人開発で育てる「大規模設計の苗床」 - AI時代の1人開発から始める業務への知識接続 / The Seedbed for Large-Scale Design - From AI-Era Solo Projects to Professional Knowledge
bitkey
PRO
1
280
ゴールデンパスは敷いただけでは道にならない ─ 企画部門のエンジニアが技術標準を事業価値に変えるまで
mhrtech
1
210
見守りエージェントを作ってみた(ローカルLLM + Hermes Agent)
happysamurai294
0
110
Type-safe IaC for Dart
coborinai
0
160
CDKで書くECSのベストプラクティス、 改めて考え直す2026 #cdkconf2026
makies
3
770
Kaggleで成長するために意識したこと
prgckwb
2
410
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
190
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
A Soul's Torment
seathinner
6
3.1k
How to Talk to Developers About Accessibility
jct
2
390
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Typedesign – Prime Four
hannesfritz
42
3.1k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
410
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
220
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
350
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Transcript
Raspberry Pi 好好玩 - 軟硬整合篇 台灣樹莓派 <
[email protected]
> Mar 17, 2014/NTU
2 • Element14 指定台灣獨家經銷 Raspberry Pi • 專注於 Raspberry Pi
應用與推廣 • 舉辦台灣 Raspberry Pi 社群聚會 about 台灣樹莓派
3 • Raspberry Pi 應用介紹 • Raspberry Pi 的軟硬整合 今日大綱
4 Raspberry Pi 應用介紹
5 以前的電腦 http://goo.gl/iU5f9w http://goo.gl/U1aq9E PDP-8 Xerox Alto BBC Micro Power
Macintosh
6 現在的電腦 iphone 10 ?
7 裝置越來越聰明 人卻越來越糊塗 資訊科學系的學生不懂電腦 ?
8 David Braben Eben Upton Robert Mullins Alan Mycroft Pete
Lomas Jack Lang Liz
9 • 信用卡大小般的電腦 Raspberry Pi 是什麼 ? http://www.flickr.com/photos/fotero/7697063016/
10 • Raspberrypi.org 基金會所設計開發 • 以低價硬體 & 自由軟體刺激電腦科學教育 • 公開的
datasheet & 線路圖 & 原始碼 • 由 element14 / RS Components / Egoman 生產製造 Raspberry Pi 是 ...
11
12 Raspberry Pi 怎麼玩 ?
13 很小 , 很省電的電腦
14 連接週邊 + OS http://www.raspberrypi-tutorials.co.uk/starting-up-your-raspberry-pi-device/set-raspberry-pi/
15 文書處理上網機 http://functy.sourceforge.net/?p=328
16 P2P 動物下載機 http://lcorg.blogspot.tw/2012/10/my-raspberry-pi-adventure.html
17 • Web Server • Mail Server • FTP Server
• File Server • VPN Server • Printer Server • Git Server 節能省電伺服器 http://eclipsejpa.blogspot.tw/2012/11/java-7-se-parallel-processing-cluster.html
18 移動性
19 阿宅攜帶式電腦 http://blog.parts-people.com/2012/12/20/mobile-raspberry-pi-computer-build-your-own-portable-rpi-to-go/
20 超潮樹莓派平板 http://makezine.com/2014/01/07/how-i-built-a-raspberry-pi-tablet/
21 行動無線路由器 http://draalin.com/raspberry-pi-projects
22 無人自動監視器 http://www.flickr.com/photos/wolfpaulus/8024332721/
23 衛星導航系統 PiPiGo http://www.milos.ivanovic.co.nz/blog/252
24 娛樂性
25 回味古早遊戲機 http://bit.ly/1e1xaF7 http://blog.sheasilverman.com/2013/08/friday-post-my-book-raspberry-pi-gaming-now-available-for-pre-order/
26 多媒體娛樂中心 http://blog.changyy.org/2013/07/raspberry-pi-raspbmc-ppstream.html http://geekify.me/turn-your-raspberry-pi-into-a-full-fledged-media-centre-with-xbmc/
27 擴充性
28 Bitcoin 採礦機 http://thegenesisblock.com/bitfury-begins-shipping-to-customers/
29 平行處理運算叢集 http://arstechnica.com/information-technology/2012/09/university-builds-cheap-supercomputer-with-raspberry-pi-and-legos/
30 各式擴充板 PiFace Gertboard cooking-hacks Arduino raspicomm Wolfson Audio Card
AlaMode Pi Rack + Embedded Pi
31 Raspberry Pi 還可以怎麼玩 ?
32 Raspberry Pi 還可以怎麼玩 ? 玩他的 GPIO - 跟周遭的硬體互動吧
33 無線網路收音機 http://www.plingboot.com/2013/08/cardboard-raspberry-pi-wifi-internet-radio/
34 Pi 相機 http://learn.adafruit.com/diy-wifi-raspberry-pi-touch-cam
35 四軸飛行器 http://diydrones.com/forum/topics/the-raspberry-pi-quad-fu-project
36 語音輸入微波爐 http://madebynathan.com/2013/07/10/raspberry-pi-powered-microwave/
37 鍵盤打掃機器人 http://www.kickstarter.com/projects/shota/rapiro-the-humanoid-robot-kit-for-your-raspberry-p
38 智慧節能家電控制 http://www.ladyada.net/make/tweetawatt/
39 成大資工期末專題 http://wiki.csie.ncku.edu.tw/embedded/team2013-3 進階嵌入式系統開發與實作 - 影像伺服系統 (Visual Servo System)
40 更多應用 ...
41 http://makezine.com/2013/04/14/47-raspberry-pi-projects-to-inspire-your-next-build/
42 DEMO
43 我們可以從 Raspberry Pi 學到什麼 ?
44 軟體 + 硬體的整合
45 軟體 + 硬體的整合 一個讓 LCD 亮起來的例子
46
47 先從硬體架構講起
48 LCD 和 Framebuffer 的關係 http://www.clivemaxfield.com/diycalculator/popup-h-console.shtml
49 16-bit = 16 pin 現實是:沒有這麼多腳位可以用
50 4094 - 序列轉並列 http://www.channel9.msdn.com http://www.xuan.idv.tw/wordpress/?p=1181
51 SPI Protocol - 和 LCD 訊號同步 http://avrhelp.mcselec.com/index.html?using_the_spi_protocol.htm
52 電路圖 http://www.myu.ac.jp/~xkozima/lab/raspTutorial3.html
53 ÷Pi – 轉換電路 - LCD http://www.myu.ac.jp/~xkozima/lab/raspTutorial3.html
54 再講講軟體
55 GPIO 的控制 • A generic pin on an IC
http://raspberrypihobbyist.blogspot.tw/2012/09/so-many-inputs-so-few-gpio-pins.html
56 http://www.raspberrypi.org/phpBB3/viewtopic.php?t=4277 SPI / I2C / UART / PWM GPIO
(General Purpose Input/Output)
真實的電流輸入 http://goo.gl/IzwE0K 有時間差 連續的訊號 負緣觸發 正緣觸發 原始的訊號 取樣的結果 兩者訊號比較 取樣
5 GPIO 量測與除錯
• 開啟或關閉 GPIO • 決定是 0 激活還是 1 要激活 •
決定是輸入還是輸出 • 寫值到某根腳位 • 從某根腳位讀值 • 決定是正緣觸發還是負緣觸發 • 等待中斷 (interrupt) 的發生 那軟體做什麼 ? 控制硬體
• 直接修改 register 的值 • 透過 driver 進行操作 控制硬體的方法
1. 看 datasheet 2. 查 register 3. 填對應的值 三言以蔽之
62 看 datasheet
BCM2835 ARM Peripherals http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf 共 205 頁
64 查 register
• Page 5
存取 register = 在記憶體位置讀寫值
// RPI.h struct bcm2835_peripheral { unsigned long addr_p; // 指到實體記憶體位址
int mem_fd; // 開啟 /dev/mem 的 fd void *map; // memory map 的回傳 volatile unsigned int *addr; // 指到 register 的位址 }; // RPI.c struct bcm2835_peripheral gpio = {GPIO_BASE}; 先定義週邊成一個 structure
1. 開啟記憶體裝置 2. 映射到實體記憶體空間 // RPI.c fd = open(“/dev/mem”, O_RDWR|O_SYNC);
mmap(NULL, BLOCK_SIZE, PROT_READ, MAP_SHARED, mem_fd, addr_p);
在顯示器上畫畫面 = 寫 Framebuffer
void fb_init (int *fb_width, int *fb_height) • { • fb_fd
= open(“/dev/fb0”, O_RDWR); • fb_mem = (unsigned char *) • mmap(NULL, fb_size, PROT_READ | PROT_WRITE, MAP_SHARED, fb_fd, 0); • } • • unsigned char *fb_get () • { • return (unsigned char *) fb_mem; • } 開啟 Framebuffer 裝置 http://www.myu.ac.jp/~xkozima/lab/raspTutorial3.html
void main () • { • int width, height; •
fb_init(&width, &height); • lcd_init(IMAGE_SIZE); • • while (1) • { • lcd_send(fb_get()); • } • } 將畫面寫到 Framebuffer http://www.myu.ac.jp/~xkozima/lab/raspTutorial3.html
pi@raspberrypi:~$ sudo vi /etc/init.d/bootmisc.sh • ... • do_start () {
• ... • # fb2lcd (FrameBuffer to LCD) • if [ -f /usr/local/bin/fb2lcd ]; then • /usr/local/bin/fb2lcd & • fi • } • ... 啟動時就執行 http://www.myu.ac.jp/~xkozima/lab/raspTutorial3.html
73 DEMO
• Raspberry Pi 応用編 • http://www.myu.ac.jp/~xkozima/lab/raspTutorial3. html • Low Level
Programming of the Raspberry Pi in C • http://www.pieter-jan.com/node/15 參考資料
75 Raspberry Pi Rocks the World Thanks