external clock

Hello

I m a novice in arduino world...
I work on a simple chaser with led to learn and to make in the future a cv gate sequencer.
My question is : is it possible to have an external pulse clock for the timing of the on/off led chaser ?
Thanks

Fabien

Yes

Cool

I wasn t lucky to look for a solution on google.
I have make a ne 555 circuit clock but I don t know how to link it to the arduino and type a right code and ... mostly understand it !

zenaudio:
I wasn t lucky to look for a solution on google.
I have make a ne 555 circuit clock but I don t know how to link it to the arduino

There is a reason you could not find it on Google! It sounds like: "can I use a horse to pull my car?" Yes, it would work, kind-of, but you would only do that if your car was broken! :wink:

The arduino can do what you want, better and more easilly by itself, without a 555. Use the 555 for some other project, a project too simple for an arduino. It is a useful chip, but it would be wasted like that. Don't waste an arduino pin connecting it to a 555.

What is a "cv gate sequencer"? Something musical? Many people love building "old skool" synthesisers and sequencers, but they often prefer to use 555 timers and discrete logic chips instead of microprocessors like Arduino. What about using your 555 timer to drive a 4017 decade counter?

no I talk about the ne555 to simulate an external clock just for learning how to inject a pulse signal clock into the ardinuo and replace his internal clock .The final project is to integrate a clock from exterior .Yes a cv gate sequencer is a vintage electric synth modul.
I work on a chaser because it s a basic sequencer.
And the 4017 is a good idea but i want to a lot of future option like sensitive swith and the arduino have a a lot of possibility

Ok, then I suspect any frequency produced by a 555 will be too slow to use as an external clock for an arduino. Normally arduino clock is between 1MHz and 16MHz. This is because an arduino clock is used to control execution of machine instructions. I think what you mean to suggest is to use an external signal to synchronise the arduino's outputs with some external circuit, signals 1000 times slower than the Arduino's clock. This is possible, but not neccessary. The arduino can react to external changes much faster than a human can perceive, making an external clock redundant.

hum i m not talking on the processor frequency but on the sequence time evenement in a code like an on /off of led instead of a value time of internal delay .

But you still have not explained any reason why you would wish to use an external clock! :roll_eyes: It makes no sense at all.

hello
to synchronise with a music software... maybe a midi sync with the midi library is the best solution.i haven t think about this before.But understand a sync with an external pulse signal is good to learn : )

I think you are using the wrong words. In the computing world “the clock” means the oscillator that controls the processor. What you are calling a clock is a sync pulse that can simply be connected to an Arduino pin if it is a pulse between 0 and 5V, and then the code can do the synchronisation.

in music world it s call midi clock or din sync yes .I was on this forum to have a little help on what function to write on a code to put me on the right way .instead of the delay function.

I was on this forum to have a little help on what function to write on a code to put me on the right way

You simply trigger the next step when you see a sync signal or get a sync message. Or if they come too fast then trigger the next step after you get N sync pulses or messages.

Suppose you set up a Boolean variable called noSync and have a negative going sync pulse coming in on a pin called syncPin, then this is the sort of code you need to use.

while(noSync) { // Waite for sync pulse to go low
    noSync = digitalRead (syncPin);
}
// now do next step or what ever
while(!noSync){ // Wait for sync to go high again
noSync = digitalRead(syncPin); 
}

Thanks a lot I will work with this debut : ) i will post my final work if someone need it
16 step sequencer with a note potentiometer for each step .button on/off on each step .an option go to step one on the other steps. sync external or internal .swith to back or normal sequence .mutiple cv nd gate out.a led on each step ... and maybe a few other thing

The point here is that you have to determine exactly what you wish to synchronise with what. :grinning:

Merely having a pulse generator - such as a NE555 - is of no value as we have been enthusiastic to point out. The Arduino can do that in a far more useful manner than the NE555; it can generate pulses (with considerable accuracy) and programattically adjust them to varying specifications.

If your thought was to have (what is in fact, a metronome) the pulse generator provide synchronising pulses to both the Arduino and the music system, then the correct way to do this is to program the Arduino to generate the pulses as it performs its part, and output those same pulses to the audio system.

If on the other hand, it is the audio system which actually provides such synchronisation signals, then they can be interfaced acordingly (an optocoupler would be appropriate, as in the conventional MIDI interface) to the Arduino which as Mike explains, as part of the many functions which continuously cycle in the loop, checks this input to enable the appropriate response.

However it happens, there is no need for a timebase as a third component. :sunglasses: