Final Project Report E3390 Electronic Circuit Design Lab. Electronic Notepad



Similar documents
DESIGN OF OPEN ARCHITECTURE SHIP ALARM, MONITORING AND CONTROL SYSTEM

Analog-to-Digital Converters

Ultrasonic Distance Measurement Module

SPI. Overview and Use of the PICmicro Serial Peripheral Interface. Getting Started: SPI

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence :

Serial Communications

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

ET-BASE AVR ATmega64/128

Real-Time Application Surveillance Security System Based on LabVIEW

ACR880 GPRS Portable Smart Card Terminal

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

EasyPIC4 User s Manual

EPM2000 LabVIEW Building Applications Instructions

PICmicro tm Development Board

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

Touch Screen for Pictiva OLED display. Application Note. Introduction

Key Words Student Paper, School of Professional Studies

Section bit A/D Converter

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

POCKET SCOPE 2. The idea 2. Design criteria 3

Note monitors controlled by analog signals CRT monitors are controlled by analog voltage. i. e. the level of analog signal delivered through the

Microtronics technologies Mobile:

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

BE635 User Manual. Rev. V Bolymin, Inc. All Rights Reserved.

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

CAN bus board. EB018

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

Web Site: Forums: forums.parallax.com Sales: Technical:

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

Home Security System Using Gsm Modem

Part 1. MAX BIT DAC with an Arduino Board. MIDI to Voltage Converter Part1

Wireless Security Camera

An Introduction to MPLAB Integrated Development Environment

Design and Construction of Variable DC Source for Laboratory Using Solar Energy

Microcontroller Code Example Explanation and Words of Wisdom For Senior Design

Below is a diagram explaining the data packet and the timing related to the mouse clock while receiving a byte from the PS-2 mouse:

Using the Siemens S65 Display

A DIY Hardware Packet Sniffer

Advanced Network Programming Lab using Java. Angelos Stavrou

Virtual Integrated Design Getting started with RS232 Hex Com Tool v6.0

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

Building a Multi-Threaded Web Server

Lesson 10: Video-Out Interface

Chapter 6: From Digital-to-Analog and Back Again

Fondamenti su strumenti di sviluppo per microcontrollori PIC

Application Note 120 Communicating Through the 1-Wire Master

B Robo Claw 2 Channel 5A Motor Controller Data Sheet

Embedded Systems Design Course Applying the mbed microcontroller

Software User Guide UG-461

EXERCISE 3: String Variables and ASCII Code

RS-232 Communications Using BobCAD-CAM. RS-232 Introduction

MANUAL FOR RX700 LR and NR

iclass Card Cloning using an RW300 Reader/Writer

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Description of High Accuracy Digital Pressure Gauge Design

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

The FT6x06 series ICs include FT6206 /FT6306, the difference of their specifications will be listed individually in this datasheet.

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

Location-Aware and Safer Cards: Enhancing RFID Security and Privacy

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

APPLICATION PROGRAMMING INTERFACE

