Olympic Timer


Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 40 of 48

Thread: Olympic Timer

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358

    Default Olympic Timer

    It's almost Olympics time... so here's a topical program using PBP exclusively (no embedded Assembler) to give you a Stop-Watch with 1/100th Second Timing (yes that's 0.01 of a Second) and gives you REAL-TIME display on your LCD. Now you can do your own timing and challenge the official time...

    The program demonstrates using TMR1 in BACKGROUND (multi-tasking), uses PICBasic Interrupts, and accounts for the fact that PICBasic doesn't respond to those Interrupts immediately. There's also a set-Up CALIBRATION menu item, so you can adjust and calibrate your timer to an accuracy of 360mS per Hour.

    How does it do all that? Better download the PDF and find out...

    Melanie

    PS. Questions and Comments post on this forum/thread. No off-list mail please.
    Attached Images Attached Images

  2. #2
    frederick's Avatar
    frederick Guest


    Did you find this post helpful? Yes | No

    Default

    Could you use a 2x16 lcd with backlight or even a 1x16 with a backlight

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Sure you can.

    The 16F876 which this was originally written for has two PWM ports. One can be used to give you software Contrast adjustment, and the other can be used to give you software Backlight adjustment. Whilst you can get away using just two Resistors for the Contrast, the Backlight will need a Driver (in it's simplest form a Transistor or MOSFET along with a couple of Resistors) as the PIC cannot directly sink the current needed for most Backlights.

    You can then add the Contrast and Backlight Menu Set-Up's into the built-in Menu structure of the Olympic Timer.

    If you have any problems integrating those features, let me know and I'll post the code and hardware circuits.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Hey, anyone else going to Athens Olympics opening night party? See you there...

  5. #5
    frederick's Avatar
    frederick Guest


    Did you find this post helpful? Yes | No

    Default opto-isolators

    What would work. I was looking into a photo resistor.

    This what I am going to use your design. I complete in Olympic style weightlfting. I want to measure the time it take to reach the top of my pull (desired hight) and when I reach the top of the pull the timer will stop and also give me audio alarm.

    The unit will start/stop the timer by the bar breaking a beam.
    This is will be use for a training aid.

    Any help would be appreciated.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Do you start timing the instant the weights are lifted off the ground, or after the lift has reached a certain height?

    How do you plan to account for the fact that one weightlifter stands 1m50, and his buddy stands 1m90, and a third guy is waving the weights around over his head like a tree in a Florida hurricane?

  7. #7
    frederick's Avatar
    frederick Guest


    Did you find this post helpful? Yes | No

    Default

    The timer would start as soon as you lift the bar off the ground and stop at a certain height.

  8. #8
    frederick's Avatar
    frederick Guest


    Did you find this post helpful? Yes | No

    Default what LCD Controller did you use

    I am looking for an 1x16 LCD and If you can recomend a brand.

  9. #9
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I use PowerTip big-time... consuming thousands of pieces a month. Never any problems interfacing to PICs or using with PBP. PC1602F (which is actually a 16 x 2) is very price competitive and perhaps the one to consider.

    When I was in China a few weeks ago, I visited Tri-T, who claim to offer a direct compatible unit to PowerTip (TMBC16265SP) but with Backlight at the same price as PowerTips standard reflective unit. The sample I walked away with was excellent. The first batch of 200 is clearing customs at the moment and I'll let you know if they're all as good as that original sample by the end of the week.

    Moving back to the weights...

    I see no problem detecting the weights being lifted, as you can have a photosensor on the floor with the weights covering it. At the lift end, I'd use a IR emitter/detector (of the sort found in TV remotes). Modulate it at it's working frequency (usually around 38kHz) and detect that. It should make it pretty much immune to extraneous light, flash-photography etc.

    You may want to change the Olympic Timer software so that you can only START the clock ONCE following a RESET. As it stands, once it's stopped, you can start again and continue timing from where you left-off.

  10. #10
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I said I'd report back on the LCD business...

    Tri-T model TMBC16265SP-03 'Cool Blue' (full Part Number TMBC16265SP-SN-LED05-W) has to be one of the sexiest 2 x 16 displays around. Fully PBP compatible, excellent contrast ratio, and super bright white LED for backlighting which requires minimal current consumption...

    Just ordered 5000 pcs (eta 6-weeks)... if anyone is interested, I will get some put aside to offer people on this list with a price tag of US$15.00 which includes shipping worldwide.

    Melanie
    Attached Images Attached Images  

  11. #11
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Melanie,

    Whats the current drain on these puppies?

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  12. #12
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I assume you mean the Backlight Current since the LCD module itself is less than 1mA... I run them between about 5mA (what I consider the minimum acceptable Backlight level) and 40mA (what I consider seriously bright). The example jpeg I posted is running at 22mA.

    There is a spin-off here if you're clever... that super-white LED throws out a considerable amount of collateral light at the right-hand edge of the LCD module. I tend to put my control push-buttons at that right-hand edge. If you specify the correct material for your panel overlay and get your artwork right, you end up backlighting your control buttons for free. See appended jpeg...
    Attached Images Attached Images  

  13. #13
    DelBoy's Avatar
    DelBoy Guest


    Did you find this post helpful? Yes | No

    Smile Blue LCD's

    Do you have any of these Blue LCD's, but in 20X2.....

  14. #14
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Only just returned from China today... sorry for my delay in replying.

    No, only 16 x 2 at this time.

    Melanie

  15. #15
    badrad's Avatar
    badrad Guest


    Did you find this post helpful? Yes | No

    Default Have you ever used any of the graphic lcds?

    I checked out the website, and the pc1602-L looks like a direct replacement (other than the background colour) for the Optrex displays I am currently using. Unfortunately Optrex has obsoleted some of their character displays so the order of the day is to locate alternate replacements for my design.

    I am considering to redesign using one of the graphic displays instead. have you worked with any of the powertip graphic displays, and if so, any tips or suggestions?

  16. #16
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I've never had time (or the requirement) to play with Graphic LCDs... I'm already struggling with a 30-hour day and I'm looking to buy a good condition Time Machine the instant one appears on eBay.

    I can however recommend these Guys...

    http://www.compsys1.com/workbench/

    Ranjit's been playing with PBP and LCD graphics for a long time, and has posted routines and goodies in the MeLabs email forum over the years which you can extract from the Archives...

    http://list.picbasic.com/cgi-bin/board-search.cgi

  17. #17
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default

    Hi Melanie,
    Is there any chance you could post a direct link to the LCd you have pictured?
    A Google search for Powertip yeilds many results, and I can't find that part
    number under any of them..
    Cheers, Art.

  18. #18
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Hi Art

    If you looked halfway up the thread you'd notice I said "Tri-T model TMBC16265SP-03 'Cool Blue' (full Part Number TMBC16265SP-SN-LED05-W)"

    These are manufactured by Tri-T which is why you can't see them on the PowerTip site. Tri-T won't even acknowledge you unless you start talking thousands of pieces, so I do keep a surplus over what we consume just for folks on this list.

    Melanie

  19. #19
    wilfrieds's Avatar
    wilfrieds Guest


    Did you find this post helpful? Yes | No

    Default lcd

    Hello Mel

    I am designing a LCD dashboard for Earthmoving/forklift equipment.
    Do you have a 2 x 16 or 4 x lcd LCD that's waterproof.
    Background lighting prefered.

    Wilfried

  20. #20
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I'm holding class today (oooh goody... a whole day of young techies saying "Yes Mistress" - or something similar)... give me a day and I'll edit some pics together and show you a method I use of waterproofing what otherwise isn't...

  21. #21
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Sorry about the delay in responding... had to find the Digicam, allocate time to take pics, then edit-out the client logo's etc etc...

    LCD1. We start off with our Control Panel with our LCD, Buttons, LED's etc all attached. Ribbon Cable plugs into main electronics located elsewhere (in our example here in the base of a IP66 rated enclosure). Yes, you can have your LCD (example in 4-bit Parallel Mode) on the end of a long Ribbon Cable. I've used 350mm without any problems.

    LCD2. That's the Lid from an IP66 rated enclosure. The Lid has been machined to take the LCD, Buttons, LED etc etc. You attach your Control Panel to the back of this Lid. Ribbon Cable plugs into the electronics secured in the base.

    LCD3. A clear, self-adhesive reverse-printed flexy-acetate is overlayed on the Lid. Your silk-screen printer will advise as to the different adhesives available to make this watertight. It is Reverse-Printed so that the markings will not be rubbed-off with use. It's semi-flexible, so that you can push through to access the Buttons. Again your Silk-Screener will advise you as to the range of materials available to you. A medium-duty favourite of mine is 250 micron clear PVC. The electronics you'll note is now in the sealed enclosure with IP56 rated cable glands for entry/exit.

    LCD4. Finally, the addition of a Bezel (in this case a 18swg Steel Plate) makes it Bullet-proof. The Bezel prevents peeling or otherwise tampering with the edges of the acetate panel. The Bezel can additionally have a gasket seal around the inside edge. You can hoze-down the final assembly, stand it out in the rain, or perform whatever watersports you fancy in it's proximity. Rather than a Steel Bezel, I've also used a reverse-printed Plexiglass panel. That's also a good option where there are no Buttons, just Displays and/or LED's.

    Have fun.
    Melanie
    Attached Images Attached Images     

  22. #22
    Join Date
    Jul 2005
    Location
    The Netherlands
    Posts
    39


    Did you find this post helpful? Yes | No

    Default

    Hi,

    For daylight applications, and battery applications I use Winstar (WH1602), the PLED for low current (5V/20mA) and very high bright.

    If you need more info, please let me know,

    Best regards,
    Gerben

  23. #23
    wilfrieds's Avatar
    wilfrieds Guest


    Did you find this post helpful? Yes | No

    Default waterproofed LCD

    Hi Mel ( mistress??)

    Thanks for the responce

    It will be a bit difficult finding all the materials down here in South Africa( the ass-end of the world) but it will certainly put me on track.

    P.S. Still battling getting the DS1307/16F877/LCD to work.

    Appreciated greetings.
    Wilfried

  24. #24
    lukygrl's Avatar
    lukygrl Guest


    Did you find this post helpful? Yes | No

    Default Instructions set for PC1602F

    Hi, I have been reading the post, and I have a PC1602F but although it came with the electrical specs I can't find an instruction set for it, could someone help me?

    Thanks in advanced.

  25. #25
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Page out of the Hitachi Controller Manual...
    Attached Images Attached Images  

  26. #26
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Exclamation TMR1 Pause generator

    Mel,

    Your Olympic timer program is a piece of work. Wow. The example has given me a pretty good start with timer operation.

    I was wanting to use the PIC's TMR1 resource to do two things.

    1. Act as "a timer" as in the Olympic Timer Demo to set a FLAG after 5 mins
    2. Simulate a program PAUSE (say 3 seconds)

    I gather from your program description that instructions can NOT take longer thatn 10ms, otherwise my 5 min timer will in (1) will not be accurate. (Hence cant use a simple PAUSE command)

    I have attached code that I think should work (but doesn't) and was wondering if you could help me out.

    This is the main difference:

    DELAY VAR BYTE
    TIME_END VAR BYTE
    TIME_START VAR BYTE

    Begin:

    DELAY = 3 ' CREATE A THREE SECOND DELAY
    TIME_START = SECONDS ' SAVE CURRENT TIME
    GOSUB KILLTIME ' GO WAIT FOR THE DELAY
    TOGGLE PORTB.0 ' DELAY FINISHED NOW TOGGLE LED

    goto begin ' DO IT ALL OVER AGAIN

    DISABLE


    KILLTIME: ' KEEP DOING THIS ROUTINe UNTIL delay time reached
    TIME_END = SECONDS-TIME_START ' MINUS START TIME EQUALS THE CHOSEN DELAY
    IF TIME_END > DELAY THEN RETURN
    GOTO KILLTIME
    Attached Files Attached Files

  27. #27
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie
    I said I'd report back on the LCD business...

    Tri-T model TMBC16265SP-03 'Cool Blue' (full Part Number TMBC16265SP-SN-LED05-W) has to be one of the sexiest 2 x 16 displays around. Fully PBP compatible, excellent contrast ratio, and super bright white LED for backlighting which requires minimal current consumption...

    Just ordered 5000 pcs (eta 6-weeks)... if anyone is interested, I will get some put aside to offer people on this list with a price tag of US$15.00 which includes shipping worldwide.

    Melanie
    Hi Melanie,

    Do you have any of those Lcd's left? I realize it's been over a year since you posted the offer but I thought I'd ask anyway as they look pretty cool and seem like such a good deal.

    Thanks
    jessey

  28. #28
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Jessey, as you live in Canada, may i suggest you
    www.crystalfontz.com
    www.norgay.com

    Both offer great prices even on low quantity
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  29. #29
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    Jessey, as you live in Canada, may i suggest you
    www.crystalfontz.com
    www.norgay.com

    Both offer great prices even on low quantity
    Hi Steve,

    I'll be sure to check them out.

    Thanks
    jessey

  30. #30
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Yes we still use those 'Cool Blue' LCD's - several thousand a month....

  31. #31
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie
    Yes we still use those 'Cool Blue' LCD's - several thousand a month....
    Hi Melanie,

    That's great, are you still selling them for $15.00 USD with free shipping? I'd like to purchase a few if I could, so how would I make payment?

    Thanks
    jessey

  32. #32
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Message me off-list.

  33. #33
    micro's Avatar
    micro Guest


    Did you find this post helpful? Yes | No

    Default

    hello Melanie

    i have some questions

    1- i did not understand yet why did you used calibration? and what is that for ? all what i understood it that
    you used to speed up or down, but i could not understand it why ?
    2- all i know, the Disable i use it before interrupt routine and Enable after it, but i note you used it at different place
    why did you placed at these places ?

    Enable

    DisplayLoop:
    if ButStart=0 then runningflag=1
    if butstop=0 then runningflag=0
    lcdout $fe,$80,Dec2 hours,":", dec2 Minutes,":", dec2 seconds,":",dec2 Hundredths


    if overflowerror=1 then
    if seconds.0=1 then
    lcdout $fe,$8c,"ERR"
    else
    lcdout $fe,$8c," "
    endif
    endif
    if runningflag=1 then goto Displayloop
    if butreset=1 then goto Displayloop



    Disable

  34. #34
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Calibration

    With the best intentions in the world, a 4MHz Clock is NOT a 4MHz clock. It is a few Hz fast, or a few Hz slow, but is is NOT exactly 4000000.0000Hz. so the Calibration feature is used to speed-up or slow-down the clock slightly to compensate, and to compensate any lag in software instructions used to service the interrupt.

    Interrupt ENABLE

    I only ENABLE interrupts where they are needed. In other places they are either not needed, or not wanted. This also makes for smaller and more efficient code.

  35. #35
    micro's Avatar
    micro Guest


    Did you find this post helpful? Yes | No

    Default

    so put some codes between Disable and Enable, that will delay interrupt
    handler rountine for few times?? and use that trick if i want to finish some
    procedures, i fear if without it the interrupt could screw it up ?then for that i give some
    delay to interrupt to finish that procedure?


    Disable

    Enable

  36. #36
    Join Date
    Jan 2006
    Posts
    31


    Did you find this post helpful? Yes | No

    Default Spi

    Wouldn't it be nice to display the time in big 7-segment displays like 2" etc.
    My question is what is the probability of using Serial-In Parallel Out IC like CD4094 or 74HC595? The olympic timer code excellently. I'm planning to try it using PIC16F628A. 8 pcs of 7-segment displays with individual SPI drivers communicating through a 3-wire interface (Clock, Data & Latch). I'm planning to change the LCDOUT command with a series of 8 SHIFTOUT command followed by 1 PULSOUT. Which is faster, 1 line LCDOUT or 8 lines of SHIFTOUT? What will happen to Timer's accuracy?

    I'm very much happy to hear something from you.
    Thanks. This forum is the best.
    Last edited by emavil; - 30th October 2006 at 03:48.

  37. #37
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    why 8 lines of shiftout and tons of hardware while you can use a single line of I2CWRITE with a MAX6955 OR a single HSEROUT/SEROUT with built an external 7-segment display driver with a PIC?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  38. #38
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default Cool Blue LCD's

    Quote Originally Posted by Melanie View Post
    Yes we still use those 'Cool Blue' LCD's - several thousand a month....
    Hi Melanie,

    Any chance of purchasing another 4 of your cool blue Lcd's?

    Thanks
    jessey

  39. #39
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Yes of course Jessey, I'll email you direct.

  40. #40
    zigapetric's Avatar
    zigapetric Guest


    Did you find this post helpful? Yes | No

    Default Help with olympic timer

    Hi!
    First my introduction:
    I am racing with a dirt bike and I have my own race track. I would like to record my lap times with something like this program. But there is a problem. I don't know how to program in Picbasic. I am used to assembler or C program language. So I'm asking if you have this code translated in assembler or C.
    I just need to change that the measured time is stored in memory and on LCD which already is and that when I cross the line timer has to store lap time which ended up and at the same time start timming for the next lap.
    I'll realise this with an IR diod installed on a motorbike and a reciever.

    I know that it's a bit komplex, but if you have something like this Please respond to me.

    Thanks! Ziga

Similar Threads

  1. About olympic timer..
    By Eng4444 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th June 2006, 10:16
  2. Melanie's Olympic Timer
    By nedtron in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th January 2006, 15:41
  3. Olympic Timer MPH readout
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th August 2005, 18:56
  4. Help with scroll text in Melanie Olympic Timer
    By jorge in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th November 2004, 15:52
  5. Melanie Olympic Timer -> Banner....scroll text...
    By jorge in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th November 2004, 23:11

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts