Board ARM STM32F103CBT6

Berikut ini beberapa foto terkait STM32F103. Nantinya akan dilengkapi dengan hasil-hasil percobaan dengan STM32F103

STM32F103
Board STM32F103 “Blue Pill”

Layout PCB STM32F103
Layout PCB STM32F103

STM32F103 Pinout Diagram

STM32F103 Pinout Diagram

Pemrograman

Upload program ke STM32F103 dapat dilakukan dengan 3 cara:

  • Menggunakan bootloader internal yang dapat diaktifkan dengan mengubah setting pin BOOT0 menjadi 1. Pada mode ini program dapat dimasukkan menggunakan port serial yang terhubung pada PA9 dan PA10. Port serial pada STM32F103 menggunakan level TTL 3.3 volt, sehingga perlu konverter USB to serial 3V3 supaya dapat dihubungkan ke PC/Laptop.
  • Menggunakan pin SWD (Serial Wire Debugging). Untuk programming cara ini mesti menggunakan modul ST LINK V2
  • Menggunakan bootloader USB. Bootloader dapat menggunakan port USB untuk memasukkan program sehingga lebih praktis dibandingkan bootloader internal. Bootloader USB ini mesti dimasukkan menggunakan bootloader internal ataupun SWD.
Upload program ke STM32F103
Upload program ke STM32F103

Bootloader

  • Serial (TX1/RX1, atau pin PA9 dan PA10) : Built in bootloader yang tersambung ke port serial 1 di STM32F103
  • SWD (DIO/DCLK, atau pin JT): STLink v2
  • USB (D+/D- atau pin PA11 dan PA12)Custom boot loader, yang dapat dihubungkan ke USB

Untuk memasukkan software dari Windows menggunakan bult in bootloader, dapat menggunakan software Flash Demonstrator dari STMicro http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stm32.html

Salah satu custom boot loader yang sering dipakai adalah STM32duino bootloader, yang memungkinkan pemrograman STM32F103 dengan menggunakan IDE Arduino. Petunjuk instalasinya ada di https://github.com/rogerclarkmelbourne/STM32duino-bootloader

Pengembangan

Pembuatan software untuk STM32 ini dapat dilakukan dengan berbagai cara:

Links:

Perbandingan Kecepatan I/O Digital pada Arduino

Dalam percobaan ini dibandingkan kecepatan I/O digital untuk beberapa board Arduino dan Arduino compatible sebagai berikut:

  • Arduino UNO R3 (http://www.arduino.cc/en/Main/ArduinoBoardUno)
  • Arduino Due (http://www.arduino.cc/en/Main/ArduinoBoardDue)
  • Arduino Nano clone
  • Nuvoton NuEdu-UNO
  • Intel Galileo (http://www.arduino.cc/en/ArduinoCertified/IntelGalileo)
Berbagai board Arduino yang diuji
Berbagai board Arduino yang diuji

Pengujian adalah dengan mengukur frekuensi output dari program Blink dari Arduino dengan delay dan tanpa delay.

Berikut ini program Blink asli dengan delay

void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);              // wait for a second
digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
delay(1000);              // wait for a second
}

Berikut ini program Blink asli tanpa delay

void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
}

Compiler yang digunakan adalah Intel-Arduino versi 1.6.0 untuk Intel Galileo dan Arduino ver 1.5.8 untuk board lainnya. Source code yang digunakan sama persis untuk semuanya. Pemrograman dilakukan di komputer berbasis Windows.

Pengukuran dilakukan dengan mengukur frekuensi sinyal di pin 13. Alat ukur frekuensi yang dipakai adalah multimeter Kyoritsu model 1009.

Pengukuran frekuensi I/O pada Nuvoton NuEdu-UNO
Pengukuran frekuensi I/O pada Nuvoton NuEdu-UNO

Berikut ini rangkuman hasil pengukurannya:

Board Arduino Prosesor Clock CPU
Dengan delay Tanpa delay
Arduino UNO ATmega328 16 MHz 499.1 Hz 93.9 kHz
Arduino Due Atmel SAM3X8E ARM Cortex-M3 (AT91SAM3X8E) 84 MHz 499.9 Hz 145.4 kHz
Arduino Nano clone ATmega328 16 MHz 499.9 Hz 94.1 kHz
Nuvoton NuEdu-UNO ARM Cortex-M0 NUC131SD2AE 50 MHz max 500.0 Hz 384.2 kHz
Intel Galileo Intel® Quark SoC X1000 400 MHz max 498.6 Hz 220.1 Hz

