Simple Serial I2c Programmer

Hardware components

Microchip ATtiny85
×1
SparkFun Tiny AVR Programmer
×1
Adafruit FTDI Serial TTL-232 USB Cable
×1
Adafruit USB to TTL Serial Cable
×1
Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer
×1
SparkFun Pushbutton switch 12mm
×1
Adafruit 4.7K Ω Resistor
×1
Adafruit 10K Ω Resistor
×1
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE

Story

Introduction

I2c Programmer Schematic

The I2C protocol also known as the two wire interface is a simple serial communication protocol that uses just two pins of a microcontroller namely SCL (serial clock) and SDA (serial data).

  • Apr 09, 2009  You may want to consider developing a simple test fixture to do the programming. A few connections to the board being programmed are all that would be needed. I am using the tool AnaGate I2C for programming my serial EEPROMs in-curcuit. This device has an LAN interface and can be addressed from a PC via the standard network interface with.
  • Viii Simple Serial Interface Programmer’s Guide Chapter Descriptions Topics covered in this guide are as follows: • Chapter 1, Introduction to SSI provides an overview of SSI, including signal lines, protocol, and packeting information. Protocol layers are described in a “bottom-up” manner, from the hardware layer up through software.
  • T hey are PIC based but have a preinstalled bootloader that are programmed by basic language via a passive serial cable to a PC using their free ICD programming editor. Their version of basic includes hi-level I2C set-up and command functions and their newest released chips can act as a I2C slave as well as a I2C master.
  • A Simple Serial (I2C/SPI) EEPROM Programmer Posted on 23rd December 2014 Tagged in electronics, tools, tgl6502 This is a small ATtiny84 based device to program I2C and SPI EEPROM chips over a serial.
  • Introduction: If you are looking for a simple but powerful programmer you are right, it's here. PonyProg is a serial device programmer software with a user friendly.

The Atmel tinyAVR MCU's are great little chips for projects but can prove difficult to debug. Some ATtiny chips do not have direct support for hardware based serial and therefore the Serial object is unavailable in your code, however, it is easy to add a SoftwareSerial object and view output in the Arduino IDE.

The code in this article uses an ATtiny85 with an FTDI Serial TTL-232 USB Cable to send or receive information.A USB Serial TTL Cable can also be used since the CTR and RTS pins are not needed.

NOTE: This cable is not used to program the AVR. To program the ATtiny85 you will need a programmer such as the SparkFun Tiny AVR Programmer.

Using the Software Serial Library

The Software Serial library is straightforward to use. Start by ensuring the include statement is specified near the top of your sketch. Next, create a SoftwareSerial object specifying the RX pin (pin to receive on) and the TX pin (pin to send on) when creating the instance.

Simple Serial I2c Programmer Free

The rest of the sketch will contain standard Serial references in the same manner you are accustom to in your sketches on other Arduino boards.

Pickit

One important note is, that since he ATtiny has limited memory, strings inside the Serial.print() statements will consume a lot of memory very fast. This can limit either the number of Serial statements or the amount of code and/or libraries you can include. Use the strings wisely by getting creative with the way string values are used.

Connecting the USB to Serial Cable

Regardless of whether you are using an FTDI cable or some other USB to Serial cable, you will use at most four wire and at least three. The wires you will need are described below.

  • 3V3/5V - This wire is optional and can be used to power your circuit during testing. You can power your circuit only when the current demand is limited (less than 500 mA). This wire is usually red (color may be vary).
  • GND - This wire is required and should be connected to pin 4 on the ATtiny85 (or to whatever point you designated as ground). This wire is usually black(color may be vary).
  • TX - This wire is used by the external device to send data to your ATtiny85. This wire should be connected to the pin you designated as RX when you setup your Software Serial instance. On FTDI cables, this wire is usually orange. On the USB to TTL Serial Cable this wire is usually green(color may be vary).
  • RX - This wire is used by the external device to receive data from your ATtiny85. This wire should be connected to the pin you designated as TX when you setup your Software Serial instance. On FTDI cables, this wire is usually yellow. On the USB to TTL Serial Cable this wire is usually white(color may be vary).

The Circuit

The circuit in this article demonstrates how to connect a Maxim DS18B20 temperature sensor (that utilizes the Dallas OneWire protocol) to the ATtiny85 and send the results over the serial port to the Arduino IDE.

Load the sketch onto the ATtiny85 using your AVR programmer. If you do not have a programmer, you can use an Arduino Uno (or similar board). Take a look at one or more of the articles listed below for help.

I2c
  • Programming ATtiny85 with Arduino Unoon Hackster.io
My SparkFun Tiny AVR Programmer with an ATtiny85.

Once the ATtiny85 has been programmed with the sketch, place it onto the breadboard and build the circuit by referencing the attached schematics. The circuit is shown below.

1 / 10Top view of full circuit.

Next, connect the Serial cable to the breadboard. I use a 6-pin header on my board to make it easy to attach and detach the cable. With the cable attached, the ATtiny is now powered up and running. The next step is to monitor the serial output.

Open the Arduino IDE, select the COM port of your cable and open the Serial Monitor. Note that the Programmer option in the IDE needs to be set to AVRISP mkil for this to work. If you are using a USBtinyISR to program your ATtiny85, just change it in the IDE when you have completed the programming step.

1 / 3Choose the COM port of your USB to Serial cable.

Since the chip is already running, you probably will not see the messages that were sent in the setup() routine. Just press the reset button on the breadboard to restart the program.

Serial

The video below is a demonstration of the output in the Serial Monitor.

I will not cover it in detail, but you can also use a program like Putty to monitor the serial port. Just start Putty, select the Serial option and type the name of the serial port (like COM3).

I2c Programming Example

Read more

Schematics

'>

Daniel Porrey

I lead a software development team for a large Chicago based organization. I also develop applications personally.

Aardvark I2c Programmer

Thanks to .