Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

An analog watch and thermometer on graphical LCD Nokia 3310

Status
Not open for further replies.

Vermes

Advanced Member level 4
Joined
Aug 2, 2011
Messages
1,163
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,316
Activity points
22,318


It is a watch and thermometer constructed on AT91SAM7S64.
This project was made to learn something more about software support of:
  • graphical display of the Nokia 3310
  • incremental encoder
  • DS18B20 thermometer system
The graphical display is mounted in KamodLCD1 module (Kamami). Used encoder is made by Alps, it was taken from an old plate. The thermometer system was attached to a set of runtime AT91SAM7S64 microcontrollers ordered in Propox.
Schema of this system is very simple. In fact it consists of elements of EVBsam7s runtime set schema, which are necessary to build and activate this system with attached display, thermometer system and encoder. After building this system, programming the microcontroller and activating the whole, the face of the watch appears on the display, hands point 12 o'clock and temperature value measured by DS18B20 is also displayed. Setting the correct time is done by turning the encoder (turning right – moves hands towards, turning left – opposite) – the same as in traditional hand watches.
The program of the watch was written in Rowley Crossworks for ARM v.1.7. The program works like this: the mocrocontroller counts interrupts induced each 500ms by TC0 timer. In the procedure of supporting the interrupt, tick variable takes the true value. Temperature can be read from the sensor each 500ms period (if the tick variable is false), while refreshing the displayed temperature value after the expiry of each 500ms period (the tick variable is then true). At the same time a value of the divisor is increased by 1. When the value of this variable is equal to 2 (another second passed), then the program accordingly increases by 1 the values of variables: rotation_second_hand, rotation_minute_hand and rotation_hour_hand.
New values of those variables are then used to calculate new coordinates of hand's ends. Those coordinates are used by glcd_line function, which draws the hands on the face of the watch. The calculations of coordinates of hands' ends are done by trigonometric functions and then rounded to integer values required by the above mentioned glcd_line function.
The handling of encoder was made with help of external interrupt IRQ1, which is called via falling edge of pulses occurring at once encoder output, plugged into the pin PA30. The procedure of handling this interrupt checks then logic level on the pin PA29 and dependent on that level, it sets correctly and zeroes variables: rotation_left and rotation_right, which in the next part of the program give the information about the direction of the encoder rotations. The information is then used to suitable decrease or increase the variables rotation_minute_hand and rotation_hour_hand and setting the variable rotating_second_hand on the value of 45 (so it points 12 o'clock during setting the time) and drawing the hands on this basis in new positions during a time setting.
The encoder working is showed in the picture (logic levels on the pins PA29 and PA30 and active the edge triggering IRQ1 interrupt).

5126343200_1301728361_thumb.jpg


Link to original thread (video + attachment) – Zegarek wskazówkowy i termometr na LCD graficznym Nokia3310
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top