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.

assembly design for a watch with limited functions?

Status
Not open for further replies.

g3cube

Newbie level 3
Joined
Feb 24, 2006
Messages
4
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,326
Hello,

I want to write an assembly program for a watch with limited functions; such as timer, counter, lap time meory etc. I will start from zero.

Does any expertise can give me some advices in terms of the following?
1. choice of MCU
2. architecture of program vs power consumption vs response speed
3. potential applications of interrupt
4. memory allocations
5. other comments

Thank you very much.
G3Cube
 

G3Cube,

Here's a PIC based Clock I'm workin' on... I hope it may give you some ideas...

It uses a 20-MHz xtal time-base and you can adjust the timer routine in software in plus or minus 200-nsec/second increments (theoritical accuracy to within 6.3-sec/year) instead of using a hardware oscillator trimmer capacitor... Lower switch functions are 'long' 1.5-sec switch presses compared to 'short' switch presses for the upper functions... You get a single short beep when you press a switch and two short beeps when you've held it for 1.5 seconds... Switch LEDs flash for 'long' functions and return to the 'short' switch state (on or off) when you press the switch to turn off the 'long' function... Confusing, isn't it? In reality it's pretty intuitive (grin)... The rotary encoder has 'detent' positions and provides a very nice feel when you rotate it to select the display mode (CLK, ALM, TMR or CAL) or when you rotate it to adjust settings after pushing and lighting the SET switch... In SET mode you adjust settings of the blinking display group (Hours/Days, Minutes/Month, or Seconds/Year) by rotating the encoder and you switch blinking groups by pressing the built-in push-button switch on the encoder... PWM brightness or 'level' control from 00% (off) to 100% (full brightness)...

Kind regards, Mike - K8LH

**broken link removed**
 

Thank you very much Mike, K8HL

Would you build the "sleep" function between every response (say, between the second is advanced to another second) ?

Would you do the key scan by interrupt or direct polling ?

Do you think a software-enabled debounce should be built ? Any good suggestion to the debounce method ? Or simple "double confirmation" will do ?

Thanks again.
G3Cube
 

G3Cube,

I'm heading out the door for work so I'll provide a more detailed message tonight... Sorry...

I scan the switches in the interrupt routine at the same time I 'paint' a display column at 1-msec interrupt intervals... Each switch is updated once every 7-msecs and this provides adaquate debouncing...

I'll get to your other questions tonight... Gotta' run...

Kind regards, Mike
 

g3cube said:
Thank you very much Mike, K8HL

Would you build the "sleep" function between every response (say, between the second is advanced to another second) ?
My clock is powered so I don't use the sleep function... If your watch is battery powered you may wish to use it though I'm not sure which of the timers will work while in sleep mode (perhaps timer 1?)...
Would you do the key scan by interrupt or direct polling ?
My switches are driven by the same lines that are used for the display column drivers (only one line is ever driven low) so each switch is read into a SWDATA variable each 1-msec interrupt period... Polling would work fine too with different hardware setup but the column driver pins provided a simple mechanism for reading the switches on a single pin and the 7-msecs time between re-reading the same switch seems to provide adaquate debouncing (sort of a "two-fer", grin)...
Do you think a software-enabled debounce should be built ? Any good suggestion to the debounce method ? Or simple "double confirmation" will do ?
Even the best switches bounce so some sort of debounce hardware or software is needed... A 20-msec debounce period is common... I actually wait until switch is released before setting a switch flag for the main program to use... When a switch press is detected I send a short 50-msec beep for audible feedback and I start a 1500-msec switch timer... If the switch timer times out I send short double-beeps for audible feedback and set a time-out flag... When the switch is released a flag is set in either the 'short' or 'long' switch variable for the main program to use...
 

    g3cube

    Points: 2
    Helpful Answer Positive Rating
Thank you for your help Mike, K8HL

Regards,
G3Cube
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top