68HC11 PORT B

Jan 24, 2006 4 Replies

Hi,



I am having problems with the port B. Its an output port and I am writing the whole port. My code is as follows



ORG 2000 LDAA $# FF STAA $1004



Now, if I write 00 hex or FF to theport. The port is always floating. I tried pull ups and pull downs but no difference. Please advice. Thanks



Regards John



Try LDAA #$0ff

"James Beck" schreef in bericht news: snipped-for-privacy@news.west.earthlink.net...

That's one step forward. (did your assembler not splutter at the $#FF?)

More important yet: at power up, all ports are configured as inputs. So before they can serve as outputs, you must tell them to become outputs. Do this by writing 1 to the relative bits in the corresponding data direction register. On an 6812 it is called DDRB, suppose it's the same on 6811. Since you want ALL bits to be outputs, write #$FF to the DDRB.

No DDRB, it is an output only. At least on all of the variants I have on hand.

Hi John,

I have to agree with Bob, we need to know what variation of the HC11 you are using and the mode it's operating in.

Also are you sure you really want your program to start at 2000 decimal (Or

7Dh). All the memory maps I've checked don't appear to have anything useable for a programmer at this location.

Hope this helps, James

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required