Is this possible?

gengis

New Member
I'd like to emulate "ships bells" with an 08M. I figure for the time base a quartz clock's internal oscillator. The idea is to divide the day into four hour "watches" and striking 1 to 8 bells every half hour. (the bell is struck in groups of two, if two or more bells are to be rung)

My question: If the axe is busy watching for a 1 second pulse from the time base and counting them, can it go off and ring the bells on the half hour mark without missing counts? I'll need a 50 millisecond pulse out to the bell solenoid, pause 200, another 50 ms pulse out, then 350 ms pause, 50 ms pulse, etc..

Plan B might be to put an optical interrupter on the minute hand on 12 and 6, but that seems like cheating - but it does take care of another problem: setting the time easily.
 

Andrew Cowan

Senior Member
A DS1307 connected via I2C seems like an easy solution (using an 18M2 PICAXE) - you can just read the time from the DS1307.

A
 

sghioto

Senior Member
If you have to use 08M you could divide the 1 second pulse by 60 and count minutes or simply subtract the total time of the bell sounding sequence from the count required to the next half hour.

Steve G
 

hippy

Ex-Staff (retired)
If the solenoid pulses and pauses are relatively short ( as they are, and the pauses can be divided into consecutive smaller pauses ), the PICAXE can check for 'ticks' between those commands and keep its internal count up to date.

The only problem comes when the 'ticks' are short pulses, shorter then the period you are checking. That's not a problem for PICAXE with hardware interrupts but the 08M doesn't have them.

I'd also second Andrew Cowan's DS1307 suggestion as this would make things a lot easier to implement, though you'd have to write I2C routines - not that hard.

This is probably also a good candidate for an 08M or other PICAXE with a watch crystal directly attached running like a DS1307 itself. That's more complicated, more limited in battery backup options, but is the lowest cost solution.

If choosing the 08M simply for lowest cost, it is worth considering if the saving of a few pennies or cents makes sense when an 18M2 gives far more, would make the program much easier and brings the capability to add clock setting and adjusting buttons and so on when the clock does slightly drift out of sync with the real world. It can make a lot of sense to spend a little more to have an easier to implement, capable project than be constrained to what a smaller PICAXE allows. Over the lifetime and enjoyment of the project the small extra cost will quickly pale into insignificance.

PICAXE cost is likely to be just a minor part of a project's entire cost anyway and, after a few weeks, you'll likely have forgotten that you spent any extra money, or not care because of what you have working in front of you.
 

Dippy

Moderator
Surely the method may depend on the duration of the "1 second pulse".
If it is 1 second on and 1 second off, then with your specified outputs, I would have thought that soft-pin-status checking would be possible and a breeze with interrupts, even though they aren't proper hardware ints.
Even a 10% duty could be caught with good coding and a little I/O time-slicing and/or interrupts.
 

gengis

New Member
Thanks guys. This looks a lot more doable now. I like Hippy's idea of integrating the beeping in synchronization with the timing ticks. For instance: Strike the chime twice then wait for a timing pulse, count it, and strike twice again. (if I understand it)

I don't understand this
The only problem comes when the 'ticks' are short pulses, shorter then the period you are checking. That's not a problem for PICAXE with hardware interrupts but the 08M doesn't have them.
The ticks are short pulses, but is that relevant if I wait for a tick between bell rings?

AND sghioto's suggestion? Can the timing pulses be "divided?" Take a one second pulse and break out slices of it (if I understand what he's suggesting) into, say, 100 pulses 10 ms wide (or whatever width)? That seems awfully tricky with anything short of a phase locked loop. In any event, I don't see how that achieves my goal...
 

westaust55

Moderator
Maybe if the pulses are too short to capture a pulse stretcher circuit can help.

An RC circuit may be sufficient or there are basic TTL type chips (74HC123 ?) as well capable of this function.

Couple of simpler ideas attached
 

Attachments

Last edited:
Top