Parallax Serial LCD 2 rows x 16 characters Non-backlit (#27976) 2 rows x 16 characters Backlit (#27977) 4 rows x 20 characters Backlit (#27979)

Information Board User s Guide


The Programming Interface

Lecture N -1- PHYS Microcontrollers

Voltage Measurement with A PIC Microcontroller

Serial Communications

Switch board datasheet EB

10 Thomas, Irvine, CA USA Tel: (949) Fax: (949) Toll Free: (800) 23 FUTEK

Using the HT1632 for Dot Matrix LED Displays

Section 19. Voltage Reference

Ocean Controls RC Servo Motor Controller

HOMEWORKS. RS-232 Protocol. Data Protocol for Communicating with Lutron's HOMEWORKS System

RDF1. RF Receiver Decoder. Features. Applications. Description. Ordering Information. Part Number Description Packages available

Chapter 12. Data Converters. à Read Section 19 of the Data Sheet for PIC18F46K20. Updated: 4/19/15

Display Message on Notice Board using GSM

Fingerprint Based Biometric Attendance System

The Answer to the 14 Most Frequently Asked Modbus Questions

8051 MICROCONTROLLER COURSE

PICAXE X2 Product Briefing (updated Dec 10).

Using Xbee in Serial Communication

Digital To Analog Converter with Sine Wave Output

Modification of an AOR AR-8600 receiver to tune it with a ACECO FC-3002 frequency finder

RS232 Board datasheet

Getting Graphic: Defining Custom LCD Characters

Solar Energy Conversion using MIAC. by Tharowat Mohamed Ali, May 2011

ontroller LSI with Built-in High- Performance Graphic Functions for Automotive Applications

Designing VM2 Application Boards

I 2 C Master Mode Overview and Use of the PICmicro MSSP I 2 C Interface with a 24xx01x EEPROM

INTRODUCTION TO COMPUTER PROGRAMMING. Richard Pierse. Class 7: Object-Oriented Programming. Introduction

AN2680 Application note

Section bit A/D Converter

Tire pressure monitoring

Freescale Semiconductor, I

Final Project Report E3390 Electronic Circuit Design Lab. Automatic Phone-Alert Home Security System

Transcription:

Final Project Report E3390 Electronic Circuit Design Lab Electronic Notepad Keith Dronson Sam Subbarao Submitted in partial fulfillment of the requirements for the Bachelor of Science Degree May 10, 2008 Department of Electrical Engineering Columbia University

Table of Contents 1. Executive Summary 2. Block Diagram, Design Targets and Specifications 3. Individual Block Descriptions 4. Bill of Materials 5. Health, Safety and Environmental Issues 6. Final Gantt Chart 7. Course Suggestions Appendix A Software Code

I. Executive Summary The goal of our project was to design and build a portable electronic notepad. The notepad would have a touchscreen for writing on and memory to store your drawings and notes in. At your convenience you should be able to transfer the data to a computer where a software program can read it and then display it on the screen for you to see. The notepad should have a fast sampling rate and high accuracy so your images will appear as you drew them. This is achieved by using a micro controller to read X and Y coordinates off of a resistive touchscreen. These X,Y coordinates correspond to the point that you are poking the screen. These values are then stored locally on a *SD card. When you flip a switch the micro controller transfers the data from the SD card to the computer via a serial connection. This data is read in on the computer and then displayed using software that is provided with the notepad. *At this point the SD card interface is only implemented in hardware. The software interface to the SD card is still under development.

II. Block Diagram, Design Targets and Specifications Specifications and Design Targets Device implements a PIC16F877/A Microctroller for A/D conversion and interfacing. A SD card is used for external memory. This must have a capacity of at least 1MB to store a single page. The LCD screen is used to display real time information to the user. The LCD uses the standard HD44780 controller.

III. Individual Block Descriptions (a) PIC16F877A Microcontroller The MCU provides an interface to the touchscreen, LCD, SD card and serial communication to a computer. The MCU is able to create a conductive path to ground in both the X and Y planes of the touchscreen by driving two of the four pins connected to the resistive touchscreen high and pulling the other two to ground. The voltage levels are then sampled and the X and Y coordinates are determined from these measurements. (b) Resistive touchscreen The touchscreen uses a five wire interface for determining X and Y coordinates. Four of the five wires correspond to the four corners of the screen. The fifth wire provides the voltage level at the point of contact. By setting the two top corner points to Vdd and the bottom two to ground current will flow from top to bottom. Pressing a point on the screen will connect the top conductive plane of the touchscreen with the bottom layer at that point. By measuring the voltage at this bottom layer we can determine the Y coordinate. The X coordinate is determined the same way except the two left most points are set to Vdd and the two right most points to ground. By switching back and forth between X and Y it is possible to recreate images that are traced on the screen. (c) Touchscreen Power Circuit The PIC16F877A is not able to supply the current needed for the touchscreen. Therefore power opamps are used to buffer the output of the MCU and supply the power to the touchscreen. (d) Voltage Rescaler Circuit The voltage rescaler circuit is required in order to realize the full 10 bit range of the A/D. Without this circuit the voltage measured from the screen is between ~1 4V. This reduces our resolution by almost a bit. In order to fix this the rescaler circuit subtracts off a voltage in order to zero the lower part of the range. Then the resulting voltage is gained up in order to spread the resolution from 0 to 5V thus giving us the full 10 bits of resolution. (e) LCD The LCD is used to display data to the user. The LCD has a 2x8 character display and can be programmed to display almost any kind of data to the user. Currently the X and Y coordinates measured are displayed in real time to the user.

(f) EEPROM SD card The SD card is used to store pages of data before transferring them to a computer. Currently this is only implemented in hardware. However the algorithm for storing data to the SD card has been determined and an appropriate file system developed. The SD card is block addressed with each block containing 512 bytes of data. Due to memory limitations of the PIC only the first 100 bytes of each block will contain data for a specific page. For a 1 mega pixel resolution this will require that 1250 blocks be used for each page. However using this method allows us to overlap pages by adding an offset of 100 bytes to each consecutive page. This way up to 5 pages can be stores in each 1250 blocks of data. When the MCU reads a X,Y pair from the touchscreen the PIC will determine which block the point is in. After which the 100 bytes will be read in from the SD card and the pixel corresponding to the X,Y coordinate will be set to a 1. (g) Serial Communication to Computer The PIC is setup to transfer data to the computer through the serial port when a switch is flipped. The data is sent at a rate of 9600 baud using the RS 232 protocol.

IV. Individual Bill of Materials PART MANUFACTURER # COST PIC16F877A Microchip Technology 1 8.5 LF411 OPAMP National Semiconductor 4 1.63 MCP601 OPAMP Microchip Technology 1.65 CPDR07086 Dual power OPAMP ON Semiconductor 2 1.25 20MHz Oscillator Abracon 1 1.30 SD Card Slot 3M 1 1.33 SD Card Transcend 1 12.25 5V Regulator STMicroelectronics 1 1.35 3.3V Regulator STMicroelectronics 1.68 LCD Screen CrystalFontz 1 15.70 Touchscreen Bergquist 1 55.00 PCB board Sunstone Circuits 1 50.00 Total Cost 149.64

V. Health, Safety and Environmental Issues a. Product Dangers This product does not pose any danger when used properly. b. Health Hazards There are no known health hazards associated with this product. c. Environmental Hazards i. This product complies with all FCC standards. ii. The AC adapter should not be disassembled or tampered with. The operating voltage for this device is 12V which does not pose any risk of electric shock,

VI. Final Gantt Chart Project Brainstorming 1 2 3 4 5 6 7 8 9 10 11 12 Paper Design K/ S Touchscreen Controller Rescaler Circuit SD Card Interface Serial Interface Display Software Board Design Final Packaging K/ S K/ S K S K S K/ S S

VII. Course Suggestions I think the course ran pretty smoothly. I definitely agree that two semesters would be beneficial. One semester isn't enough time to develop a product from the ground up it seems, especially when you don't have a project that you want to work on. If it is only one semester perhaps people would have more luck if they were assigned a project, maybe each team work on a single part of a very large design. This way people would know what they had to do from the start. Other than that I felt that I learned a lot and got to experience what it like to design a product.

Appendix A Display Software import java.awt.*; import javax.swing.jbutton; import javax.swing.jcombobox; import javax.swing.jframe; import javax.swing.jtextfield; import javax.swing.jlabel; import java.io.*; import javax.swing.*; import java.awt.event.*; import javax.swing.event.*; public class ImageConverter { public static String filename; public static JTextField jtf; protected static class DrawArea extends Panel { /** * Does the actual drawing. */ private static final int DIM = 2; private static final int XRES = 1000; private static final int YRES = 1000; private static final int PIXELWIDTH = 2; public void paint(graphics g) { try { // You add/change the statements here to draw // the picture you want. // g.drawline(0,0,300,300) ; //Open the file and initialize buffered reader //filename = "art1.txt"; FileInputStream fstream = new FileInputStream(fileName); DataInputStream in = new DataInputStream(fstream);

BufferedReader datareader = new BufferedReader(new InputStreamReader(in)); String dataline; String[] coordinate = new String[DIM]; int x,y; g.setcolor(new Color(0, 0, 0)); while((dataline=datareader.readline())!= null) { coordinate=dataline.split(" ",DIM); x = 1000 Integer.parseInt(coordinate[0]); y = Integer.parseInt(coordinate[1]); g.fillrect(2*x/3, 2*y/3, PIXELWIDTH, PIXELWIDTH); System.out.println("X coordinate: " + x +" Y coordinate: " + y); catch(exception e) { System.err.println("Error: " +e.getmessage()); /** * Makes sure that * the window drawing area ends up being the * right size. You don't need to change this. */ public Dimension getpreferredsize() { return new Dimension(WIDTH,HEIGHT) ; // These set the size of the drawing area. // Change the sizes to suit what you need. private int WIDTH = 1000 ; private int HEIGHT = 1000 ; public static void addcomponentstopane(container pane) { pane.setlayout(new GridBagLayout());

GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; DrawArea drawing = new DrawArea() ; gbc.gridwidth = 3; gbc.gridx = 0; gbc.gridy = 0; pane.add(drawing, gbc); private static void createandshowgui() { JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame = new JFrame("Image Converter"); frame.setdefaultcloseoperation(jframe.exit_on_close); //Set up the content pane. addcomponentstopane(frame.getcontentpane()); frame.pack(); frame.setvisible(true); public static void main(string[] args) { try { filename = args[0]; catch(arrayindexoutofboundsexception e) { System.err.println(e.getMessage()); javax.swing.swingutilities.invokelater(new Runnable() { public void run() { createandshowgui();

); MCU Firmware '**************************************************************** '* Name : Pad.bas * '* Author : Keith * '* Notice : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 1/24/2008 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** Include "modedefs.bas" DEFINE OSC 20 'Define 20MHZ clock frequency DEFINE LCD_DREG PORTD 'Set LCD data port to port D DEFINE LCD_DBIT 4 'Set starting data bit on 4 Define LCD_RSREG PORTE 'Set Register select port to E DEFINE LCD_RSBIT 0 'Set starting data bit on 0 Define LCD_EREG PORTE 'Set Enable port DEFINE LCD_EBIT 1 'Set enable bit on 1 DEFINE LCD_BITS 4 DEFINE LCD_LINES 2 DEFINe ADC_BITS 10 'Set number of bits in A/D conversion DEFINE ADC_SAMPLEUS 50 'Set sample time in us TRISA = %11111111 'Set PortA to all input TRISC.0 = 0 TRISC.1 = 1 CMCON = 7 ADCON1 = %10000100 'AN3 and AN2 are Vref+ and Vref respectively ADCON0 = %01000001 TRISA.0 = 1 TRISD = 0 TRISB = 0 TRISE.0 = 0

TRISE.1 = 0 Result_X Var WORD Result_Y Var Word Last_X VAR WORD Last_Y Var WORD CNT VAR BYTE TSTART VAR PORTC.1 Up_Left VAr PORTB.0 'Upper Left of screen Up_Right Var PORTB.1 'Upper Right Lo_Right VAR PORTB.2 'Lower Right Lo_Left Var PORTB.3 'Lower Left AD_ON VAR ADCON0.0 AD_START VAR ADCON0.2 SDO VAR PORTD.0 SCL VAR PORTD.1 mode var word mode = %0101000000111100 PAUSE 500 'Wait for LCD to setup CNT = 0 PORTC.0 = 1 Last_X = 0 Last_Y = 0 main: Gosub AD_X pauseus 10 GOSUB AD_Y if cnt = 10 THEN LCDOUT $FE, 1 LCDOUT $FE, $80, "X: ",DEC Result_X LCDOUT $FE, $C0, "Y: ",DEC Result_Y CNT = 0 ENDIF CNT = CNT + 1 if TSTART = 1 THEN IF Result_X!= Last_X Result_Y!= Last_Y Then

serout SDO, N9600,[#Result_X," ",#Result_Y,13] Last_X = Result_X Last_Y = Result_Y ENDIF endif Goto main AD_Y: 'Measure X Up_Left = 1 Up_Right = 1 Lo_Right = 0 Lo_Left = 0 Result_Y = 0 pauseus 500 'PAUSE 5 AD_START = 1 While AD_START = 1 WEND PAUSEUS 50 Result_Y.HighByte = ADRESH Result_Y.LowByte = ADRESL Up_left = 0 Up_Right = 0 RETURN AD_X: 'Measure Y Up_Right = 1 Lo_Right = 1 Up_Left = 0 Lo_Left = 0 Result_X = 0 pauseus 500 AD_START = 1 While AD_START = 1 WEND PAUSEUS 50 Result_X.HighByte = ADRESH Result_X.LowByte = ADRESL Up_Right = 0 Lo_Right = 0 Return

'TEST_SERIAL: ' SHIFTOUT SDO,SCL,1,[Result_x/16,Result_Y/16] 'RETURN END