Skip to content
Snippets Groups Projects
Commit 27853bcc authored by Sam Calisch's avatar Sam Calisch
Browse files

update nrf52 ring oscillator

parent a81da96a
No related branches found
No related tags found
No related merge requests found
Pipeline #
gpio/nrf52/bc832-nrf-ftdi-interior.png

6.35 KiB

gpio/nrf52/bc832-nrf-ftdi-layout.png

147 KiB

gpio/nrf52/bc832-nrf-ftdi-traces.png

12.3 KiB

gpio/nrf52/board.jpg

92.9 KiB

......@@ -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>
......
gpio/nrf52/nrf52.png

7.31 KiB | W: | H:

gpio/nrf52/nrf52.png

9.05 KiB | W: | H:

gpio/nrf52/nrf52.png
gpio/nrf52/nrf52.png
gpio/nrf52/nrf52.png
gpio/nrf52/nrf52.png
  • 2-up
  • Swipe
  • Onion skin
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
}
}
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment