Who designed the hardware?
1. Test the hardware, i.e., write a char to the LCD, etc, and you can read the rotary encoder wheels on the bus. Stuff the data in a variable, declaring it volatile is a tip, though its probably not neccessary.
2. Use the hardware manual for the Motorola 68xx processors. Read about timer registers. Then look in the manual for the C-compiler how to access the processors registers. Built a little Time structure, something like:
Code:
typedef struct Time {
unsigned char hours, minutes, seconds;
} Time;
Access it with:
Time time;
time.hours = value read from rotary wheel;
time.minutes = other value read from rotary wheel;
time.seconds = 0;
3. You then setup a timer register in the 6808 to generate an interrupt every second.
The interrupt shall trap a call to a Timer function that decrements time.seconds, etc.
Code:
--time.seconds;
if ( time.seconds > 59 ) {
time.seconds = 0;
--time.minutes;
if ( time.minutes > 59 ) {
time.minutes = 0;
--time.hours;
if ( time.hours > 23 )
time.hours = 0;
boom = true;
}
}
and then. . .
Code:
if ( boom )
SwitchRelay( ); /* etc. */
4. You need a simple interface Set Timer / Run / Stop.
And obviously a function to write to the LCD.
5. Some hardware buttons Run/Stop. Preset, etc.
Hope you get some ideas.