Nordic Semiconductor · NRF52840-DK

nRF52840 DK

Nordic nRF52840 DK: an nRF52840 (Cortex-M4F, Bluetooth LE, Thread, Zigbee) with an on-board J-Link and Arduino Uno headers.

EmbassyZephyrNordic Semiconductor
nRF52840 DKNordic Semiconductor · nRF52840 · Cortex-M4F · 64 MHz · 256 KB · bare metalnRF52840 DK123456789101112131can0 CANCAN (an MCP2515 shield, Arduino header) · sckP1_15, mosi P1_13, miso P1_14, cs P1_12, intP1_032uart0 UARTUART (J-Link virtual COM) · tx P0_06, rx P0_083usb USBJ-Link USB4radio RadioBluetooth LE / 802.15.45pwr Power5 V USB6vdd PowerVDD (Arduino power header, 3.0 V)7v5 Power5 V (Arduino power header)8button1 GPIOPush button switch 0 (low when pressed) · ioP0_119button2 GPIOPush button switch 1 (low when pressed) · ioP0_1210button3 GPIOPush button switch 2 (low when pressed) · ioP0_2411button4 GPIOPush button switch 3 (low when pressed) · ioP0_2512i2c0 I²CI2C0 (Arduino D14, D15) · sda P0_26, scl P0_2713spi1 SPISPI1 (Arduino A5, A4, D7) · sck P0_31, mosiP0_30, miso P1_084 GPIO pins, each a port (led1, …)

En bref

nRF52840 development kit: one 64 MHz Cortex-M4F, 256 KB RAM, 1 MB flash, Bluetooth LE and 802.15.4. No CAN controller: CAN goes through an MCP2515 shield on the Arduino header (SPI on D13/D11/D12, CS D10, INT D2).

Horloge64 MHz
Flash1 MB
RAM256 KB
GPIO33
Logique3 V

Caractéristiques

Lues dans le modèle de la carte, dans le store.

Processeur
nRF52840 · 1× Cortex-M4F · chip "nrf52840"
Horloge
64 MHz
Flash
1 MB
RAM
256 KB
Broches GPIO
33
CAN (ADC)
SAADC 8 ch 12-bit
Niveau logique
3 V
Alimentation
5 V USB (in); VDD (Arduino power header, 3.0 V): 3 V; 5 V (Arduino power header): 5 V
Courant par broche
pas encore dans le modèle de la carte
Bus
UART ×2, I²C ×2, SPI ×4, USB ×1
Sur n’importe quelle broche
UART, I²C, SPI, PWM
Tourne
sans OS (bare metal)

Brochage

Chaque broche selon ce qu’elle fait. Survolez ou touchez une broche pour voir ce qu’elle peut être d’autre.

  • Alimentation 3
  • Numérique 14
  • Analogique 5
  • Bus 10
  • Contrôle 4
  • P0_02P0_02
  • P0_03P0_03
  • P0_04P0_04
  • P0_11P0_11
  • P0_12P0_12
  • P0_13P0_13
  • P0_14P0_14
  • P0_15P0_15
  • P0_16P0_16
  • P0_24P0_24
  • P0_25P0_25
  • P0_26P0_26
  • P0_27P0_27
  • P0_28P0_28
  • P0_29P0_29
  • P0_30P0_30
  • P0_31P0_31
  • P1_00P1_00
  • P1_01P1_01
  • P1_02P1_02
  • P1_03P1_03
  • P1_04P1_04
  • P1_05P1_05
  • P1_06P1_06
  • P1_07P1_07
  • P1_08P1_08
  • P1_09P1_09
  • P1_10P1_10
  • P1_11P1_11
  • P1_12P1_12
  • P1_13P1_13
  • P1_14P1_14
  • P1_15P1_15
  • pwr5 V USB
  • vddVDD (Arduino power header, 3.0 V)
  • v55 V (Arduino power header)

Attention

Ce qu’archec vérifie pour cette carte, d’après ses données. Chaque point nomme la vérification qui l’attrape.

  • Ses broches travaillent en 3 V. La sortie d’un capteur 5 V sur l’une d’elles demande un adaptateur de niveau entre les deux.

    vérification pin-level

  • La carte utilise déjà P0_13 (Green LED 0 (on when low)), P0_14 (Green LED 1 (on when low)), P0_15 (Green LED 2 (on when low)), P0_16 (Green LED 3 (on when low)), P0_11 (Push button switch 0 (low when pressed)), P0_12 (Push button switch 1 (low when pressed)), P0_24 (Push button switch 2 (low when pressed)), P0_25 (Push button switch 3 (low when pressed)). Autre chose branché là entre en conflit.

    vérification pin-conflict

  • Elle donne 3 V (VDD (Arduino power header, 3.0 V)), 5 V (5 V (Arduino power header)). Alimentez chaque pièce depuis une sortie à sa propre tension.

    vérification board-supply

  • Elle a 2 UART, 2 I²C, 4 SPI. Un bus de plus d’un même type est une erreur.

    vérification board-peripheral

Premier modèle

Un clignotement pour cette carte : la carte, une LED et une partie qui l’inverse toutes les 500 ms. archec le vérifie, puis écrit le code à droite.

main.archeOuvrir dans le playground
project Blink "Blink" {
  version "0.1.0"
  edition "1.0"
  uses arche-hw-store "^0.1"
}

include "arche-hw-store/boards/nrf52840-dk/nrf52840-dk.arche"
include "arche-hw-store/devices/led/led.arche"

/// Turns the LED over at each step.
component Blinker "Blinker" {
  out led: requires Led
  fn blink "Blink" {
    ```arche
    led.toggle()
    ```
    wcet 50us
  }
}

/// The board, an LED on the board's Green LED 0 (on when low) (P0_13), and the blinker.
system Hw "Blink" {
  part board:   Nrf52840DK
  part led:     GpioLed { in pin { pins { pin P0_13 } } }
  part blinker: Blinker
  blinker.led -> led.led
}

/// The firmware: the blinker every 500 ms.
deployment OnBoard "On the board" {
  system Hw
  platform Hw
  binary blink on board {
    thread main "Blink" { runs blinker; period 500ms; step blink }
  }
}
archec gen --target embassyblink/src/app/blinker.rs
//! Your code: the state and behaviour of this part. Write it between the USER CODE markers:
//! when the model changes, `archec gen` writes this file again around them (a new function, a
//! new input) and keeps them. Edit outside them and the file is yours: it is left as it is,
//! and the compiler says what to add (a new trait method).

#[allow(unused_imports)]
use crate::arche::*;

// @arche blinker main.arche:25 part
/// blinker
#[derive(Default)]
pub struct Blinker {}

impl BlinkerBehaviour for Blinker {
    // @arche blinker.blink main.arche:13 fn
    async fn blink(&mut self, _out: &BlinkerOut) {
        // Blink: from the model (```arche)
        _out.call_led_toggle().await;
    }
}

blink/src/app/blinker.rs, l’un des 16 fichiers qu’archec écrit.

Ouvrir dans le playground

Comparer toutes les cartes