Design Project - Purdue University



Homework 5: Theory of Operation and Hardware Design Narrative

Team Code Name: ____iDine_______ Group No. _13_

Team Member Completing This Homework: Tejas D. Kulkarni

E-mail Address of Team Member: tkulkarn@ purdue.edu

[pic]

Evaluation:

|SCORE |DESCRIPTION |

|10 |Excellent – among the best papers submitted for this assignment. Very few corrections needed for version submitted in |

| |Final Report. |

|9 |Very good – all requirements aptly met. Minor additions/corrections needed for version submitted in Final Report. |

|8 |Good – all requirements considered and addressed. Several noteworthy additions/corrections needed for version submitted|

| |in Final Report. |

|7 |Average – all requirements basically met, but some revisions in content should be made for the version submitted in the |

| |Final Report. |

|6 |Marginal – all requirements met at a nominal level. Significant revisions in content should be made for the version |

| |submitted in the Final Report. |

|* |Below the passing threshold – major revisions required to meet report requirements at a nominal level. Revise and |

| |resubmit. |

* Resubmissions are due within one week of the date of return, and will be awarded a score of “6” provided all report requirements have been met at a nominal level.

Comments:

This report is ok for the most part; however, some parts were not very thorough. Only basic information was provided for some of the components. You could talk more about how the device works overall. There are many inline comments below. As I noted below, “Graphical” should be “graphical” and “pinout” is not used properly.

Score: 9

Additional comments from Dr. Johnson:

For a portable battery powered application, the efficiency of a switched regulator would be desirable.

"linear regulators are used to interface two different logical UART..." - Don't you mean level translators?

How are you debouncing the pushbuttons?

On the micro schematic, your pushbutton circuitry is badly messed up. The way you have it wired, you will directly short VDD to ground when the button is pushed.

On peripheral schematic, there are two resistors marked R1 and there is yet another R1 on the micro schematic. Also, the voltage divider resistor values for R1 and R2 don't look right. Don't you want to go from 5v down to 3.3v? Looks to me like this will give a lot less than 3.3v.

1. Introduction

iDine is a multi-touch based dining system with a mobile device (EMD) for managing the table remotely. The system comprises of two major components – the portable EMD and the multi-touch table. A PIC24FJ128GA010 [1] microcontroller is used to drive the peripherals on the EMD. The EMD communicates with the Atom board via a standard Bluetooth connection. A serial Bluetooth module (UART) is interfaced with the microcontroller to establish a connection with the Bluetooth dongle mounted on the Intel Atom Board. Other digital peripherals, such as the graphical LCD and SD/MMC breakout, are interfaced with the microcontroller via the SPI, SCI and GPIO modules. In order to meet the voltage and current requirements of all the peripherals on the EMD, switching voltage regulators are used to adjust the voltage requirements of the respective peripheral devices. In addition to this, a battery charge controller is used to charge two rechargeable Li-Ion batteries (9V supply).

2. Theory of Operation

2.1 Power Supply and Battery Management

Under normal operating conditions, the EMD will be powered using a rechargeable battery pack. A Linear Technologies LTC1731-8.2[3] will be used to charge the lithium ion battery. A dual cell lithium ion battery with a working voltage of 7.2V and maximum current capacity of 2200 mAh will be used in the circuit. The battery charging circuit was designed as specified in the LTC1731-8.2 data sheet. In addition, the battery will be charged via a LTC1731-8.2 charge controller when the wall wart (9V supply voltage, 2 A current) is plugged in.

The PIC24FJ128GA010 microcontroller operates within a voltage range of 2.0 and 3.6V. A 3.3V line is needed for the microcontroller and the SD card interface. In addition to the 3.3 V power, a 5V power line is needed for driving the graphical LCD and the Bluetooth module. Two DE-SW0XX switching regulators will be used to provide both the power lines (one regulator for each power line).

A Linear Technologies LTC4150 battery gauge [5] will be used to monitor the power level of the battery. The circuit design of the battery gauge is specified in the LTC4150 data sheet [2]. The output from the LTC4150 will be processed by the PIC24FJ128GA010 microcontroller to inform the user when the battery starts running low. A regulated power supply of 9V DC or 12 V DC can be used to power up the circuit and recharge the battery.

2.2 PIC24FJ128GA010 Microcontroller

