diff --git a/gpio/nrf52/bc832-nrf-ftdi-interior.png b/gpio/nrf52/bc832-nrf-ftdi-interior.png new file mode 100644 index 0000000000000000000000000000000000000000..1504a724d4f9edf684a3490817ae2c7d3a21410f Binary files /dev/null and b/gpio/nrf52/bc832-nrf-ftdi-interior.png differ diff --git a/gpio/nrf52/bc832-nrf-ftdi-layout.png b/gpio/nrf52/bc832-nrf-ftdi-layout.png new file mode 100644 index 0000000000000000000000000000000000000000..34b8bde59fa0eb6a6813a62a41126596f06e3dda Binary files /dev/null and b/gpio/nrf52/bc832-nrf-ftdi-layout.png differ diff --git a/gpio/nrf52/bc832-nrf-ftdi-traces.png b/gpio/nrf52/bc832-nrf-ftdi-traces.png new file mode 100644 index 0000000000000000000000000000000000000000..660efe54b698f9a402ceb804f775d7d4136fa49d Binary files /dev/null and b/gpio/nrf52/bc832-nrf-ftdi-traces.png differ diff --git a/gpio/nrf52/board.jpg b/gpio/nrf52/board.jpg new file mode 100644 index 0000000000000000000000000000000000000000..91dffe9b14425d37db388f21c486a873799f0215 Binary files /dev/null and b/gpio/nrf52/board.jpg differ diff --git a/gpio/nrf52/index.html b/gpio/nrf52/index.html index 0908ddb4e9090857e752b549d8243e14527f2278..5308feeab548e6005859708755e0494f64a4c9a0 100644 --- a/gpio/nrf52/index.html +++ b/gpio/nrf52/index.html @@ -20,20 +20,22 @@ pre code { <figcaption>Ring oscillator with nrf52.</figcaption> </figure> -<p>This ring oscillator runs on the NRF52 BLE SOC using the Adafruit feather development board. The NRF52 has an ARM Cortex M4F running at 64 MHz with built in BLE radio. An arduino sketch for the oscillator is available <a href='ring.ino'>here</a>, or visible below.</p> +<p>This ring oscillator runs on the NRF52832 SOC using the Fanstel BC832 module. The NRF52 has an ARM Cortex M4F running at 64 MHz with built in 2.4GHz radio. An arduino sketch for the oscillator is available <a href='ring.ino'>here</a>, or visible below.</p> <pre> <code> -const int pin_in = g_ADigitalPinMap[25]; -const int mask_in = 1 << pin_in; -const int pin_out = g_ADigitalPinMap[26]; -const int mask_out = 1 << pin_out; +#define portout NRF_GPIO->OUT +#define portin NRF_GPIO->IN +#define pin_in 11 +#define mask_in 1 << pin_in +#define pin_out 12 +#define mask_out 1 << pin_out void setup() { pinMode(pin_out, OUTPUT); - pinMode(pin_in, INPUT); + NRF_GPIO->PIN_CNF[pin_in] = 0; //set input, no pullup/down, standard drive, no sense while(1){ - NRF_GPIO->IN & mask_in ? NRF_GPIO->OUTCLR = mask_out : NRF_GPIO->OUTSET = mask_out; + portin & mask_in ? NRF_GPIO->OUTCLR = mask_out : NRF_GPIO->OUTSET = mask_out; //218ns period } } @@ -41,7 +43,12 @@ void loop() {} </code> </pre> -<p>Note: This test was run on a the Adafruit Feather Dev board, which uses the Raytac MDBT42Q module, incorporating the NRF52. The module retails for $7, the development board retails $24. Other (untested) modules are available for a lower price from Fanstel.</p> +<figure> +<img src="bc832-nrf-ftdi-layout.png" height=25%> +<img src="board.jpg" height=25%> +<figcaption>PCB with Fanstel BC832 module.</figcaption> +</figure> + <p>With the generic Arduino library calls, the ring oscillator is much slower:</p> diff --git a/gpio/nrf52/nrf52.png b/gpio/nrf52/nrf52.png index cbc9b44316cafbac032decf50bce4c302b225296..ffd62afcf85caf480b181aa9a0da24cedb6b8b0e 100755 Binary files a/gpio/nrf52/nrf52.png and b/gpio/nrf52/nrf52.png differ diff --git a/gpio/nrf52/ring.ino b/gpio/nrf52/ring.ino index bdb995e2e8c9c68cc0aa3522a954af969c4d1805..8bb5910b6b739ec498293a6c2a0eb233e464239e 100644 --- a/gpio/nrf52/ring.ino +++ b/gpio/nrf52/ring.ino @@ -1,14 +1,16 @@ -const int pin_in = g_ADigitalPinMap[25]; -const int mask_in = 1 << pin_in; -const int pin_out = g_ADigitalPinMap[26]; -const int mask_out = 1 << pin_out; +#define portout NRF_GPIO->OUT +#define portin NRF_GPIO->IN +#define pin_in 11 +#define mask_in 1 << pin_in +#define pin_out 12 +#define mask_out 1 << pin_out void setup() { pinMode(pin_out, OUTPUT); - pinMode(pin_in, INPUT); + NRF_GPIO->PIN_CNF[pin_in] = 0; //set input, no pullup/down, standard drive, no sense while(1){ - NRF_GPIO->IN & mask_in ? NRF_GPIO->OUTCLR = mask_out : NRF_GPIO->OUTSET = mask_out; + portin & mask_in ? NRF_GPIO->OUTCLR = mask_out : NRF_GPIO->OUTSET = mask_out; //218ns period } } -void loop() {} \ No newline at end of file +void loop() {} diff --git a/ring.json b/ring.json index 056cac3168051d70f2f2dbbc628e5d8379f24989..d6ebb92e7371d0d54254e166951a7eb9b8e7baad 100644 --- a/ring.json +++ b/ring.json @@ -15,7 +15,7 @@ "name":"nrf52", "serial_number":"", "subdirectory_path":"rf/nrf52832", - "dev_board_price":5.0, + "dev_board_price":7.0, "dev_board_sales link":"", "ic_price":0.0, "ic_sales_link":"", @@ -35,7 +35,7 @@ "name":"nrf52 ble", "serial_number":"", "subdirectory_path":"rf/nrf52832_ble", - "dev_board_price":5.0, + "dev_board_price":7.0, "dev_board_sales link":"", "ic_price":0.0, "ic_sales_link":"", @@ -191,7 +191,7 @@ "dev_board_sales_link":"", "ic_price":3.00, "ic_sales_link":"", - "ring_period":0.377 + "ring_period":0.218 } ] } \ No newline at end of file