68HC11 PORT B

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

Reply to
john
Loading thread data ...

Try LDAA #$0ff

Reply to
James Beck

"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.

Reply to
karel

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

Reply to
James Beck

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

Reply to
James

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.