Thread: Project help

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    7

    Project help

    My final year project at university is designing and building a user interface for a plug in electronic timer that will switch on an external load at a set time and switch it off again at a set time.

    I am using a 6808 processor and a 2x8 alphanumeric lcd display. I have 4 I/Ps, 2 of which are for a rotary encoder. I only know very basic C.

    Would anyone be able to help with the program or provide some links to good example programs? Especially for a program which would run and display a real time clock on an lcd display? Thanks

  2. #2
    Registered User fischerandom's Avatar
    Join Date
    Aug 2005
    Location
    Stockholm
    Posts
    71
    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.
    Bobby Fischer Live Radio Interviews http://home.att.ne.jp/moon/fischer/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem Displaying a Struct
    By rockstarpirate in forum C++ Programming
    Replies: 16
    Last Post: 05-05-2008, 09:05 AM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  3. Dynamic Binding
    By gpr1me in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2006, 09:01 AM
  4. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 07:41 PM