223Views5Replies

Author Options:

Is Picaxe capable of recognizing rising edge clock signals? Answered

In other words, is the Picaxe microcontroller (any size) capable of recognizing a change from low to high (pressing a switch for instance) and acting on that change itself, not just the presence of a high?  Or is there at least a way of emulating this type of response in the code?

Thanks!

5 Replies

user
iceng (author)2011-04-12


As one who wrote code to actually branch on a raising edge on a Pic pin.
I can not lie, the answer to your question is a YES !
Both polled or interrupt also YES.

However, sorry to say, the branch when needed Pic instruction code does not really exist :-)

So, I'm curious, what are you contemplating that gives rise to something in this world where most everything is going down hill ?

A

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)2011-04-12

Most microcontrollers will implement Interrupts as either level or edge triggered, the PICs are unlikely not to, PICaxe which is a proprietary system, may or may not implement interrupts in their code though.

You COULD synthesise the function with a polled method like:

Repeat

READ pins.
IF pins <> old pins THEN
we have a change and can work out what and use it.
Oldpins:= pins.

Until false;

Select as Best AnswerUndo Best Answer

user
rickharris (author)steveastrouk2011-04-12

Yes they do support interrupts - you need to get the right family member though so read the manuals and specs, not that difficult as it's aimed at an educational market.

Select as Best AnswerUndo Best Answer

user
Kiteman (author)2011-04-12
user
7654321 (author)2011-04-11

Yeah, basic stamp has a function called pulsin, and picaxe probably has a similar function. It basically waits for either a high or a low (you specify)

Select as Best AnswerUndo Best Answer