LCD/Encoder backpack for Fox Board

From OpenCircuits
Revision as of 02:02, 17 December 2007 by GroovBird (talk | contribs) (→‎Goals)
Jump to navigation Jump to search

Introduction

This is a project that I'm working on at the moment, as a learning tool for other projects in the future. The project aims to develop a small board that acts as a standalone backpack for an LCD and a push encoder to provide a UI for a master system. Communications from/to the device would be over TTL level asynchronous serial. The central component is to be an Atmel ATTiny2313.

Goals

My first target will be the STK500. This will easy development and debugging. I'll hook everything up with those nifty prototyping wires from SparkFun.

Then I'm going to wire it up on a breadboard. I think.

The next targeted master system would be the Fox Board, because I have it readily available. I've been able to get various LC displays working on the Fox Board, but it's pretty clumsy (using these prototyping wires. they're fun, but clumsy). I'm also experimenting with some VFD displays that I was able to obtain. They suck power, but look pretty cool. I'll probably be wiring it myself using one of their prototyping daughter boards that should be arriving very soon.

The next target will be a custom board. This board should be able to carry the LCD, the encoder and it should be a bit flexible. I'll design it with room for both 16-pin SIL header and 16-pin DIL header for the different types of LCDs that I have. Oh and I want to drive the LCD backlight with a PWM output (if anyone has an idea on how to wire something cheap that will provide the current, please help) so that I can "fade" the backlight in and out. Oh and I'll skip the RS-232 level shifting and go straight for an FT232RL usb converter. If your target computer is big enough, it'll have a spare USB socket. If it's small enough, it'll have TTL level UART. If not, I'm keeping the SPI pins available for programming, so you're welcome customize the firmware to use 1-wire, 2-wire or 3-wire interfacing.

Except for the pin-change interrupt, the schematic looks like it's compatible with the older AT90S2313.

Motivation

My motivation for this project is the following:

  • Reduce the complexity of supporting an LCD and a push encoder input for a "bigger" master system. Creating kernel drivers to make interrupt based inputs work is such a pain. You don't want to miss one of them quadrature states!
  • Learn to design a schematic and a board. When it works, I'll open a bottle to celebrate!

Board Design Notes

The currently selected use for the ATTiny2313's pins:

  • Pin 1: RESET/dW: I'll use the debugWire, thankyouverymuch!
  • Pin 2: UART RXD
  • Pin 3: UART TXD
  • Pin 4: Hook up to crystal 3.6864 (necessary for correct UART baudrates)
  • Pin 5: Hook up to crystal
  • Pin 6-7-8-9: LCD databus (in 4-bit mode)
  • Pin 10: GND. Ashes to ashes, ground to ground. Even for electrons.
  • Pin 11: LCD enable line.
  • Pin 12: PINB0/PCINT0: encoder input A
  • Pin 13: PINB1/PCINT1: encoder input B
  • Pin 14: PINB2/PCINT2: encoder push input
  • Pin 15: OC1A: LED backlight PWM output
  • Pin 16: LCD data/command line.
  • Pin 17-18-19: ISP for programming can be reused for other communication protocols.
  • Pin 20: Powah!

Notes on this:

  • I wanted the LCD DB4-7 and E on the same port, so that E stays cleared when I write the next nibble.
  • The encoder inputs need to be on pins that can invoke the pin-change interrupt.
  • I don't think it's worth the trouble, but if someone wants to use it with an AT90S2313, I chose Pin 15 for the PWM output, which is the same on that device.
  • I wanted to keep the dW and ISP pins free.
  • I need the crystal for correct baud rates.

Things I'm pondering:

  • I have both 3.3V and 5V available on the Fox Board headers. Would the LCD respond to 3.3V on its inputs when powered from the 5V?
  • I still have no clue what sort of driver to use to power the backlight. Would a simple transistor do?

Current state

  • I'm busy designing the schermatic and the board.
  • I'm busy writing the firmware, even though my STK500, AVR JTag MkII and prototype boards are still on the road.