The PIC24F microcontroller is specified to run under a voltage range of 2V to 3.6V. The normal mode of operation is 3.3V. A switching regulator circuit explained in Section [2.1] provides the +3.3V for operating the microcontroller. This device can execute instruction at a frequency of 32MHz. A crystal can be used to provide the clock. A setup for this crystal is included in the schematic. However, a fast internal RC oscillator is also available inside the microcontroller which can be used as an alternative. In the proposed design, this device will interface with several digital peripherals – the battery gauge monitor [5], the graphical LCD [6], Bluetooth module [2] and the SD/MMC breakout [7]. The proposed system utilizes two UART modules, one SPI module, three digital pins for battery gauge monitoring and three digitals pins for pushbuttons. To program the microcontroller via Flash memory, a complete pin diagram is provided along with the necessary circuitry as per the microcontroller datasheet (Section [3] – Table (1)).

2.3 Graphical LCD

The DX160 graphical LCD is a 5V powered module which supports RS-232 as well as 5 V TTL signals. The LCD can be connected directly to the PC RS-232 transmitter pin for easy debugging. The TTL signal pin cannot be directly interfaced with the PIC24F Transmitter pin (U1Tx). The PIC24F transmitter (UART) pin operates within the range of 0V to 3.3V. An Intersil CD40109BMS[8] Low-to-High Voltage shifter will be used to translate the 3.3V on the transmit(Tx) pin of PIC24F to 5V for the LCD's receiver (Rx) pin. It is important to note that the LCD does not have a transmit (Tx) pin due to the absence of any acknowledgement support from the LCD module. The lithium ion battery is capable of providing a 45mA current to drive the graphical LCD (with 100% backlight on). To effectively and correctly display bitmaps on the graphical LCD at a high refresh rate, a baud rate of 57600 bps (maximum available on the LCD) will drive the UART interface between the LCD and the microcontroller.

2.4 Bluetooth module

A BlueSMiRF Gold Bluetooth module [2] runs at a frequency of about 2.5 GHz at an operating voltage of 5V. The Bluetooth module is interfaced via the UART interface with the PIC24F microcontroller. An Intersil CD40109BMS [8] Low-to-High Voltage shifter will be used to translate the 3.3V on the transmitter (Tx) pin of PIC24F to 5V for Bluetooth’s receiver (Rx) pin. In order to convert the data from the Bluetooth (Tx) to the level acknowledged by the microcontroller (Rx) a linear voltage regulator (LM1117T-3.3V) is used.

2.5 SD/MMC breakout

A SanDisk SD Card, operating at 3.3V, will be interfaced with PIC24F via the SPI peripheral interface. According to [7], the maximum clock rate for SD Cards in SPI mode is 25 MHz. The maximum clock rating for the microcontroller in SPI mode is 16 MHz; therefore, PIC24F can easily support the SPI interface with the SD card breakout. The SD card can be directly interfaced via the SPI module without the need of any external voltage shifters due to similar voltage requirements (3.3V).

3. Hardware Design Narrative

The primary subsystems utilized within the microcontroller are the SPI and UART interfaces. The graphical LCD and Bluetooth module are interfaced via the UART interface. The graphical LCD is connected to the PMA9/U2TX/CN18/RF5 and PMA9/U2RX/CN17/RF4 while the Bluetooth module is connected to the U1RX/RF2 and U1TX/RF3 reprogrammable pins respectively. The SPI pins from the SD Card are connected to SCK2, SDI2, SDO22 and RB1 pins on the microcontroller. This specific pin arrangement was chosen in order to optimally place the three subsystems around different faces of the PIC24F QPF package device. To debug and program the PIC24F, compiled code can be sent via the PGD2 data pin along with a clock on the PGC2 pin. However, it is important to note that the active low MCLR pin is essential in order to enable the microcontroller to go in program mode.

The RB4 and RB3 port pins will be interfaced with the LTC4150 battery gauge IC. The RB4 will be connected to active low POL output from the LTC4140. The signal on this pin will identify if the battery is being charged or discharged. The RB3 pin will be output from the microcontroller to the active low SHDN pin on the LTC4150. This signal marks the inception of the battery gauge IC. This signal needs to be negated (set to HIGH) by the microcontroller to trigger the battery gauge operation. Finally, an active low INT pin from the LTC4150 will be interfaced to the microcontroller INT1 (external interrupt input) pin. The interrupts sent on this signal will be counted in order to calculate the current capacity of the battery charge.

The graphical LCD's interface is defined by an UART interface running at 9600 baud-rate. The four pins on the LCD are the power, ground, RS-232 and TTL. Either RS-232 or TTL pin can be interfaced with the Tx singal from the microcontroller. However, the proposed design will only employ the TTL pin for easy interface with the host microcontroller (U2TX). The Bluetooth module's interface is defined by an UART interface running at 9600 baud-rate. There are four pins on the Bluetooth module for a serial interface with the host microcontroller – a 5V power pin, a ground pin, TTL Rx pinout and a TTL Tx pinout. As per the description in Section [2], voltage level shifters are used in order to interface two different logic level UART connections between the PIC24F (3.3V) and the serial peripherals (Bluetooth and G-LCD – 5V). For both the UART interfaces, there is one start bit, eight data bits and no parity bits.

