PDA

View Full Version : 68HC11 B600 autostart vector help please


J. Davis
11-20-01, 08:46 PM
I am running NMI buffalo on a 68HC11 in expanded mode with a PRU. Forth disabled, 8K ram 0000 ^, 8K batt Ram at C000^ and buffalo at E000 to FFFF.

I have installed the pull down resistor on PE0 and buffalo works well now:) .

Next question I would like to use the autostart vector that PE0 controls at B600. I have inserted 7E C0 00 starting at B600 for a JMP $C000 to my main code that sits at C000. On power up with PE0 high the system freaks outs, and most of the time erases the code at B600 and never executes the code at C000. Any hints for using this?


Thanks again for answering stupid questions

Jeff

nmitech
11-26-01, 09:55 AM
Buffalo will skip all the register initializations when it senses PE0 high. Whenever you autostart your program from the buffallo monitor you must do all the register initializations first, especially all the registers that can only write once in the 1st 64 clock cycles such as INIT, OPTION, BPROT registers etc.. then STACK and other registers such as SCI registers, you must enable the TX/RX bit and setup BAUD registers, etc... if your program use SCI for communication.

huffman
11-26-01, 12:40 PM
I've had the same problem before. I put a delay at B600 and set some of the unused interrupt
vectors to ensure I don't have interrupts trashing my code. I think the key is the delay loop to allow
the components to get up to voltage before starting your code. NMI warns that you need this with
some of the older battery backed RAM chips, but I've found I also need it with other chips as well.

Below is the assembler code. I type it in by hand (asm 400) starting at address 400. Do a bulk erase
of the eeprom and then a memory move (mm 400 437 b600). The offsets listed in the code automatically
adjust for the new addresses. The last line is the jump command for the starting address of your code.

Good luck.

ldd #0047
std 20
lds 20
clra
deca
psha
clra
deca
bne 40b
pula
bne 408
ldaa #7e
staa f4
ldd #e000
std f5
ldaa #7e
staa f7
ldd #e000
std f8
ldaa #7e
staa fa
ldd #e000
std fb
ldaa #7e
staa fd
ldd #e000
std fe
jmp 3000

J. Davis
11-27-01, 06:20 PM
Thanks Huffman and NMI, the delay code did the trick.
This application was fairly base, so alot of the defaults for the registers worked just fine.

Again thanks,

Jeff Davis