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
低予算電子工作 ARMマイコンを使えるようにする
Search
Fadis
May 09, 2015
Technology
0
550
低予算電子工作 ARMマイコンを使えるようにする
LPC1114FN28を使ってmbedで書いたコードを実行できるようにするところまでを解説します
Fadis
May 09, 2015
Tweet
Share
More Decks by Fadis
See All by Fadis
C++でシェーダを書く
fadis
6
4.4k
ライトたくさんReSTIRを実装しよう
fadis
2
1.1k
コンピュータグラフィクスの空
fadis
7
2.3k
NNEFを読めるようになろう
fadis
0
950
低レイヤーから始める GUI
fadis
18
12k
いまどきのVulkan
fadis
14
7.6k
L2 WireGuard
fadis
2
4.4k
Wasserstein逆FM音源
fadis
3
3.6k
HSEとは何か
fadis
15
3.3k
Other Decks in Technology
See All in Technology
Amazon SageMaker Unified Studio(Preview)、Lakehouse と Amazon S3 Tables
ishikawa_satoru
0
150
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
2
2.2k
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
160
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
32k
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
2
330
非機能品質を作り込むための実践アーキテクチャ
knih
3
1.1k
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
150
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
C++26 エラー性動作
faithandbrave
2
730
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Fireside Chat
paigeccino
34
3.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Into the Great Unknown - MozCon
thekraken
33
1.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Building Applications with DynamoDB
mza
91
6.1k
What's in a price? How to price your products and services
michaelherold
243
12k
A better future with KSS
kneath
238
17k
Music & Morning Musume
bryan
46
6.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Why Our Code Smells
bkeepers
PRO
335
57k
Transcript
༧ࢉిࢠ࡞ "3.ϚΠίϯΛ͑ΔΑ͏ʹ͢Δ Naomasa Matsubayashi
mbed ϒϥβ্Ͱಈ͘ARMϚΠίϯͷ౷߹։ൃڥ https://developer.mbed.org/
mbed mbedͰॻ͍ͨίʔυΛ ग़དྷΔ͚ͩ༧ࢉͰ࣮ߦ͢ΔࣄΛࢦ͢
mbedͱ͍͑͜͏͍͏ϋʔυΣΞ͕༗໊͚ͩͲߴ͍ NCFE-1$ ௨শ੨͍NCFE NCFE-1$6 ௨শԫ৭͍NCFE ԁ͔Β ԁ͘Β͍ ԁ͔Β ԁ͘Β͍
mbed LPC1114FN28ͳΒͪΐͬͱ͍҆ mbed LPC1114FN28 ԁ͔Β ԁ͘Β͍
্ͭ͡ʹࡌͬͯΔϚΠίϯ͚ͩͩͱ200ԁఔ ͜͜ʹࡌͬͯΔ DIPͷϚΠίϯ LPC1114FN28 ͚ͩ ϚϧπͰ220ԁ ڞཱͰ200ԁ ळ݄Ͱ140ԁ
ॻ͖ࠐΈ͑͞Կͱ͔͢ΕϚΠίϯ200ԁఔͰࡁΉ Լʹ͍͍ͭͯΔͷ 64#͔Β؆୯ʹ ॻ͖ࠐΉͨΊͷϋʔυΣΞ
LPC1114FN28 ARM Cortex-M0ϚΠίϯ ࠷େ48MHz(ΫϩοΫଂ) ଂϑϥογϡ32KB (࣮ߦՄೳόΠφϦͷαΠζ32KB·Ͱ) ଂRAM4KB (࣮ߦதʹ͑ΔϝϞϦ4KB·Ͱ) 3.3VͰಈ͘ ϒϨουϘʔυʹͤ͞Δ
UART͔Βॻ͖ࠐΊΔ
LPC1114FN28 ੨͍mbedͷΑ͏ͳ USBϗετEthernetແ͍͕ I2C SPI PWM ADC UART ϚΠίϯͰΑ͘ΘΕΔI/O༗Δ
༻ҙ͢Δͷ
༻ҙ͢Δͷ 7ిݯ͖ϒϨουϘʔυ -1$'/ ԁ ॳճԁ ԁ ηοτ͋ͨΓԁ අ༻ͷΊ͢ ෦ ॳճʹඞཁͳඅ༻ԁ
ॳճԁ δϟϯύϫΠϠຊ ԁ 7༻64#γϦΞϧίϯόʔλ λΫτεΠον ԁ
ಈ࡞֬ೝʹඞཁͳͷ
ಈ࡞֬ೝʹඞཁͳͷ ఆ֨N"ͷ-&% ߅Њ ݸͰԁ ݸͰԁ ߹ܭ ηοτลΓԁ අ༻ͷΊ͢ ෦ ॳճʹඞཁͳඅ༻ԁ
δϟϯύϫΠϠຊ ԁ
C͔ΒHʹ-1$'/Λଓ ύοέʔδʹԜΈ͕͋Δํ͕ߦʹདྷΔΑ͏ʹ͢Δ
ϦηοτϘλϯ༻ͷλΫτεΠονΛ͚Δ ಈ࡞֬ೝ࣌ʹ͚Δ-&%ͱͿ͔ͭΒͳ͍ߦҎ͕߱Φεεϝ
λΫτεΠονͷࢠͷҰํΛIʹଓ ͏ҰํΛͷిݯϨʔϯʹଓ
J͔ΒͷిݯϨʔϯʹδϟϯύϫΠϠΛଓ ଂϑϥογϡॻ͖ࠐΈϞʔυʹೖΔҝͷઃఆ
K͔ΒͷిݯϨʔϯʹଓ ϚΠίϯͷ(/%
I͔Β ͷిݯϨʔϯʹଓ ϚΠίϯͷిݯ
64#γϦΞϧίϯόʔλͷ(/%ͱ5Y%ͱ3Y%ʹ δϟϯύϫΠϠΛଓ
64#γϦΞϧίϯόʔλͷ(/%ΛͷిݯϨʔϯʹଓ γϦΞϧίϯόʔλͱϒϨουϘʔυͷج४ిҐΛҰகͤ͞Δ
Jʹ64#γϦΞϧίϯόʔλͷ5Y%Λଓ
Kʹ64#γϦΞϧίϯόʔλͷ3Y%Λଓ
LPC1114FN28ʹॻ͖ࠐΉํ๏ σόοΨͰॻ͖ࠐΉ γϦΞϧͰॻ͖ࠐΉ σόοΨ͕ཁΔ 64#γϦΞϧίϯόʔλ͕ཁΔ ࠓճͬͪ͜ γϦΞϧ͔Βॻ͖ࠐΉҝͷΈ σʔλγʔτͰ*O4ZTUFN1SPHSBNNJOH *41 ͱݺΕΔ
lpc21isp FlashMagic 8JOEPXT༻ͷ(6*ΞϓϦέʔγϣϯ /*9͚ͷίϚϯυϥΠϯπʔϧ ॻ͖ࠐΈʹ͏ιϑτΣΞ ࠓճͬͪ͜ 8JOEPXTϢʔβͰ'MBTI.BHJDͰॻ͖͍ͨ߹͜ͷΜࢀর IUUQXXXOYQMQDDPNEFWFMPQNFOUIUNM
lpc21isp *41ͷϓϩτίϧΛΔίϚϯυϥΠϯπʔϧ ͜ΕΛͬͯॻ͖ࠐΉ IUUQTHJUIVCDPNDBQJNBOMQDJTQ
# LANG=C emerge -av lpc21isp! --- Invalid atom in /etc/portage/package.use/kde:
kde-base/pykde4-4.10.5! ! * IMPORTANT: 28 news items need reading for repository 'gentoo'.! * Use eselect news to read news items.! ! * Last emerge --sync was 52d 2h 23m 42s ago.! ! These are the packages that would be merged, in order:! ! Calculating dependencies... done!! [ebuild N ~] dev-embedded/lpc21isp-1.85 54 KiB! ! Total: 1 package (1 new), Size of downloads: 54 KiB! ! Would you like to merge these packages? [Yes/No] Yes! ! >>> Verifying ebuild manifests! ! >>> Emerging (1 of 1) dev-embedded/lpc21isp-1.85::gentoo! >>> Downloading 'http://ftp.iij.ad.jp/pub/linux/gentoo/distfiles/lpc21isp_185.tar.gz'! --2015-05-02 22:29:39-- http://ftp.iij.ad.jp/pub/linux/gentoo/distfiles/lpc21isp_185.tar.gz! Resolving ftp.iij.ad.jp... 2001:240:bb8f:200::1:170, 202.232.140.170! Connecting to ftp.iij.ad.jp|2001:240:bb8f:200::1:170|:80... connected.! HTTP request sent, awaiting response... 200 OK! Length: 54735 (53K) [application/x-gzip]! Saving to: '/usr/portage/distfiles/lpc21isp_185.tar.gz'! ! /usr/portage/distfi 100%[=====================>] 53.45K --.-KB/s in 0.1s ! ! 2015-05-02 22:29:39 (385 KB/s) - '/usr/portage/distfiles/lpc21isp_185.tar.gz' saved [54735/54735]! ͍͚ͯΔ-JOVYσΟετϦϏϡʔγϣϯͩͱ ύοέʔδ͕༻ҙ͞Ε͍ͯΔࣄ͋Δ
ઌఔΈཱͯͨϘʔυʹిΛೖΕͯ ϦηοτϘλϯΛԡ͢ MQDJTQͰσόΠεΛ୳͢ # lpc21isp -detectonly /dev/ttyUSB0 115200 48000! lpc21isp
version 1.85! Synchronizing (ESC to abort). OK! Read bootcode version: 1! 7! Read part ID: LPC1114.../102, 32 kiB ROM / 4 kiB SRAM (0x1A40902B) ϦηοτϘλϯ ͜͜ͷσόΠε໊ ڥʹΑͬͯҟͳΔ Մೳੑ͕͋Δ
# lpc21isp -detectonly /dev/ttyUSB0 115200 48000! lpc21isp version 1.85! Synchronizing
(ESC to abort). OK! Read bootcode version: 1! 7! Read part ID: LPC1114.../102, 32 kiB ROM / 4 kiB SRAM (0x1A40902B) νοϓͷछྨ -1$ ུ ϑϥογϡϝϞϦ ,J# 3". ,J# ͜Μͳ෩ʹνοϓͷใ͕දࣔ͞ΕͨΒޭ ग़ͳ͍߹Έཱͯํ͕߹͍ͬͯΔ͔͏Ұ֬ೝ͠Α͏
ಈ࡞֬ೝ
mbedͷLED໓αϯϓϧΛಈ͔ͯ֬͠ೝ͢Δ https://developer.mbed.org/users/ytsuboi/notebook/getting-started-with-mbed-lpc1114/ ϓϩάϥϜ͕LED1ͷ༻Λཁٻͨ࣌͠ mbedLPC1114FN28ͷ͜ͷϐϯʹ LED͕͍͍ͭͯΔ͜ͱΛظ͢Δ
൪ϐϯ ϒϨουϘʔυͷB ʹЊͷ߅Λଓ -&%ͷిྲ੍ྀݶ༻
߅ʹ-&%ͷΞϊʔυଆ ͕͍ํ Λଓ ͜ͷճ࿏ఆ֨N"ͷ-&%Λఆ͍ͯ͠Δ
-&%ͷΧιʔυଆΛͷిݯϨʔϯʹଓ
mbedʹϢʔβొ https://developer.mbed.org/account/signup/?next=%2F
mbedʹϩάΠϯͨ͠ΒCompilerΛબ https://developer.mbed.org/ ͜Ε
mbed LPC1114FN28ʹͳ͍ͬͯΔ͜ͱΛ֬ೝ ͜Ε ͠ผͷϚΠίϯʹͳ͍ͬͯͨΒ ΫϦοΫͯ͠LPC1114FN28ʹมߋ
NewΛԡͯ͠৽͍͠ϓϩάϥϜΛ࡞ ͜Ε
Platform͕mbed LPC1114FN28ʹͳ͍ͬͯΔ͜ͱΛ֬ೝ ͜Ε NCFE-1$'/͕Ϧετʹແ͍߹μΠΞϩάΛ Ұดͯ͡ӈ্ͷϓϥοτϑΥʔϜબ͔ΒՃ͠Α͏ ϓϥοτϑΥʔϜબ
Template͕Blinky LED Hello Worldʹͳ͍ͬͯΔࣄΛ֬ೝ ͜Ε ͍ΘΏΔLνΧΛ͢ΔͨΊͷίʔυ͕࠷ॳ͔Β༻ҙ͞Ε͍ͯΔ
CompileΛΫϦοΫ͢Δ Ϗϧυ͕ྃ͢Δͱग़དྷ্͕ͬͨόΠφϦ͕μϯϩʔυ͞ΕΔ ͜Ε
# lpc21isp -bin mbed_blinky_LPC1114.bin /dev/ttyUSB0 115200 48000! lpc21isp version 1.85!
File mbed_blinky_LPC1114.bin:! ! loaded...! ! image size : 10540! Image size : 10540! Synchronizing (ESC to abort). OK! Read bootcode version: 1! 7! Read part ID: LPC1114.../102, 32 kiB ROM / 4 kiB SRAM (0x1A40902B)! Will start programming at Sector 1 if possible, and conclude with Sector 0 to ensure that checksum is written last.! Erasing sector 0 first, to invalidate checksum. OK ! Sector 1: ...........................|.........................|.........................|............... ..........! Sector 2: ...........................|.........................|.........! Sector 0: ..........................|.........................|.........................|................ .........! Download Finished... taking 2 seconds! Now launching the brand new code μϯϩʔυͨ͠όΠφϦ ॻ͖ࠐΈ *41͕ಉظͰ͖ΔͷϦηοτޙճ͚ͩͳͷͰ ্ख͍͔͘ͳ͍ͱ͖ ϦηοτϘλϯΛԡ͔ͯ͠Β͏Ұࢼͯ͠ΈΑ͏
J͔ΒͷిݯϨʔϯʹܨ͕͍ͬͯΔδϟϯύϫΠϠΛ֎͢ ଂϑϥογϡॻ͖ࠐΈϞʔυʹೖΒͳ͍Α͏ʹ͢Δ
ϦηοτϘλϯΛԡͯ͠-&%͕໓࢝͠ΊͨΒޭ
·ͱΊ 200ԁͷϚΠίϯͱγϦΞϧॻ͖ࠐΈͰ mbedͰ࡞ͬͨόΠφϦΛ࣮ߦͰ͖Δ