Coding Issues

LCD Issue

It was important to time the communication between the LCD and the microcontroller.  The Micrcontroller must also supply the clock signal to the LCD driver.  The following timing diagram was used to develop the code that simulate it.  


Button Interrupts

Power consumption and conservation of power was a large consideration when developing the system.  It was important to take advantage of the external interrupts in the chip.  Each button is connected to a pin on port C.  They are also connected to one external interrupt.  In order to achieve this an AND gate was created using diodes.  When a button is pushed and external interrupt is triggered.  This wakes up the chip, checks what pin is low, or what button caused the interrupt.  The appropriate code is executed and the chip is then placed in sleep mode until another external interrupt is triggered.