MIKROE 4-20mA RT Click
MIKROE_4_20mA_RT_Click.h File Reference

An Arduino library for the 4-20 mA R & T Click Boards of MIKROE. More...

#include <Arduino.h>
#include <SPI.h>

Go to the source code of this file.

Classes

struct  RT_Click_Calibration
 Structure to hold the [bitval] to [mA] calibration points of either an R Click or a T Click Board. More...
 
class  T_Click
 Class to manage a MIKROE 4-20 mA T Click Board (MIKROE-1296). More...
 
class  R_Click
 Class to manage a MIKROE 4-20 mA R Click Board (MIKROE-1387). More...
 

Variables

const uint32_t DEFAULT_RT_CLICK_SPI_CLOCK = 1000000
 Default SPI clock frequency in Hz for the R and T Click Boards. More...
 
const float R_CLICK_FAULT_mA = 3.8
 Current threshold in mA below which to indicate a fault state in the R Click reading. The reading will be set to NAN in that case. More...
 

Detailed Description

An Arduino library for the 4-20 mA R & T Click Boards of MIKROE.

Author
Dennis van Gils (vangi.nosp@m.ls.d.nosp@m.ennis.nosp@m.@gma.nosp@m.il.co.nosp@m.m)

Variable Documentation

◆ DEFAULT_RT_CLICK_SPI_CLOCK

const uint32_t DEFAULT_RT_CLICK_SPI_CLOCK = 1000000

Default SPI clock frequency in Hz for the R and T Click Boards.

Maximum SPI clock frequencies taken from the datasheets:

  • MCP3201 ADC chip (R Click): 1.6 MHz
  • MCP4921 DAC chip (T Click): 20 MHz

Hence, we fix the default SPI clock to a comfortable 1 MHz for both.

◆ R_CLICK_FAULT_mA

const float R_CLICK_FAULT_mA = 3.8

Current threshold in mA below which to indicate a fault state in the R Click reading. The reading will be set to NAN in that case.

A fault state can occur due to a broken current loop, a disconnected device or an error happening at the transmitter side. Typical value is 3.8 mA.