---
title: Notecard Interfaces
description: Requests can be issued to the Notecard over USB, UART, or I2C. The Serial UART interface is fixed at a baud rate of 9600, with eight data bits, no parity bit, and one stop bit (9600/N-8-1).
source_url: https://dev.blues.io/notecard/notecard-walkthrough/notecard-interfaces/
canonical_url: https://dev.blues.io/notecard/notecard-walkthrough/notecard-interfaces/
markdown_url: https://dev.blues.io/notecard/notecard-walkthrough/notecard-interfaces.md
---

# Notecard Interfaces

Requests can be issued to the Notecard over `USB`, `UART`, `AUX UART`, or `I2C`. Every interface speaks the same protocol: newline-delimited JSON requests in, newline-delimited JSON responses out—so the only thing that changes between them is how your host opens the connection.

- The `USB` interface appears to a computer as a USB 2.0 Full Speed CDC device, and works on Linux, Windows, and macOS without a driver. It's most useful during development, when you want to talk to a Notecard from your computer using the [in-browser terminal](https://dev.blues.io/terminal/), the [Notecard CLI](https://dev.blues.io/tools-and-sdks/notecard-cli.md), or a terminal emulator.

- The Serial `UART` interface is fixed at a baud rate of 9600, with eight data bits, no parity bit, and one stop bit (`9600/N-8-1`).

- The Serial `AUX UART` interface is an optional interface which implements the same JSON serial command/response protocol as Serial `UART`. This interface is only enabled when `AUX_EN_P` (pin 56) is pulled up to `VIO`. It is fixed at a baud rate of 115200, with eight data bits, no parity bit, and one stop bit (`115200/N-8-1`).

- The Notecard `I2C` interface is available at address `0x17`, but can be reconfigured using a [`card.io`](https://dev.blues.io/api-reference/notecard-api/card-requests.md#card-io) request. This interface implements a straightforward serial over `I2C` protocol.

## Using the Notecard Interface with a Firmware Library

The simplest way to initiate a connection with the Notecard from firmware is with one of our [firmware libraries](https://dev.blues.io/tools-and-sdks/firmware-libraries.md). Using this approach, you can initialize the Notecard over the appropriate interface using a few lines of code. For instance, with Serial:

**C/C++**

```cpp
#include <Notecard.h>

Notecard notecard;
notecard.begin(Serial1, 9600);
```

**Python**

```python
import notecard
import serial

port = serial.Serial("/dev/serial0", 9600)
card = notecard.OpenSerial(port)
```

Or with `I2C`:

**C/C++**

```cpp
#include <Notecard.h>

Notecard notecard;
notecard.begin();
```

**Python**

```python
import notecard
from periphery import I2C
port = I2C("/dev/i2c-1")

# The second and third arguments are the Notecard's I2C address and the
# maximum I2C transfer size. Passing 0 for either uses the default.
card = notecard.OpenI2C(port, 0, 0)
```

## Using the Notecard Interface with Simple Serial I/O

Alternatively, it's possible to manually communicate with the Notecard over Serial in firmware using language-equivalent `print()` and `read()` functions.

**C/C++**

```cpp
#define txRxPinsSerial Serial1
#define myProductID "com.my-company:my-product"

// Initialize the Notecard
txRxPinsSerial.begin(9600);
txRxPinsSerial.println("\n");

// Send a hub.set request
txRxPinsSerial.println("{\"req\":\"hub.set\",\"product\":\"" myProductID "\"}");
```

**Python**

```python
import json
import serial

myProductID = "com.my-company:my-product"
port = serial.Serial('/dev/ttyS0', 9600)
port.write(b'\n')

req = {"req": "hub.set"}
req["product"] = myProductID
port.write(bytearray(json.dumps(req), 'utf8'))
port.write(b'\n')
```

When reading and writing directly to the Notecard, there are important timing considerations that are performed for you by the [firmware libraries](#using-the-notecard-interface-with-a-firmware-library). To learn more about raw Notecard communication, please refer to our guide for [Notecard Communication Without a Library](https://dev.blues.io/guides-and-tutorials/notecard-guides/notecard-communication-without-a-library.md).

## The Notecard Serial-over-I2C Protocol

If, on the other hand, you wish to use `I2C` without one of our firmware libraries, you'll need to write your own logic for writing to and reading from the bus. Your approach will vary from one language to the next, but you should use the existing implementations and the [Serial-over-I2C Protocol Guide](https://dev.blues.io/guides-and-tutorials/notecard-guides/serial-over-i2c-protocol.md) for reference.

[JSON Fundamentals](https://dev.blues.io/notecard/notecard-walkthrough/json-fundamentals.md "JSON Fundamentals") [Essential Requests](https://dev.blues.io/notecard/notecard-walkthrough/essential-requests.md "Essential Requests")
