Technical discussions about Freescale Microcontrollers: M68HC11. (Freescale Semiconductor is a Subsidiary of Motorola).
Help please - Rafael Alberto Machado - Oct 21 22:24:00 2005
Hello Guys.
I need to do a program using a button and two LED do the following:
When I press the button the LED's turns on but not at the same time should
be with a 3 sec difference (blink). Can you guys help me to how to get this
done.
Thanks a lot
Rafael
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

(You need to be a member of hc11 -- send a blank email to hc11-subscribe@yahoogroups.com )
Re: Help please - BobG...@... - Oct 22 0:38:00 2005
In a message dated 10/21/2005 10:26:25 P.M. Eastern Standard Time,
rafaelmachado32@rafa... writes:
I need to do a program using a button
====================================
Do I get to pick the language or does the professor?
[Non-text portions of this message have been removed]

(You need to be a member of hc11 -- send a blank email to hc11-subscribe@yahoogroups.com )
RE: Help please - Nick Reitter - Oct 22 9:19:00 2005
Rafael,
The 1st step is to define the scenario. (You have this done.)
The 2nd step is to develop a flow chart
The next step is to write the code
Then determine the hardware interface
Then verify the hardware interface using the Buffalo monitor
Then verify your code, one portion at a time per your flow chart
Then ........
I've been "there". These steps will help you achieve an operable program in
the quickest time.
Nick
-----Original Message-----
From: m68HC11@m68H... [mailto:m68HC11@m68H...]On Behalf
Of Rafael Alberto Machado
Sent: Friday, October 21, 2005 10:25 PM
To: m68HC11@m68H...
Subject: [m68HC11] Help please
Hello Guys.
I need to do a program using a button and two LED do the following:
When I press the button the LED's turns on but not at the same time should
be with a 3 sec difference (blink). Can you guys help me to how to get this
done.
Thanks a lot
Rafael
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Yahoo! Groups Links

(You need to be a member of hc11 -- send a blank email to hc11-subscribe@yahoogroups.com )
Re: Help please - Paul B. Webster VK2BZC - Oct 22 10:02:00 2005
OK, I'll jump in at the deep end - just for fun!
On Sat, 2005-10-22 at 02:24 +0000, Rafael Alberto Machado wrote:
> I need to do a program using a button and two LED do the following:
> When I press the button the LED's turns on but not at the same time should
> be with a 3 sec difference (blink). Can you guys help me to how to get this
> done.
Firstly, you'll need to specify what has to happen. So far you
haven't really explained this - you've mentioned a three second
difference, but not how that happens in exact steps. Care to try and
explain that again? Or the lazy way - point us to the assignment
posting?
Next, something called *context* - is this the *only* thing you are
getting the processor to do, or might it need to do something else as
well? This greatly affects the design of the program (and the choice of
processor - a 12F508 would be far more appropriate to the task you cite,
if that's all you need it to do).
In broad terms, the more general way of doing this - with a view to
accuracy and doing other things as well - is to write a timer interrupt
routine which counts timer "ticks" into milliseconds and thence seconds,
allowing you to use the milliseconds to debounce your button, and the
seconds to implement your time delay.
--
Cheers,
Paul B.

(You need to be a member of hc11 -- send a blank email to hc11-subscribe@yahoogroups.com )
Re: Help please - Mike McCarty - Oct 24 13:44:00 2005
Rafael Alberto Machado wrote:
> Hello Guys.
> I need to do a program using a button and two LED do the following:
> When I press the button the LED's turns on but not at the same time should
> be with a 3 sec difference (blink). Can you guys help me to how to get this
> done.
> Thanks a lot
> Rafael
I have several pieces of advice for you. The first one is not
to ask any questions here that you don't want your professor
to see, as he is certainly monitoring this echo. The second one
is to write some requirements. Requirements must be (1) correct,
(2) complete, (3) unambiguous, and (4) testable. Without requirements
you can't proceed to design. So you need to write something
like this...
The hardware shall be
(1) Processor type
(2) Clock speed
(3) Execution mode
(4) Switch connected to port pin...
(5) Input port pin is (high/low) when button pressed
(6) LED connected to port pin...
(7) LED lights when pin is (high/low)
(8) BUFFALO (or other monitor...)
(9) ...
When (event 1) takes place the following shall be done:
(1) (action one)
(2) (describe delay +/- tolerance)
(3) (action two)
(4) (describe delay +/- tolerance)
...
When (event 2) takes place the following shall be done:
...
The first event is probably power up RESET.
You don't need a formal document, just a precisely clear and
well-understood description of what, exactly, you are trying
to do.
I forget who said it, but "Without a well defined goal in mind,
attempts to make progress are in vain." (or words to that effect).
Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!

(You need to be a member of hc11 -- send a blank email to hc11-subscribe@yahoogroups.com )