0% found this document useful (0 votes)
13 views

RM3100 Arduino Quick Guide

The RM3100 Arduino Quick Guide provides instructions for connecting the RM3100 Evaluation Board to an Arduino using either I2C or SPI interfaces, detailing hardware requirements and pin assignments. It includes steps for installing the Arduino IDE, setting up the necessary board packages, and running demo code to interact with the RM3100. The guide emphasizes the importance of configuring specific options in the code to optimize measurement settings and data readiness methods.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

RM3100 Arduino Quick Guide

The RM3100 Arduino Quick Guide provides instructions for connecting the RM3100 Evaluation Board to an Arduino using either I2C or SPI interfaces, detailing hardware requirements and pin assignments. It includes steps for installing the Arduino IDE, setting up the necessary board packages, and running demo code to interact with the RM3100. The guide emphasizes the importance of configuring specific options in the code to optimize measurement settings and data readiness methods.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

2331 Circadian Way 707-566-2260 main www.pnicorp.

com
Santa Rosa, CA 95407-5437 USA 707-566-2261 fax

RM3100 Arduino Quick Guide


Table of Contents
1 RM3100 ARDUINO OVERVIEW ........................................................................................ 2
2 HARDWARE CONNECTION AND SET UP ........................................................................... 2
3 INSTALL ARDUINO IDE SOFTWARE .................................................................................. 7
4 RUN RM3100 ARDUINO CODE ......................................................................................... 9

Version # Changes Date

Draft Initial Version Draft 11/24/2021


1 RM3100 ARDUINO OVERVIEW
PNI developed a demo program using the Arduino IDE on Win PC for customers to get
started using the RM3100 with an Arduino. RM3100 supports I2C and SPI, it’s up to
customer to decide which interface to use. Connection between RM3100 and Arduino can
be either I2C or SPI, Arduino as master and RM3100 as slave for both.

To run this demo program, following is the minimum requirement.


Hardware
RM3100 Evaluation Board or Break Board
Any Arduino (In this document, we used the NUCLEO-L152RE which supports Arduino)
Win7 or later PC

Software
Arduino IDE

2 HARDWARE CONNECTION AND SET UP

I. RM3100 Test Boards Pin Assignments (Pin numbers run counterclockwise from top left)
Note: Pin 1 is next to the top left white triangle.
Pin# Pin Name Description

SCK / SPI interface (SCK) – Serial clock input


1
SCL I2C interface (SCL) – Serial clock line
SO / SPI interface (SO) – Master Input, Slave Output
2
SA1 I2C interface – Bit 1 of slave address
SI / SPI interface (SI) – Master Output, Slave Input Serial Data
3
SDA I2C interface (SDA) – Serial Data Line
SSN / SPI interface – Active low to select port
4
SA0 I2C interface – Bit 0 of slave address
5 DRDY Status line
7 AVSS Ground pin for analog section of ASIC
10 I2CEN I2C enable pin (HIGH = I2C, LOW = SPI)
12 DVDD Supply voltage for digital section of ASIC.
13 AVDD Supply voltage for analog section of ASIC
14 DVSS Ground pin for digital section of ASIC
6, 8, 9, 11 NC Do not connect

Page | 2
Nov 24, 2021
PNI Document
Picture of RM 3100 Breakout Board below:

II. NUCLEO-L152RE (Arduino) SPI and I2C Pin Assignments

a. Note: If you are using a regular Arduino board (Nano, Uno, Mega, etc.) you will
have to find the correct corresponding pins from your specific board’s data sheet
as they will be different from this table below.

Page | 3
Nov 24, 2021
PNI Document
Pin# Pin Name Description

D15 SCL I2C interface (SCL) – Serial clock line


D14 SDA I2C interface (SDA) – Serial Data Line
AVDD AVDD/+3V3 Power (+3.3 V)
GND GND Ground
D13 SCK SPI Serial Clock
D12 MISO SPI Master In Slave Out
D11 MOSI SPI Master Out Slave In
CS Slave Select control line that allows slaves to be turned on and
D10
off via hardware control
D9 GPIO General Purpose Input pin used for status line

Red box above highlights the pins used for I2C and SPI communications on NUCLEO-L152RE

Page | 4
Nov 24, 2021
PNI Document
III. I2C Interface. Connect RM3100 I2C pins to Arduino I2C pins, like in the following table.

RM3100 I2C Pins Arduino I2C

Pin# Pin Name Description Pin#


1 SCL I2C interface (SCL) – Serial clock line D15 SCL
2 SA1 I2C interface – Bit 1 of slave address (LOW = 0) GND
3 SDA I2C interface (SDA) – Serial Data Line D14 SDA
4 SA0 I2C interface – Bit 0 of slave address (LOW = 0) GND
5 DRDY Status line (Optional) D9 (GPIO input)
7 AVSS Ground pin for analog section of ASIC GND
10 I2CEN I2C enable pin (HIGH = I2C) AVDD (+3V3)
12 DVDD Supply voltage for digital section of ASIC AVDD (+3V3)
13 AVDD Supply voltage for analog section of ASIC AVDD (+3V3)
14 DVSS Ground pin for digital section of ASIC GND
6, 8, 9, 11 NC Do not connect

