NetBurner 3.5.7
PDF Version
PicKit Demo Board (Wire API)

I2C PicKit Serial Demo Board Application

Location: ClaudeWork/PicKitI2CSerialDemoBdW

Supported Platforms: MODM7AE70 SBE70LC SOMRT1061 MOD5441X NANO54415

Overview

This application demonstrates the use of the Microchip PicKit Serial I2C Demo Board with NetBurner embedded systems using the Wire API. The demo showcases communication with five different I2C peripheral devices through both a serial menu interface and a web-based documentation page.

API

This application uses the NetBurner Wire API for I2C communication:

  • TwoWire Wire - Global I2C bus instance
  • Wire.begin() - Initialize I2C peripheral (handles pin configuration automatically)
  • TwoWireObject - Device wrapper for register read/write operations

Supported Platforms

  • MODM7AE70 - SAME70 based module
  • SBE70LC - SAME70 based single board computer
  • SOMRT1061 - i.MX RT1061 based module
  • MOD5441X - MCF5441X ColdFire based module
  • NANO54415 - MCF54415 ColdFire based module

I2C Peripherals Demonstrated

The application interfaces with the following Microchip I2C devices:

  1. 24LC0B EEPROM - 2Kbit (256 x 8) memory storage
  2. MCP9800 - Digital temperature sensor with 12-bit resolution
  3. MCP23008 - GPIO port expander connected to LEDs
  4. TC1321 - 10-bit Digital-to-Analog Converter (DAC) with 2.5V reference
  5. MCP3221 - 12-bit Analog-to-Digital Converter (ADC)

Features

Web Interface

Access the built-in web page at http://<device-ip>/ for:

  • I2C device table with addresses and descriptions
  • Serial console command reference
  • Hardware connection guide
  • Troubleshooting information

Interactive Serial Menu

The application provides a serial console menu with the following options:

  • 1 - Erase EEPROM (fill with 0x00)
  • 2 - Read EEPROM and display contents in hex format
  • 3 - Write incrementing sequence to EEPROM (0x00, 0x01, 0x02...)
  • A - Read ADC voltage value
  • D - DAC test (prompts for value 0-1023)
  • T - Read temperature sensor

Automatic LED Sequence

The application continuously cycles through the LEDs connected to the MCP23008 GPIO expander, providing visual feedback that the system is running.

Temperature Sensor Configuration

The MCP9800 temperature sensor is automatically configured for 12-bit resolution on first use, providing temperature readings in both Celsius and Fahrenheit.

I2C Configuration

  • Bus Speed: Default Wire API speed
  • Address Format: 7-bit addresses (NetBurner standard)
  • Pin Configuration: Handled automatically by Wire.begin()

Hardware Pin Connections

MODM7AE70 (P2 Header)

Signal Header Pin Function
SDA P2[39] TWD0 - I2C Data
SCL P2[42] TWCK0 - I2C Clock

SBE70LC (J1 Header)

Signal Header Pin Function
SDA J1[16] TWD0 - I2C Data
SCL J1[17] TWCK0 - I2C Clock

SOMRT1061 (Module Pins)

Signal Module Pin Function
SDA Pin 41 LPI2C1_SDA - I2C Data
SCL Pin 40 LPI2C1_SCL - I2C Clock

MOD5441X (J2 Header)

Signal Header Pin Function
SDA J2[39] I2C0_SDA - I2C Data
SCL J2[42] I2C0_SCL - I2C Clock

NANO54415 (Module Pins)

Signal Module Pin Function
SDA Pin 29 I2C0_SDA - I2C Data
SCL Pin 27 I2C0_SCL - I2C Clock

Also connect GND and 3.3V to power the PicKit board.

I2C Pull-up Resistors

The PicKit Serial I2C Demo Board includes onboard pull-up resistors, so no external pull-ups are required.

Typical I2C pull-up resistor values for reference:

Bus Speed Resistor Value Notes
Standard (100 kHz) 4.7k Most common
Fast (400 kHz) 2.2k - 4.7k Lower values for faster rise times
Fast+ (1 MHz) 1k - 2.2k Needed for high-speed operation

Note:** Adding too many pull-ups in parallel can cause signal issues. The NetBurner dev boards may also have internal or onboard pull-ups.

I2C Address Mapping

The application handles the conversion from Microchip's 8-bit address format (including R/W bit) to NetBurner's 7-bit format:

Device 8-bit Address 7-bit Address
24LC0B EEPROM 0xA0 0x50
MCP9800 Temp 0x92 0x49
MCP23008 GPIO 0x40 0x20
TC1321 DAC 0x90 0x48
MCP3221 ADC 0x9A 0x4D

Key Functions

EEPROM Operations

  • EepromWriteBuf() - Writes data with automatic page boundary handling (8-byte pages)
  • EepromRead() - Reads data from EEPROM
  • WaitForEepromWriteCmpl() - Polls EEPROM for write completion

Sensor Reading

  • ReadTempSensor() - Configures and reads MCP9800 temperature sensor
  • ReadADC() - Reads 12-bit ADC value and converts to voltage
  • WriteDAC() - Writes 10-bit value to DAC with user input

LED Control

  • WriteLeds() - Controls LEDs via MCP23008 GPIO expander
  • IncrementLEDs() - Automatic LED sequencing

Technical Details

Wire API Status Codes

The application includes I2C status checking with descriptive error messages:

  • wire_success (0) - Operation successful
  • wire_data_too_big (1) - Data too large for buffer
  • wire_NACK_on_address (2) - Device not responding
  • wire_NACK_on_data (3) - Device rejected data
  • wire_other_error (4) - Other error
  • wire_timeout (5) - Operation timed out

Data Conversion

  • Temperature readings are converted from 2's complement format to floating-point
  • ADC values are converted to voltage (3.3V reference, 12-bit resolution)
  • DAC values support 0-2.5V output range (10-bit resolution)

Address Conflict Warning

Many NetBurner development boards include a Real Time Clock (RTC) at I2C address 0x51 (0xA2). This conflicts with the PicKit EEPROM address range. When the PicKit board is connected, the onboard RTC will not function correctly.

Usage Instructions

  1. Connect the Microchip PicKit Serial I2C Demo Board to your NetBurner development board's I2C pins (SDA, SCL, GND, 3.3V)
  2. Compile and load the application onto your target platform
  3. Access the web interface at http://<device-ip>/ for documentation
  4. Connect to the serial console (typically 115200 baud)
  5. Use the interactive menu to test different I2C peripherals
  6. Observe the LED sequence to verify system operation

Troubleshooting

If you see "LED GPIO Expander error - check if PicKit board is connected":

  • Verify the PicKit board is properly connected
  • Check I2C pull-up resistors are present
  • Ensure correct voltage levels (3.3V)

Requirements

  • NetBurner development tools and runtime system
  • Microchip PicKit Serial I2C Demo Board
  • Compatible NetBurner hardware platform (MODM7AE70 or SBE70LC)

Project Structure

PicKitI2CSerialDemoBdW/
├── src/
│ ├── main.cpp - Main application code
│ └── htmldata.cpp - Auto-generated web content
├── html/
│ ├── index.html - Web documentation page
│ └── logo.png - NetBurner logo
├── makefile - Build configuration
└── ReadMe.txt - This file