1 | Page Alarm Clock Design Using PIC18F45 ELEC 310 Submitted by: Maria AlKadhem Contents Detailed Specification: 2 Input: 2 LCD display: 2 Microcontroller: 4 Clocking Choice 5 Working theory: 5 Pin out of the device: 6 LCD interfacing: 6 Final comments: 7 Introduction: The major purpose of the project is to get familiar with the PIC18FXX series microcontrollers. We are ought to design an alarm clock which will be able to display the time on an LCD as well as we can give input through the dip switches. The dip switches will be able to increment the hours and minutes. We will go through the detailed design a bit later in the document. In order to implement the alarm clock we had to make external circuitry as well which was necessary for the following functions. · Input · Buzzer · Display at LCD. The pith of the alarm clock is to run the clock of MCU in counter mode. When the counter is set the MCU starts counting till the number and then when the threshold is generated the output signal is used to start a buzzer. At the same time there is an LCD used in the circuit which will be responsible for displaying the three things. · Current time. · Alarm time · Remaining time. For setting the alarm there are two DIP switches. One for adjusting the hours and other is used for adjusting the minutes. For clearing the alarm we simply will be pressing both at a time. The corresponding ports of the MCU will be used in the INPUT mode.Detailed Specification: Let’s discuss the detailed specifications of this device.Input: The input of the alarm clock consists of two DIP switches. One switch will be used for adjusting the hours. The second switch will be used for the adjustment of the minutes. Each time a button is at high logic there will be an increase in the corresponding variable of alarm. When both of the buttons are pressed there will be a reset of clock making the value to 0.0. It will be the off state of the clock as well.LCD display: We are using a 16x 2 display screen which is of 16 pin. The device is TRULY LCD MODULE MTC-C162DPRN-2N. It is capable of displaying 16 characters in 2 lines at a time. Making overall 32 characters. The pin Details are given below for the LCD module. Pin NO. Symbol Level Description 1 VSS 0V Ground 2 VDD 5.0V Supply voltage for logic 3 VO --- Input voltage for LCD 4 RS H/L H : Data, L : Instruction code 5 R/W H/L H : Read mode, L : Write mode 6 E H, H →L Chip enable signal 7 DB0 H/L Data bit 0 8 DB1 H/L Data bit 1 9 DB2 H/L Data bit 2 10 DB3 H/L Data bit 3 11 DB4 H/L Data bit 4 12 DB5 H/L Data bit 5 13 DB6 H/L Data bit 6 14 DB7 H/L Data bit 7 15 NC --- No Connection 16 NC --- No Connection The VSS is kept at ground. Last 2 pins are not included in the design they are not used at all. Microcontroller: The selected microcontroller is PIC18F452 because of the following reasons. This powerful 10 MIPS (100 nanosecond instruction execution) yet easy-to-program (only 77 single word instructio ...