1/ 100th second Slot car Timer


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Location
    Southern Ontario
    Posts
    50

    Default

    Yes the projector is for the rest of the racers to see. It will display the real time race times and laps for each lane. There are a few programs out there that simply rely on the printer port for a on or off switch set up with light detectors and a bank of light over them, But the windows timers are not very accurate as far as timing go's. I am just trying to do this myself to see if I can improve on it. I need to time 2 cars and need a way of manually stopping the timers when there is a crash. I am just starting and will work these details out on my own I just needed a starting point. Should the 1/100th second timing be done on the pic and sent to the PC or should the pic only send a signal that the light has been tripped and do the timing in windows. VB does have a few different ways of timing so maybe one of them is better. If the pic and serial port can handle a real time 1/100th second update I will use it for timing if not I will only use it to start the windows timer.
    Beer is proof that God loves us and wants us to be happy.

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

    Default

    Any windows will be accurate as long as you can do software calibration... not much.

    But the PC interface is a pretty nice option... on the other hand... it may need calibration as well...
    Steve

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

  3. #3
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by Snap View Post
    Yes the projector is for the rest of the racers to see. It will display the real time race times and laps for each lane.
    What I mean is...the spectators aren't going to be able to see the difference between updates every 1/100 of a second or 1/10 of a second anyways, so why not slow the updates down a bit. Let the PIC keep track of actual times down to whatever resolution you want, but only send them to the PC every 1/4 second or so.

    I need to time 2 cars and need a way of manually stopping the timers when there is a crash.
    Is the timer stopper also going to cut power to the track? (I'm assuming these are the powered type slot cars)

    If the pic and serial port can handle a real time 1/100th second update I will use it for timing if not I will only use it to start the windows timer.
    With the way Windows software and PC hardware is set up these days, an input from a PC's serial port would probably be buffered in some fashion, and due to Windows multi-tasking capabilities, quite possibly might not get acted upon for a number of milli-seconds (or seconds on a slow machine ). Therefore, I think the best way to do it would be to keep track of absolute time at the track with a PIC, and send off those elapsed times/lap times/etc to the PC once in awhile...whatever the PIC/PC combo can handle. But again, I wouldn't think it would have to be that fast. After all, wouldn't people be watching the actual race, and not a big ol' TV screen?

  4. #4
    Join Date
    Apr 2007
    Location
    UK
    Posts
    5

    Default Crystal speed

    I'm pretty new to this, though I do remember reading somewhere that if you run the Chip at 4Mhz, 9600 baud is just that but if you run the pic at a higher rate, the 9600 baud setting is also multiplied. so you could get the equivelant of 24000baud if you run the chip at 10Mhz?
    Sorry if I am wrong.

  5. #5
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by KeithH View Post
    I'm pretty new to this, though I do remember reading somewhere that if you run the Chip at 4Mhz, 9600 baud is just that but if you run the pic at a higher rate, the 9600 baud setting is also multiplied. so you could get the equivelant of 24000baud if you run the chip at 10Mhz?
    Sorry if I am wrong.
    You are correct. If you DEFINE OSC 4 for 4Mhz, but actually use 40Mhz, and your serial commands are setup for 9600 baud, you'll actually get 96,000 baud. But running 9600 baud @ 4Mhz, the bit timing is fairly tight and if you're running any kind of interrupts, that'll mess it up.
    Better to use DEBUG serial commands @ 4Mhz since they take up less code space.

  6. #6
    Join Date
    Apr 2007
    Location
    Southern Ontario
    Posts
    50

    Default Thanks For The Help

    I finished the project. I ended up using the pic basic pot command to trip a cad to tell the PC a number. I then wrote a VB program with a more accurate Apps call to more or less get a very accurate 1 1000th sec timer. I needed the nice user interface VB provided. I will give out the code for free to anyone who wants it and can learn by it. I am on to my next project now.
    Thanks to everyone who helped I hope I can return the favor.
    Snap
    Beer is proof that God loves us and wants us to be happy.

Similar Threads

  1. Thermo 7 segments - little problem
    By fratello in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 27th July 2013, 07:31
  2. RS485 bus - starting probem
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th January 2010, 13:35
  3. 32 bit square root
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 6th May 2009, 03:37
  4. one line led light make image
    By bioul in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 12:19
  5. HSERIN doesn´t work
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th July 2007, 14:23

Members who have read this thread : 0

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