본문 바로가기

개발자/Arduino

Adafruit Feather nRF52840 Express 02. Hardware 설계와 참고자료

반응형

 

 

Adafruit Feather nRF52840 Express 보드를 스마트 팜 데이터 수집 플랫폼으로 사용하기 위해 하드웨어 설계를 한다. 우선 nRF52840 보드를 기반으로 하드웨어 설계를 하기 위해 보드 위의 Pin을 중심으로 어떻게 사용해야 하는지에 대해 설명한다.  

 

현재까지 nrf52840 보드 강의 포스트입니다. 참고하세요.

 

Adafruit Feather nRF52840 Express 01. 소개

Adafruit Feather nRF52840 Express 02. Hardware 설계와 참고자료

Adafruit Feather nRF52840 Express 03. Arduino IDE 환경 설정

Adafruit Feather nRF52840 Express 04. Bootloader Update

 

 

 

Adafruit Feather nRF52840 Express

 

Adafruit Feather nRF52840 Express 보드 특징을 간단히 알아보자.  

 

  • Bluetooth Low Energy and native USB support
  • 'All-in-one' Arduino-compatible + Bluetooth Low Energy with built in USB plus battery charging
  • Arduino IDE support
  • Cortex-M4 processor nRF52832 projects downward compatible
  • Pre-programed the chip with our UF2 bootloader 

 

우선 보드의 전원 핀에 대해 알아보자. 

 

Adafruit Feather nRF52840 Express 전원핀

 

  • 3V: used to supply 3.3V power to external sensors, breakouts or Feather Wings
  • LIPO Input (Bat): Voltage supply from the optional rechargeable cell. Can be connected via JST PH connector.
  • VREG Enable (En): Can be set to GND to disable the 3.3V output. By default set to HIGH.
  • USB Power (USB): Supplies voltage from USB (4.5-5.2V) 

 

Analog 입력

 

  • 6 analog pins (A0–A5)
  • 2 ADC pins (AREF, VIVD)

AREF (A7): optional external analog reference.

VIDV (A6): allows measurement of battery charge. Can be used as an output. 

 

 

PWM

Output Any GPIO pin can be configured as PWM.

 

I2C Pins

  • Require external pullup resistors to function. Not present by default
  • All Adafruit breakouts normally have pullups, hence this likely won't be an issue

User Switches

  • A general purpose switch is accessible via D7
  • On board reset, press this button to force USB bootloader mode

SWD Connector

  • Long header at center board
  • For advanced debugging or to reprogram the board using a 1.27mm SWD cable

LEDs

Adafruit Feather nRF52840 Analog Inputs

3개의 기본 LED 가 있다.

1. D3: general red LED. Can be used for any desired purpose. Used as a status indicator.

2. CONN: blue LED. Indicates connection status for bluetooth

3. CHG: indicates a charging battery if connected to a USB power supply 

 

보드에는 RGB Neo Pixel 이라는 통합 RGB 조명이 있습니다. PIN_NEOPIXEL과 같은 코드를 통해 색상을 구성할 수 있습니다. 보드가 올바르게 설정되었는지 테스트하는 좋은 방법입니다. 예제 코드는 아래와 같습니다.

 

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

 

이하 참고

 

SDK

Drivers

To install the drivers, you know where to go by now.

API

Arduino Bluefruit nRF52 API reference The API is class-based, with the following classes being most commonly used (from Adafruit's documentation):

Languages

IDEs

The Feather supports the usage of the Arduino IDE, but the IDE doesn't include the support out of the box. To install:

  1. Download and install the Arduino IDE (At least v1.6.12)
  2. Start the Arduino IDE
  3. Go into Preferences
  4. Add https://www.adafruit.com/package_adafruit_index.json as an 'Additional Board Manager URL'
  5. Restart the Arduino IDE
  6. Open the Boards Manager from the Tools -> Board menu and install 'Adafruit nRF52 by Adafruit'
  7. Once the BSP is installed, select 'Adafruit Bluefruit nRF52 Feather' from the Tools -> Board menu, which will update your system config to use the right compiler and settings for the nRF52.
  8. Write, compile, upload over USB.

Set up CircuitPython Quick Start

https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/circuitpython

Board Testing

  1. Select the Board Target
  2. Select the USB CDC Serial Port
  3. Update the bootloader (nRF52832 Feather Only)
  4. Run a Test Sketch https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather/arduino-board-setup

CircuitPython for nRF53840 Download

https://circuitpython.org/board/feather_nrf52840_express/

BootLoader & Source Code

https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/tag/0.2.13

Libraries

Adafruit nRF52 Library

  • dafruit-nrfutil is based on Nordic Semiconductor ASA's pc-nrfutil
  • freeRTOS as operating system
  • tinyusb as usb stack
  • nrfx for peripherals driver
  • littlefs for internal file system

https://github.com/adafruit/Adafruit_nRF52_Arduino/tree/master/libraries

Adafruit Sponsored Libraries and Drivers from CircuitPython

https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/master/docs/drivers.rst

Bluefruit App

Using your iOS or Android phone/tablet as a controller

A USB bootloader lets you quickly use it with the Arduino IDE or to install CircuitPython.

Sent data Format

Each Controller data packet sent is prefixed with single byte char “!” (0x21) followed by a single byte char initial for identification. Sensor data values are encoded as floats of 4 byte length.
Each packet ends with a single byte checksum for validation.

Controller Test

https://github.com/CollinCunningham/BLE_UART_Controller_Test/blob/master/BLE_UART_Controller_Test.ino

  • Sensors Quaternion, Accelerometer, Gyro, Magnetometer and Location (GPS)
  • 8-button Control Pad 
  • Colour Picker

 

흠... 일모도원!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

반응형

더욱 좋은 정보를 제공하겠습니다.~ ^^