You are on page 1of 9

Embedded systems using FPGA

Design of Multifunction Digital Clock


---------- specification, construction and
implementation

ZHU Siyue
DSE
Specification
Requirement
Use the FPGA board in lab
Use at least one peripheral (not LCD panel)
Make use of interrupts

8 Functions Finished
Clock : year, month, date, hour, minute, second and can distinguish different
months or leap year
12/24 hour mode: when in 12 hour mode show AM/PM on the LCD screen
Setting: in this mode, user can change the number of each bit of clock
Timer: set time, start to countdown, reset, LEDs shine when time up
Alarm: set alarm and snooze function, bell ring when time up
snooze – pre-set: allow at most 5 minutes sleep time, then ring 30 sec in every
5 min
– interrupt set: interrupt the bell ( if in 2 minutes) , then ring 30 sec in
every 5 min
Stopwatch: start, pause, reset
Low power: in function1(clock), if press low_power then all button locked and LCD
cleared, which means only clock and alarm(if there is) run in the background
Clear LCD
Construction

high Interrupt level

Center button
(function switch)

Left button
(reset in functions)

Right button
(start/pause )

North button
(increase/plus)

South button
(decrease/minus)

low
Function Implementation

Void function_switch() //interrupt


 different functions switched by the center button {
if(function==6) function=0;
else function++;

Switch(function)
Alarm and Snooze On {
case 0:……,break; //default setting
case 1:……,break;
…………………..
Sleep Mode
}
}

Void main
{
while(1){
………
switch(function)
{
case 1:……;break; //implemtation
case 2:……;break;
……………..
}
}
}
Function implementation .cont

Function Switch

SubFunction Button Function


Call Switch

Specific
Function
Overview of Function Control
Function implementation .cont

Increase Value Next Function

Stop/Pause

Shift to void Button_intr(void * baseaddr_p)


Right Bit (loop) {
Switch(function)
{
………………….
case 3:……,break; //button function
…………………..
}
}
Decrease Value

Button Function in Function 3 (timer)


Button Function

Button Function Table


Function
clock 12/24 setting timer alarm stopwatch
Button

Next Next Next Next Next Next


Center
function function function function function function

All data
Left reset -------- Left bit Right bit Left bit reset

Alarm 12/24 hour


Right on/off mode right bit Start/pause Right bit Start/pause

Up LCD clean --------- Increase Increase Increase --------


(low power) value value value

Snooze Decrease Decrease Decrease


down -------- --------
on/off value value value
Summary and Conclusion

Hardware Implementation: interrupt(FIFO)


PLB(Processor Local Bus)
Peripherals(LCD, LED, Buttons, Beep)
Debouncer

Software Implementation: Software FSM


Subfunction Call
Switch…Case…

Extensible Potential: Switch Button (high_level interrupt)


More Function of LED
Watch Dog Timer (a count give a reset signal)

The Multifunction Digital Clock


works perfectly !
END

Thank you for listening


---------- welcome to ask questions

You might also like