Note: If you are using I2C, you may have to enable the internal pullup resistors in the
code for your specific board. The sample code successfully enables pullup resistors for
the NUCLEO-L152RE board specifically and hasn’t been tested with other boards such as
the Arduino Uno or Arduino Mega. You can also use external 4.7k Ohm pull up resistors
on the SCL and SDA lines instead of the internal resistors.

Page | 5
Nov 24, 2021
PNI Document
IV. If SPI interface is desired, please connect RM3100 SPI pins to Arduino SPI pins, like in the
following table.

RM3100 SPI Pins Arduino SPI

Pin# Pin Name Description Pin#


1 SCK SPI interface (SCK) – Serial clock input D13SCK
2 SO SPI interface (SO) – Master Input, Slave Output D12 MISO
3 SI SPI interface (SI) – Master Output, Slave Input D11 MOSI
4 SSN SPI interface – Active low to select port D10 SS
5 DRDY Status line (Optional) D9 (GPIO input)
7 AVSS Ground pin for analog section of ASIC GND
10 I2CEN I2C enable pin (HIGH = I2C, LOW=SPI) GND
12 DVDD Supply voltage for digital section of ASIC AVDD (+3V3)
13 AVDD Supply voltage for analog section of ASIC AVDD (+3V3)
14 DVSS Ground pin for digital section of ASIC GND
6, 8, 9, 11 NC Do not connect

V. Plug in Arduino USB cable to the USB port on your PC

Page | 6
Nov 24, 2021
PNI Document
3 INSTALL ARDUINO IDE SOFTWARE

I. To use the demo code, you will first need to have the Arduino IDE installed. If you don’t
have it installed, here is a link to version 1.8.16 of Arduino IDE. You can also check the
IDE downloads page to see if there are any newer updates but the demo code was
written on version 1.8.16, so it may be incompatible with newer versions. Open the
*.exe and install the program using any settings you want.

II. If you are using a STM 32 board (like the NUCLEO-L152RE in this guide) then you must
install the STM 32 board package first. If you are using a regular Arduino board (UNO,
Mega, etc.) you can skip to step III.
a. Open the Arduino IDE program and in the toolbars press File > Preferences
b. In “Additional Boards Manager URLs:” copy and paste:
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicro
electronics_index.json and press OK to close the Preferences window

Page | 7
Nov 24, 2021
PNI Document
c. In the toolbars press Tools > Board: > Boards Manager
d. Search “stm 32” and install the latest version of “STM32 MCU based boards”
then close the Boards Manager page

e. Now select the corresponding NUCLEO board group in Tools > Board: and then
the specific board in Tools > Board part number:
f. Finally while the Arduino is connected to the PC, press Tools > Port and pick the
USB port the Arduino is connected to (this should be something similar to “COM
6” or “COM 3”). Your “Tools” dropdown should look something like this:

Page | 8
Nov 24, 2021
PNI Document
III. If you are using a standard Arduino (Nano, Uno, Mega, etc.), open the Arduino IDE
program and in the tool bar press Tools > Boards and choose your specific Arduino
board. Also, while the Arduino is connected to the PC, press Tools > Port and pick the
USB port the Arduino is connected to (this should be something like “COM 6” or “COM
3”). Your “Tools” dropdown should look something like this:

4 RUN RM3100 ARDUINO CODE


I. In the Arduino IDE, File > Open “RM3100_Arduino_I2C.ino” or
“RM3100_Arduino_SPI.ino” file depending on which communication setup you have
decided on. The code should open and look like this:

Page | 9
Nov 24, 2021
PNI Document
II. The red box above highlights the options you can change.
a. The option initialCC is the cycle count you want the RM 3100 to measure in.
i. The internal clock count of RM3100 MagI2C ASIC establishes the number
of sensor oscillation cycles. The number of oscillation cycle is “Cycle
Count”. Cycle Count as default value is 200 or 0xC8 in hex.
ii. Increasing the cycle count value increases measurement gain and
resolution. Lowering the cycle count value reduces acquisition time,
which increases maximum achievable sample rate or, with a fixed sample
rate, decreases power consumption.

iii. The minimum value is ‘0’ and the maximum is 65,536. However,
quantization issues generally dictate working above a cycle count value of
~30, while noise limits the useful upper range to ~400 cycle counts.

b. The option “singleMode” is used to decide which measurement mode to use:


single measurement mode or continuous measurement mode
i. Setting singleMode to “0” will enable continuous measurement mode
ii. Setting singleMode to “1” will enable single measurement mode

c. The option “useDRDYPin” is used to decide which method to use to wait for data
to be ready
i. Setting “useDRDYPin” to “0” will make the Arduino read from the internal
status register to see if data is ready
ii. Setting “useDRDYPin” to “1” will make the Arduino read from the
Pin_DRDY (pin D9) to see if data is ready
1. If you use the DRDY pin then you must have pin D9 connected to
RM 3100 pin 5 (DRDY)

Page | 10
Nov 24, 2021
PNI Document
III. Once you have the desired options selected, press upload button (Outlined in red in the
top left of the image below) to verify and upload the code on to the Arduino
a. You can also use “Ctrl + U” or press Sketch > Upload to upload

IV. After the code is uploaded to the Arduino, press the orange highlighted button in the
top right of the image above or press Tools > Serial Monitor or “Ctrl + Shift + M” to open
the serial monitor. This is where the output of the RM 3100 will be printed

Page | 11
Nov 24, 2021
PNI Document

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy