Stopwatch Circuit

N12ck

New Member
Hi, I am currently doing my A Levels in systems and control, does anyone know of any already existing circuit for a stopwatch using the PICAXE 28x2 chip if anyone can help that would be great :)
 

MartinM57

Moderator
Welcome to the Forum :)

The Forum helps people who help themselves first - oh you are (trying to) help yourself by getting someone to give you the answer straight away :D

I'm sure A level Systems and Control should be a bit more structured than just asking an Internet forum for the answer. For a start, I'm sure "defining the requirements" is a key starting point.

So what are the requirements for your stopwatch? Accuracy, resolution, start/stop method, display method for starters - and then there's plenty more...
 

N12ck

New Member
hi, I have helped myself before now or else I wouldn't be asking, I have looked into PIC circuits and I have researched them however in A Level systems and Control it does not require you to design them, just to know how they work, build them, produce a viable product from it and program it, I currently have tested about 5 different PIC circuits so far and none fit the needs of my project,

I need a PIC circuit which displays minutes, ten seconds, seconds, tenth of a second, I have seen many but not for this specific chip which I was told by rev-ed themselves was the best, all I was asking for was someone to point me in the right direction to a circuit I can modify and program myself, My teacher told me to come onto this forum over the holidays and ask for an idea of a circuit, however I didn't expect for people to be so rude.

it needs to be able to accept 2 analogue inputs and give outputs to 7 segment displays, any help would be appreciated.
 

eclectic

Moderator
1. AFAIK, there is not a stopwatch circuit specifically for the 28X2.

2. However, there are many versions of timers/stopwatches on the Forum.
Many would be straightforward to modify.

3. PIC or Picaxe? There is a great deal of difference.

4. Martin was not being rude,
he was asking, very reasonably,
for further information.

5. Might I suggest, for your sake,
that you draft your reply in
Notepad / Office or whatever,
then print it, then read it.
Only when you think that it's OK
do you send it.

e
 

knight

Member
N12ck, you have to remember, that everyone on the forums is a volunteer, we come here during our free time to help and we quite oftern get asked for the answer straight up.

The problem is 1. We all failed mind reading so we can't just go okay he needs a (stopwatch) that does this
2. We want people to learn, so eventually they can come back and help others, they arn't just coming back each project because they need the code. There is nothing hard about soldering some components together and downloading the code, thats simple, what takes work and knowledge is writing the code.

All Martin was trying to do was point out we need more information and that we won't solve your problem for you, we will help you, but we will not just give you the answers ESPECIALLY for a course assignment.

Now your problem:

First, I'm assuming that you are going to need 8 seven segment displays (2 for min, 2 for 10's seconds, 2 for seconds and 2 for tenths).
So no chip in the PICaxe range is capable of running 8 seven segment displays constantly. So you have a few options, the most common of which are strobing them or using an external I2C chip

The actual timer function is fairly easy and will involve the use of the timer variable in the X2 parts. May i suggest that you read the manual and look up either timer or timer3. http://www.rev-ed.co.uk/docs/picaxe_manual2.pdf

How about you also post the circuits you have tried so far and tell us what didn't work, then we can shape our answers to ones that are most likly to help.
 

MartinM57

Moderator
No rudeness intended - sorry if any came across.

There is no "standard" circuit, so you will end up designing something. Help will come from the forum.

Knight assumes 8 displays - I assume 4 displays ...unit mins, ten seconds, unit seconds, tenth seconds. Maybe it's 5 displays as you need tens of minutes as well - so are we doing M:SS.T or MM:SS.T?

For the 5 "PIC" circuits you've "tested", what sort of tests did you do and what were the problems that need to be avoided this time?

When you say 2 "analogue" inputs, what do you mean? Two switches (start and stop or start/stop and reset?) - which would normally be called digital inputs - or are the two analogue inputs something different?

So the resolution is 0.1 secs. What about accuracy? 0.1 secs in 9:59.9? 1 second? 5 seconds?


Finally (for now ;)), any cost limitations? £10, £15, £20?

It's still questions at the moment I'm afraid - otherwise we could all be typing pages of stuff that isn't relevant becuase there's something we don't know.
 

hippy

Ex-Staff (retired)
it needs to be able to accept 2 analogue inputs and give outputs to 7 segment displays, any help would be appreciated.
Can you explain what the need or purpose is for the analogue inputs ?

And please don't think anyone is being rude in their responses, it's simply that they are trying to clarify exactly what it is you want from the stopwatch you desire. As you say, you've tried 5 PIC circuits and they did not fit the bill; people won't want to propose the very same five solutions which aren't actually useful - that just wastes their time and yours.

Although your application may not be particularly important to what the stopwatch does, it gives other people a good idea of what you are doing and what you need to achieve and helps them visualise what you want at the end of the day. The more you can give others which help them understand exactly what you want, exactly how you want it to work, the better people will be able to offer suggestions which are really useful to you.

It's a bit like walking into a jewellers and stating, "I want to buy a watch", the natural response, while pointing to hundreds of watches, will be, "what sort of watch would you like". It's the natural process of narrowing down what choices there are to what is most suitable for you.
 

N12ck

New Member
Hi, I have worked it out to have 4, 7 segments as my requirement is for a go-kart timer, 1 for minutes (as a lap is normally 1 minute max) 2 for seconds and one for tenth of a second, as I don't really need much more accuracy than that

and to eclectic a programmable interface controller using a PICAXE chip (28X2)

the 2 inputs are there due to the nature of the project, it needs to accept input from a reed switch (magnetic pickups in the track) and via the steering wheel to time round a particular corner,

also i attempted to convert a circuit i found using a AT89C2051 PIC chip, circuit: http://www.kmitl.ac.th/~kswichit /clock/clock2.pdf

as you can see this is a clock circuit however i realised it could be reprogrammed and modified to be a stopwatch.

they said : Use Picaxe portB pins B.1 to B.7 for P1.1 to P1.7 and C.0 to C.7 for P3.1to 3.7 .... however I am new to PICAXE and i dont know what to do with the other pins, and also they havent stated on the circuit diagram if the 7 segments are common anode or common cathode also it doesnt show how the 7 segments are wired , i want to learn PIC and i am wondering which part of the circuit created the pulse to each display as i dont fully understand this IC yet (28x2)


also cost limitations: £50 and i was intending the reed switch once activated :start, once activated again :stop the button pressed once: start pressed again : stop and sorry 3 inputs as i will need a reset

Thankyou for the help
 
Last edited:

hippy

Ex-Staff (retired)
in A Level systems and Control it does not require you to design them, just to know how they work, build them, produce a viable product from it and program it
The circuit for the AT89C2051 could be fairly easily adopted for a PICAXE 28X2, however it is perhaps more a question of exactly what you want and need to be able to progress. That's a muliplexed design with no current limiting resisitors which can be made to work but will prove a challenge to program. Either common-cathode or common-anode displays could be used, it's just a question of sorting out the polarities in software.

You may however be better off with the four displays driven from separate 4511B or 4026 display drivers as shown in PICAXE Manual 3.

Perhaps some indication of your electronics and programming experience will help, along with an indication of how much time you have to put into the project and when its deadline is.
 

N12ck

New Member
The circuit for the AT89C2051 could be fairly easily adopted for a PICAXE 28X2, however it is perhaps more a question of exactly what you want and need to be able to progress. That's a muliplexed design with no current limiting resisitors which can be made to work but will prove a challenge to program. Either common-cathode or common-anode displays could be used, it's just a question of sorting out the polarities in software.

You may however be better off with the four displays driven from separate 4511B or 4026 display drivers as shown in PICAXE Manual 3.

Perhaps some indication of your electronics and programming experience will help, along with an indication of how much time you have to put into the project and when its deadline is.
Hi the deadline is May/ June this is only the second time i have programmed a PIC circuit and i have read the manual and it shows exactly how to program a timer/ clock, electronics, i have done for 4 years, and i have built infrared guitars, burglar alarms which you can alter the output to, I've also built a monophonic keyboard ... all conventional circuits... PIC is a new thing to me.
 

MartinM57

Moderator
I'd forget that circuit (you probably have already). It's not a great design for a relative beginner for a number of reasons and it's not even for a Microchip PIC - it's for an Atmel 8 bit microcontroller.

On a terminology note, I'd suggest "microcontroller" as the generic term. PIC is commonly used to mean a microcontroller from Microchip (it's probably a trademark) and a PICAXE is a PIC that Rev-Ed have programmed to be able to run PICAXE BAsic programs.

We all use PICAXE round here ... :)

I don't quite understand how the switches work or what "time round a particular corner" means, but I've one eye on a rather good darts match on the TV. I think you probably need to think through the switches a bit more. Also, is an embedded magnet in a track really going to switch a reed switch on a swiftly passing kart? Does the magnet cover the whole width of the track as well?

Also using 7 segment displays makes things more complicated - an LCD would be simpler. Does it have be 7 segment?

Anyway, you want some answers. I'm assuming you have some familiarity with PICAXEs, otherwise you need to scan-read Manuals 1, 2 and 3 pretty quickly (see the links at the top of this web page).

I'd be looking at:
- PICAXE 28X2 with external 10Mhz resonator

- some external hardware for controlling the displays - my favourite chip is the MAX7219 (expensive though) and you'll find code on the forum (from me) for it. Alternatively, some may say use external shift registers - see http://www.picaxeforum.co.uk/showthread.php?t=9408 for more discussions

- some means of the code knowing when each 0.1 seconds has elapsed. http://www.picaxeforum.co.uk/showthread.php?t=14523 shows a simple (well elegantly simple, not actually that simple) method of generating 100mS interrupts.


You've actually quite a challenge on your hands here - some of the concepts you need are quite advanced, but not beyond A level student ability ;) What's the timescales for this - all done and dusted in 2 weeks, 5 weeks, 10 weeks?

Have a think about these things and come back with some proposals and any questions you have about them.
 
Top