# inputing a BCD for a programable timer

Status
Not open for further replies.

#### MrDEB

##### Well-Known Member
looking for a way to input a numeric value and the PIC then times out to that value.
and what is manchester??

#### csaba911

##### Member
Manchester code - Wikipedia, the free encyclopedia
Manchester Encoding

I don't really get the rest of your question.

Csaba

#### MrDEB

##### Well-Known Member
input a numeric value = BCD

which is the amount of time requested.anything from 1 second to 5 seconds but in 1/10th increments.
then when the PIC reaches the inputted time it then causes a port to go high.
a presettable timer
I was just curious about manchester as I am new at this PIC stuff.

#### xpi0t0s

##### Member
Your question is somewhat on the vague side.
How about a keypad? The user could enter a two digit number by pressing two keys, you could debounce and decode that, and on release of the second key you could start counting off time and raise the port high when the time has expired. For example:
Code:
port=0
num=getkey()*10 // assume getkey returns a value from 0-9 when the key is lifted
num+=getkey()
while num
delay(100ms)
num--
end while
port=1

Status
Not open for further replies.

Replies
3
Views
2K
Replies
2
Views
2K
Replies
4
Views
1K
Replies
0
Views
814
Replies
2
Views
2K