Technical discussions about Freescale Microcontrollers: M68HC11. (Freescale Semiconductor is a Subsidiary of Motorola).
port blinking program - babitha ms - Oct 12 1:58:00 2005
I am a bignner , to write a port blinking program which port i'll use and tell me
which registers i use for this program?
---------------------------------
Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
[Non-text portions of this message have been removed]
______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!
(You need to be a member of hc11 -- send a blank email to hc11-subscribe@yahoogroups.com )
Re: port blinking program - Mike McCarty - Oct 12 2:24:00 2005
babitha ms wrote:
> I am a bignner , to write a port blinking program which port i'll use and tell me
which registers i use for this program?
I suggest hitting RETURN from time to time, like about every
70 characters or so.
If this is homework, then be assured: Your professor is reading
every word.
The question, as asked, has no answer. However, there are considerations
in making the decisions on which port to use. As for what registers,
well, that depends on what port you chose ;-)
Considerations:
PORTA has complex considerations for using it as an output port.
(Complex interactions with the timer subsystem, and non-obvious
ways to select which bits go which way, some bits fixed in
direction, etc.)
If you use PORTB or PORTC, then you cannot use expanded mode.
PORTD shares the SCI and SPI, so that is a consideration.
PORTE is input only, so out of consideration for this.
PORTF and PORTG are not available on some/most machines.
If you never ever want to run expanded mode, then I
suggest PORTB. But if you think you ever will want to
use expanded mode, you'll have to pull the hardware
back off of PORTB.
PORTC has the same considerations as PORTB with respect
to expanded mode, and takes more setup, so I advise
against using it. If you could use PORTC, then you could
also use PORTB, and it's a better choice, IMO. PORTC is
also somewhat confusing to beginners, due to having two
copies of it for input, one latched one not latched.
If you might ever want to run in an expanded mode, I suggest PORTD,
unless you must use both the SCI and the SPI.
Last choice is PORTA. (But it's better than PORTC unless
PORTB is already fully used.)
I don't use chips which have PORTF and PORTG on them, so I
really can't advise on their use, either pro or con.
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 )