Analisis

  • Arduino UNO dan Arduino Nano menggunakan prosesor yang sama, jadi hasilnya praktis sama.
  • Pengujian ini hanya menunjukkan kecepatan akses ke I/O digital, tidak menunjukkan kemampuan umum.
  • Kecepatan I/O pada CPU jenis mikrokontroler lebih tinggi dibandingkan CPU general purpose. ATMega dan ARM Cortex-M0 adalah jenis CPU mikrokontroler.
  • Jika ingin melihat performance yang lebih umum perlu ditest dengan software benchmark yang standar.

Development Board Nuvoton NuTiny NuEdu-UNO V1.4

Berikut ini beberapa foto kemasan Nuvoton NuEdu-UNO yang dibeli dari Digiware:

Kemasan NuEdu-UNO
Kemasan NuEdu-UNO

Kemasan bagian depan
Kemasan bagian depan

 

Kemasan bagian belakang
Kemasan bagian belakang

 

Bonus ballpoint gel dari Digiware
Bonus ballpoint gel dari Digiware

Bonus ballpoint gel dari Digiware
Bonus ballpoint gel dari Digiware

Berikut ini foto boardnya

NuEdu bagian atas
Papan rangkaian NuEdu-UNO bagian atas

NuEdu bagian bawah
Papan rangkaian NuEdu-UNO bagian bawah

Berikut ini  foto close-up beberapa komponen.

 

Regulator 78M05

Regulator 78M05, ada kode yang dihilangkan

Regulator AMS1117
Regulator AMS1117 dengan output 3.3 volt

Kapasitor Tantalum 100 uF
Kapasitor Tantalum 100 uF

Dioda MDD SS24
Dioda MDD SS24

LED dan resistor
LED dan resistor

Prosesor NUC12SRE3DE
Prosesor NUC12SRE3DE yang dipakai di sebagai komponen utama programmer / debugger NuLink

Prosesor NUC131SD2AE
Komponen utama NuEDU, prosesor ARM Cortex-M0 NUC131SD2AE

Prosesor yang digunakan adalah NUC131SD2AE.

Penjelasan tipe prosesor NUC131SD2AE:

  • NUC131: Nuvoton NUC131 Family
  • S: kemasan LQFP64
  • D: Ukuran memori flash: 68 KB Flash ROM
  • 2: Ukuran memori SRAM 8 KB
  • A: Version A
  • E: Temperatur kerja -40 ~ 105 derajat Celcius

Prosedur untuk mengaktifkan Arduino pada board ini dapat dilihat di artikel [Instalasi Arduino Untuk NuEdu-UNO]

 

Board ARM Cortex M0 Produksi Lokal

Beberapa waktu lalu sudah ada vendor lokal yang menjual perangkat pengembangan ARM berbasis LPC Cortex M0. Harganya murah juga.

LPC800 Mikrokontroler ARM Dengan Kemasan DIP

Awal tahun 2012 lalu NXP telah mengeluarkan mikroprosesor ARM Cortex M0 dengan kemasan DIP (Dual In Line Package), yaitu tipe LPC1114FN28.

Model ini diikuti oleh model berikutnya yaitu LPC800 yang dikeluarkan pada akhir 2012. LPC800 ini juga dari keluarga ARM Cortex-M0.

NXP juga menyelenggarakan kompetisi terkait dengan produk baru ini, yaitu LPC800 Simplicity Challenge. Kompetisi ini nampaknya bertujuan mempromosikan keunggulan LPC800 yaitu kesederhanaan dan low power.

lpc800-simplicity-challenge-header-home-sub

Sejauh ini baru NXP yang membuat prosesor ARM dengan kemasan DIP, yaitu LPC810 dengan kemasan 8 pin DIP dari keluarga LPC800 dan LPC1114FN28 dengan kemasan 28 pin DIP dari keluarga LPC1100.