In addition to the serial interface, SPI port pins are utilized to interface the SD Card with the microcontroller. As per the connections, the microcontroller operates as the Master controlling the SD Card in the slave mode. Since the voltage specifications of PIC24F and SD Card match with each other, no voltage shifters are required in the circuitry for this interface. The microcontroller will run the SPI communication at a frequency of 16 MHz. Moreover, the microcontroller hosts three pushbuttons as user interface for the graphical LCD via three general purpose I/O pins (RG12, RG13 and RG14). Most importantly, lithium ion battery provides a robust and reliable source of power for powering the microcontroller (3.3 V, 200 mA maximum current) and serial interfaces (5V, ~45mAh maximum current).

The pin assignments on the PIC24FJ128GA010 are as follows:

|Signal |Actual Pin on PIC24FJ128GA010 |Description |

|Rx – LCD |U1TX |LCD based control commands are send from |

| | |PIC24F to LCD via this pin |

|Rx – Bluetooth |U2TX |Bluetooth based control commands and data |

| | |receiving is achieved via this pin |

|Tx - Bluetooth |U2RX |Data to be transmitted to Intel Atom board can|

| | |be passed onto this pin |

|SCK – SD Card |PMA5/SCK2/CN8/RG6 |SCI Clock |

|SDI – SD Card |PMA4/SDI2/CN9/RG7 |SCI Data input |

|SDO – SD Card |PMA3/SDO2/CN10/RG8 |SCI Data output |

|CS – SD Card |PGC1/EMUC/AN1/CN3/RB1 |SCI Chip Select |

|Battery Shutdown |IC1/RTCC/RD8 |PIC24F uses this pin to shutdown LTC4150 |

| | |Battery Gauge |

|Battery Interrupt Output |INT4/RA15 |Battery charge count |

|Battery current polarity |INT3/RA14 |This pin indicates the most recent battery |

| | |current polarity |

|Pushbutton 1 |RG12 |User pushbutton for controlling G-LCD |

| | |interface |

|Pushbutton 2 |RG13 |User pushbutton for controlling G-LCD |

| | |interface |

|Pushbutton 3 |RG14 |User pushbutton for controlling G-LCD |

| | |interface |

|Program enable |MCLR |Programming enable |

|Programming Serial clock |PGC2 |Serial clock |

|Programming Serial Data |PGD2 |Serial data |

Table (1) Pin assignments on PIC24FJ128GA010

4. Summary

The iDine system, from a circuit design perspective, has a modular architecture which provides an easy and reliable interface between the multi-touch dining table and the handheld EMD. The microcontroller interfaces were selected on the basis of the exact specifications of the chosen peripheral devices. In addition to this, the battery gauge and charger unit provides a reliable source of power to the multiple voltage circuit design. The microcontroller provides an easy interface to utilize the on-board reprogrammable I/O pins to act as UART, SPI and GPIO to interface the different peripherals in the design.

List of References

[1] Microchip, “PIC24FJ128GA010”. [Online]

Avilable: .

[Accessed: Feb 16, 2010]

[2] Sparkfun Electronics, “Bluetooth Modem - BlueSMiRF Gold”. [Online]

Available: .

[Accessed: Feb. 4, 2010].

[3] Linear Technology, “LTC1731-8.2/LTC 1731-8.4 Lithium-Ion Battery Charger”. [Online] Available: .

[Accessed: Feb 16, 2010]

[4] Linear Technology, “LT1129/LT1129-3.3/LT1129-5 - Micropower Low Dropout Regulators”. [Online] Available:

[Accessed: Feb 16, 2010]

[5] Linear Technology, “LTC4150 - Coulomb Counter/Battery Gas Gauge”. [Online] Available:



[Accessed: Feb 16, 2010]

[6] Sparkfun Electronics, “DX160 Serial Graphic 128x64 LCD”. [Online]

Available:

[Accessed: Feb 17, 2009]

[7] SanDisk, “Secure Digital Card”. [Online]

Available:

[Accessed: Feb 17, 2009]

[8] Intersil Corporation, “CMOS Quad Low-to-High Voltage Level Shifter”. [Online] Available:



[Accessed: Feb 16, 2009]

Appendix A: System Block Diagram

[pic]

-----------------------

NOTE: This is the second in a series of four “design component” homework assignments, each of which is to be completed by one team member. The body of the report should be 3-5 pages, not including this cover page, references, attachments or appendices.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download