EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

68HC11 PORT B

Started by john January 24, 2006
This is top posting.

In article <1138127807.972537.169750@o13g2000cwo.googlegroups.com>, 
conphiloso@hotmail.com says...
> Hi, > > I do not know how not to top post. please advice. I tried both syntaxs > the result is same. >
This is where you should respond. If you need to snip old junk to keep the post manageable that's fine. Anyway, I'm sure your little code snippet is not the entire file you are assembling, or is it? You should have reset vectors defined and the like. Your complete file should be a little more in depth. For example, this assembly routine to alter the CONFIG register : ; THE 'HC11 MUST BE IN ONE OF THE SPECIAL MODES TO PROG. CONFIG ; CHANGES WON'T TAKE UNTIL RESET ; ASSUMES AN HC11Ax WITH AN 8MHZ OSC (2MHZ ECLOCK) ORG $A000 EX31A LDS #$00FF ;set stack ptr LDAA #$00 ;turn off EEPROM protect STAA $1035 ;write it LDAA #$00 ;preset porta STAA $1000 ;write it LDAA #$0F ;set porta STAA $1001 ;write to ddr BSR DLY10 ;delay 10 ms LDAA #$0A ;get desired config value (change if needed) ; 0a = COP,NOEEPROM CMPA $103F ;compare it to the actual value BEQ NOWOK ;if it is OK goto nowok ;else do this LDAB #$16 STAB $103B ;SETUP PPROG REGISTER FOR BYTE ERASE STAA $103F ;DO ANY WRITE TO THE REGISTER INCB STAB $103B ;TURN ON THE PROG VOLTAGE BSR DLY10 ;DELAY 10MS CLR $103B ; TURN OFF THE PROG VOLTAGE LDAB #$02 STAB $103B ;SETUP TO WRITE THE DATA STAA $103F ; NOW WRITE THE ACTUAL DATA INCB STAB $103B ; TURN ON THE PROG VOLTAGE BSR DLY10 ; WAIT AGAIN CLR $103B ; TURN OFF EVERYTHING PROGED LDAA #$08 ; FLIP A PORT BIT STAA $1000 ; I USE THIS BIT TO TOGGLE AN LED BRA PROGED ; WAIT FOR RESET NOWOK LDAA #$04 ;IF CONFIG VALUE OK FLIP DIFFERENT BIT STAA $1000 BRA NOWOK ; WAIT FOREVER DLY10 PSHX ; HARD CODED 10MS DELAY BASED ON ABOVE ASSUMPTIONS LDX #$1A0C DLOOP DEX BNE DLOOP PULX RTS ORG $BFFE RESET FDB $A000
john wrote:
> 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
A couple of questions: Which 68HC11 variant are you using? Are you using it in single chip or expanded mode? The only HC11 docs I have, show port B as an output only port and don't show any way to disable the output transistors. Is your port truly floating or is it just not responding to the input register? The docs I have are for an A8, E2 or E9 part. If the port really is floating and the part is powered up and grounded properly, it is possible that the port is cooked. If you are using the HC11 in normal, single chip mode, the MODB pin should be tied to +5v through a resistor and the MODA pin tied to ground. If the MODA pin is not grounded, the data register cannot be written by the data bus, it's stuck as the high order address bus. If you are using an expanded mode with the port replacement chip, I would suspect that the port replacement chip is not set up right or is cooked. Good Luck, Bob
john wrote:
> > I do not know how not to top post. please advice. I tried both > syntaxs the result is same.
The following will explain it: http://www.caliburn.nl/topposting.html http://www.netmeister.org/news/learn2quote.html http://www.catb.org/~esr/faqs/smart-questions.html http://www.greenend.org.uk/rjk/2000/06/14/quoting.html http://www.i-hate-computers.demon.co.uk/ http://web.ukonline.co.uk/g.mccaughan/g/remarks/uquote.html Also, include adequate context in your messages, even if using googles broken usenet interface. All articles should stand by themselves. See instructions and reference in my sig below. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson More details at: <http://cfaj.freeshell.org/google/>
"MetalHead" <WanderingMetalHead@DUMPSPAM.yahoo.com> wrote in message
news:huzBf.1711$wk5.999@news02.roc.ny...
> john wrote: > > 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 > > A couple of questions: > Which 68HC11 variant are you using? > Are you using it in single chip or expanded mode? > > The only HC11 docs I have, show port B as an output only port and don't > show any way to disable the output transistors. up right or is cooked. > > Good Luck, > Bob
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

The 2024 Embedded Online Conference