Menurut situs toko komponen online Element 14 (http://sg.element14.com), komponen ini harganya per unit adalah SGD 1,28 atau sekitar Rp 10.100,- saja. Lumayan murah, mengingat mikrokontroler Atmel AT89S51 di Bandung dijual sekitar Rp 12.500,- saja.

Berikut ini spesifikasi dari LPC800 tersebut:

Features and benefits

  • System:
    • ARM Cortex-M0+ processor, running at frequencies of up to 30 MHz with single-cycle multiplier and fast single-cycle I/O port
    • ARM Cortex-M0+ built-in Nested Vectored Interrupt Controller (NVIC)
    • System tick timer
    • Serial Wire Debug (SWD) and JTAG boundary scan modes supported
    • Micro Trace Buffer (MTB) supported
  • Memory:
    • 4 kB on-chip flash programming memory
    • 1 kB SRAM
  • Boot ROM API support:
    • Boot loader
    • USART drivers
    • I²C drivers
    • Power profiles
    • Flash In-Application Programming (IAP) and In-System Programming (ISP)
  • Digital peripherals:
    • High-speed GPIO interface connected to the ARM Cortex-M0+ IO bus with 6 General Purpose I/O (GPIO) pins with configurable pull-up/pull-down resistors
    • GPIO interrupt generation capability with boolean pattern-matching feature on eight GPIO inputs
    • Switch matrix for flexible configuration of each I/O pin function
    • State Configurable Timer (SCT) with input and output functions (including capture and match) assigned to pins through the switch matrix
    • Multiple-channel multi-rate timer for repetitive interrupt generation at up to four programmable, fixed rates
    • Self Wake-up Timer (WKT) clocked from either the IRC or a low-power, low-frequency internal oscillator
    • CRC engine
    • Windowed Watchdog timer
  • Analog peripherals:
    • Comparator with external voltage reference with pin functions assigned or enabled through the switch matrix
  • Serial interfaces:
    • Two USART interfaces with pin functions assigned through the switch matrix
    • One SPI controller with pin functions assigned through the switch matrix
    • One I²C-bus interface with pin functions assigned through the switch matrix
  • Clock generation:
    • 12 MHz internal RC oscillator trimmed to 1 % accuracy that can optionally be used as a system clock
    • Crystal oscillator with an operating range of 1 MHz to 25 MHz
    • Programmable watchdog oscillator with a frequency range of 9.4 kHz to 2.3 MHz
    • 10 kHz low-power oscillator for the WKT
    • PLL allows CPU operation up to the maximum CPU rate without the need for a high-frequency crystal. May be run from the system oscillator, the external clock input CLKIN, or the internal RC oscillator
    • Clock output function with divider that can reflect the crystal oscillator, the main clock, the IRC, or the watchdog oscillator
  • Power control:
    • Integrated PMU (Power Management Unit) to minimize power consumption
    • Reduced power modes: Sleep mode, Deep-sleep mode, Power-down mode, and Deep power-down mode
    • Power-On Reset (POR)
    • Brownout detect
  • Unique device serial number for identification
  • Single power supply
  • Available as DIP8 package

Features and benefits

  • System:
    • ARM Cortex-M0+ processor, running at frequencies of up to 30 MHz with single-cycle multiplier and fast single-cycle I/O port
    • ARM Cortex-M0+ built-in Nested Vectored Interrupt Controller (NVIC)
    • System tick timer
    • Serial Wire Debug (SWD) and JTAG boundary scan modes supported
    • Micro Trace Buffer (MTB) supported
  • Memory:
    • 4 kB on-chip flash programming memory
    • 1 kB SRAM
  • Boot ROM API support:
    • Boot loader
    • USART drivers
    • I²C drivers
    • Power profiles
    • Flash In-Application Programming (IAP) and In-System Programming (ISP)
  • Digital peripherals:
    • High-speed GPIO interface connected to the ARM Cortex-M0+ IO bus with 6 General Purpose I/O (GPIO) pins with configurable pull-up/pull-down resistors
    • GPIO interrupt generation capability with boolean pattern-matching feature on eight GPIO inputs
    • Switch matrix for flexible configuration of each I/O pin function
    • State Configurable Timer (SCT) with input and output functions (including capture and match) assigned to pins through the switch matrix
    • Multiple-channel multi-rate timer for repetitive interrupt generation at up to four programmable, fixed rates
    • Self Wake-up Timer (WKT) clocked from either the IRC or a low-power, low-frequency internal oscillator
    • CRC engine
    • Windowed Watchdog timer
  • Analog peripherals:
    • Comparator with external voltage reference with pin functions assigned or enabled through the switch matrix
  • Serial interfaces:
    • Two USART interfaces with pin functions assigned through the switch matrix
    • One SPI controller with pin functions assigned through the switch matrix
    • One I²C-bus interface with pin functions assigned through the switch matrix
  • Clock generation:
    • 12 MHz internal RC oscillator trimmed to 1 % accuracy that can optionally be used as a system clock
    • Crystal oscillator with an operating range of 1 MHz to 25 MHz
    • Programmable watchdog oscillator with a frequency range of 9.4 kHz to 2.3 MHz
    • 10 kHz low-power oscillator for the WKT
    • PLL allows CPU operation up to the maximum CPU rate without the need for a high-frequency crystal. May be run from the system oscillator, the external clock input CLKIN, or the internal RC oscillator
    • Clock output function with divider that can reflect the crystal oscillator, the main clock, the IRC, or the watchdog oscillator
  • Power control:
    • Integrated PMU (Power Management Unit) to minimize power consumption
    • Reduced power modes: Sleep mode, Deep-sleep mode, Power-down mode, and Deep power-down mode
    • Power-On Reset (POR)
    • Brownout detect
  • Unique device serial number for identification
  • Single power supply
  • Available as DIP8 package

Referensi

LPC1114FN28 Mikroprosesor ARM Dengan Kemasan Dual In Line Package (DIP)

ARM adalah salah satu arsitektur prosesor 32 bit yang banyak dipakai akhir-akhir ini. Prosesor keluarga ARM ini diproduksi oleh berbagai produsen mikroprosesor dengan berbagai kemasan yang berbeda. Di antara sekian banyak model prosesor ARM, setahu saya sampai saat ini hanya ada 1 model saja yang menggunakan kemasan DIP (Dual Inline Package), yaitu tipe LPC1114FN28 dari NXP. Adanya kemasan DIP ini tentu saja memudahkan para hobbiyst yang tidak sanggup menyolder kemasan SMD ataupun yang mau mencoba dulu di breadboard.

ARM Cortex M0 Dengan Kemasan DIP (foto dari http://www.adafruit.com/blog/2012/03/13/32-bit-meet-dip-arm-cortex-m0-in-dip-packages/)
ARM Cortex M0 Dengan Kemasan DIP (foto dari http://www.adafruit.com/blog/2012/03/13/32-bit-meet-dip-arm-cortex-m0-in-dip-packages/)

Fitur lengkapnya menurut website NXP adalah sebagai berikut:

  • ARM Cortex-M0 processor, running at frequencies of up to 50 MHz
  • ARM Cortex-M0 built-in Nested Vectored Interrupt Controller (NVIC)
  • Serial Wire Debug
  • System tick timer
  • 32 kB on-chip flash programming memory
  • 4 kB SRAM
  • In-System Programming (ISP) and In-Application Programming (IAP)
  • 22 General Purpose I/O (GPIO) pins with configurable pull-up/-down resistors
  • High-current output driver (20 mA) on one pin
  • Programmable WatchDog Timer (WDT)
  • 10-bit ADC with input multiplexing among 5 pins
  • UART with fractional baud rate generation
  • One SPI controller with SSP features and FIFO and multi-protocol capabilities
  • I²C-bus interface supporting full I²C-bus specification and Fast-mode Plus
  • Integrated PMU (Power Management Unit) to minimize power consumption
  • Power profiles residing in boot ROM (LPC1100Land LPC1100XL series only)
  • Unique device serial number for identification
  • Single 3.3 V power supply (1.8 V to 3.6 V)
  • Four general purpose counter/timers

Kemasan DIP28 dari NXP
Kemasan DIP28 dari NXP, sumber: http://www.nxp.com/documents/outline_drawing/sot117-1_po.pdf

Menurut seorang rekan yang bekerja di pabrik mikroprosesor, industri lebih menyukai kemasan SMD karena (a) lebih kecil dan (b) perlu material plastik lebih sedikit,  sehingga dengan kemasan SMD ini diperoleh perangkat yang lebih kecil dan harga yang lebih murah. Bagi orang yang terbiasa menggunakan kemasan DIP seperti yang banyak di ATMega, adanya ARM dengan kemasan DIP ini tentunya membuka peluang mengoprek ARM tanpa perlu belajar menyolder komponen SMD.

Referensi

Perangkat Pengembangan ARM Cortex M4 dari Waveshare

Beberapa minggu lalu sempat melihat Development Board dari Waveshare tipe 407V-D, kit berisi berbagai periferal yang dapat dipasang di  board STM32 Discovery sebagai board prosesornya. Belum sempat mengopreknya, namun sepintas sangat menarik karena periferalnya sangat bervariasi.

Perangkat Pengembangan Waveshare 407V-D
Perangkat Pengembangan Waveshare 407V-D

Salah satu periferal yang keren di situ adalah KAMERA. Ya, kamera digital, dan sudah ada juga contoh program untuk mengaksesnya. Selain itu juga ada interface ke memory card SD/micro SD. Bisa langsung praktek membuat kamera digital sederhana.

Referensi