This is an old revision of the document!
Sure, the iTouch is pretty cool. But who wants such a locked down device? Why not build your own touch-screen device, with your own apps, all on open source hardware and using open source tools? OK, it can't play MP3s, but it does have a 320x240 TFT color display with resistive touch screen, an Atmega32u4 8-bit microcontroller, lithium polymer battery charger, backlight control, micro-SD slot, and a triple-axis accelerometer. Yeah, this is the next big thing and for those of us who like to DIY, you can do a lot of cool stuff with this dev board.
Of course, we wouldn't leave you with just a schematic and a 'good luck'! The designer of the microtouch (known to us by the code name "Rossum") has written a full hardware core operating system and multiple demo apps such as…
The project is a collaboration between Rossum & Ladyada!
Designed in California and New York
The brains of the Microtouch board is an Atmega32u4 in TQFP package. The nice thing about this chip is the built-in USB support and lots of pins.
The board has a built in single-cell 3.7v LiPoly charger (MCP73812). The LiPoly should be connected to the 2-pin 2.0mm JST-PH - verify polarity before connecting! The charger chip is very simple but will properly charge the lipoly. The charge rate is set to be about 250 mA, so do not plug it into a non-powered hub. It should work fine with any computer. Unfortunately there is no notification when the battery is charging (say an LED) but you can detect the battery status via the microcontroller's ADC pin. You can change the charge rate by adjusting R17 from 4.7K. Check the MCP73812 datasheet for the resistor that corresponds to your desired charge rate
The output of the lithium polymer battery (or USB passthru) connects to a LP2985 3.3v LDO. This regulator is fairly good quality and will give about 1% precision output and up to 150mA. Most of the power usage in this design is for the 4 x backlight LEDs which can be up to 80mA total. There is also 10-20 mA taken by the microcontroller, ~20mA taken by the TFT, and another 2 mA for the red indicator LED. The accelerometer takes almost no power.
This LED is on pin PC7 and is used to indicate when the bootloader is active. You can use it for pretty much anything you'd like
The timing crystal is at 16 MHz. This is overclocking the Atmel a bit (at 3.3v it would prefer to be at 12MHz) - we test the chips to verify they work before shipment. The reason for overclocking is to be able to do fast video-speed display interfacing. The crystal has two stability capacitors next to it.
The Microtouch uses a trick that allows it to turn itself off when battery powered. The LDO has an Enable pin that is pulled to ground (that is, the LDO is disabled by default). When the right-angle power button is pressed, this enables the LDO which turns on the AVR. The first thing the AVR does is pull the Enable pin high (its connected to PF0). When the button is let go, the pin will keep the LDO activated. This means that if you want to write your own code for the Microtouch to make sure the first thing that happens is setting PF0 to an output and pulling it high.
Of course, to turn itself off, the chip can drop PF0 low. The user will have to press the button again to turn it back on. This shoudln't be done when on USB power because the bootloader can get stuck in a 'brownout loop' but a press of the reset button will 'kick' it out.
The Reset button is connected to the AVR's reset pin. You can use this to enter the bootloader (or, if you overwrote the bootloader, reset the board)
The AVR can be reprogrammed by any standard AVR programmer and avrdude or similar. If reprogramming, don't forget you have to keep the power button pressed during the programming cycle or plug it into the miniUSB jack or provide 3.3V power from the programmer. Just make sure that the target power really is 3.3v, for example the USBtinyISP provides 5 not 3.3v which could damage the LCD
The LCD has 4 backlight white LEDs in parallel. We use a 22-68 ohm resistors (the image shows 68, the value may change depending on how bright the TFT backlight is for the current model) on each Cathode (K) and drive the cathode with a NPN connected to pin PC6. You can dim the backlight by changing the hardware PWM value of the pin. When off, the display is not visible - it is transmissive, not transflective.
The microtouch has an accelerometer soldered on board, which you can use to get movement data. Accelerometers can detect motion, and tilt. The model is MMA7455. It can be configured from +-2g (for higher-resolution on small movements) to +-8g for larger movements.
Do not throw the Microtouch to test the accelerometer! Please use the Accelerate App instead :)
You can use the USB connector to bootload new firmware onto the microtouch. The bootloader takes 4K of memory. You can also overwrite the bootloader by using an AVR ISP programmer and the 6-pin ISP port.
The USB port is also used to recharge the LiPo battery at about 250mA. You can also run the Microtouch direct from USB but because the lipo charger is connected directly to the regulator, it can't supply the full 100-150mA required (the voltage isnt buoyed by the battery). As a result, the core code will detect the voltage drop and dim the backlight. For that reason, you'll notice its dimmer without a battery
You don't need an AVR programmer to use this board, we put a nice bootloader on there already! The bootloader is activated by pressing the RESET/BOOT button while plugged into USB. You can tell the bootloader is active when the green 'Boot' LED pulses/breathes The board will then show up as a Serial or COM port, and you can use avrdude to program it. The 'programmer name' is avr109 so for example, to test you should run avrdude -p m32u4 -P COM3 -c avr109 which will initialize the bootloader.
The bootloader will time out eventually (after about 5 seconds) Because we are not using a USB/serial converter, bootloading is tremendously fast, we can program a full chip in under 2 seconds!
The bootloader takes up the last 4K of FLASH, so be aware that you will only have 28K instead of 32K. We have found that this isn't very constricting as 28K is still plenty. If you'd like more space, you can always use the 6-pin ISP connector and an AVR programmer (which will delete the bootloader)
If you're using windows, you will need an inf driver file, you can download it below (in the Downloads section). Mac/Linux peeps don't as it shows up as a 'generic' serial port in /dev/ttyUSB* or /dev/cu.* (check both and/or dmesg)
To quit an app, touch the dark area at the bottom of the screen, past where the TFT image ends
The main screen shows all the apps you have programmed into the microtouch. Select an app by touching the circle with your finger
You can use the microtouch as a photo viewer by converting images into im2 (which makes it easier to draw to the screen). The converter is in the github repository. Place the images in the root directory of the microSD card and plug in the card. Turn on the microtouch and you'll see the icons for the images. Pres the circle to load the first one. You can 'swipe' your finger to move from one image to the next.
Troubleshooting: The files on the SD card might not show up immediately upon bootup. When using cards 2GB or larger, if the image icons do not appear, go to the HWTest app and ensure that it confirms the card is ready. After leaving the HWTest app, the icons appear.
The Off App does basically what you think it does, turning off the device by pulling the regulator enable pin low. It will not turn off when the MicroTouch is USB-powered
The Hardware Test app is used to check the battery voltage, backlight, touch screen, accelerometer and SD card all at once. You can adjust the backlight brightness with this app.
Doomed is a simple 3D rendering engine. You can navigate around the simple map by touching on the edges of the screen for the direction you wish you go.
This app is used to calibrate the touch screen. You only need to do this once for the life of the device: the calibration is stored permanently in EEPROM. Touch the centers of the circles with finger or stylus to set the calibration points.
This app uses the built in 3-axis accelerometer to move a ball around the screen and also show a 'strip chart' recording of the data being read. You can move the ball around by tilting the screen.
This App shows an icosohedron that is 3D rendered on the display. The shape reacts to the accelerometer so you can rotate it by tilting the screen
Press the squares, but avoid the mines! Just like minesweeper but without the bloat of a Windows install
Draw on the screen with your finger
A 'go'-like game, this single player game is over when all the tiles turn one color
To develop code, you'll need an install of the AVR-gcc tool chain.