This is my first attempt at using a uP. I have a 68HC11E1 on a BOT1 board, settable for either BS or SC-mode. I wrote a small test program (loaded to $B600..) which runs fine in BS-mode under JBug. When I disconnect the SCI and restart in SC-mode it doesn't work. Back under JBug, I find (using the watch window) that reset $FFFE,F reads $E000 and I cannot find any way to re-write it to $B600 (which I think is required to run in SC-mode). I added LDD #$B600, STD $FFEE to my test program, but that didn't work. I still reads $E000. When I try to use "m EEEE" command in JBug, I get an error message "arguement overlap undefined memory". HELP! |
|
HC11E1 - won't run in SC mode?
Started by ●May 11, 2004
Reply by ●May 11, 20042004-05-11
I can now get the program to work fine in BS-mode (having looped the SCI Tx-Rx with a pullup to +). It runs OK on power-up and after resets. It still won't work in SC-mode - I now figure that it never will, because a 68HCE1 has no memory implemented at $FFC0..FFFF!!!! [A 68HCE2, on the other hand will work, because it has EEPROM implemented there] The REAL program I want to run (not this simple test program) uses interrupts, so I will need to write JMP's at the interrupt vector locations (I think that they are 20x3bytes at $00C4..FF?). If someone would be kind enough to confirm that I have figured it out correctly (or put me on the right track) I would very much appreciate it. Regards, jem |
|
Reply by ●May 11, 20042004-05-11
You're right. Had the same problem myself transitioning from 'E2
to 'E1. See below for more comments. --- John <> wrote: > It still won't work in SC-mode - I now figure that it never will, > because a 68HCE1 has no memory implemented at $FFC0..FFFF!!!! Right. To get memory in this space, you need to add an external EPROM. Sorry, not exceptions, unless you always want to run in BS mode, and with the external EPROM, you run in Extended Mode. > The REAL program I want to run (not this simple test program) uses > interrupts, so I will need to write JMP's at the interrupt vector > locations (I think that they are 20x3bytes at $00C4..FF?). In BS mode, the interrupt vectors are starting at $BFC4 or something like that, but they are three bytes (never understood this) Either that, or just put the interrupt vectors in the normal location in your external EPROM ($ffc4+) and run Extended mode. In my opinion, life just got much simpler when I went extended mode and just put everything in the external EPROM. One note, you should check whether the internal EEPROM needs to be disabled by programming the CONFIG register when you're in extended mode. If it isn't disabled, you'll have potential address overlap with your external EPROM, and the internal EEPROM wins in that case. Could cause some strange program behavior. Brian __________________________________ |
|
Reply by ●May 11, 20042004-05-11
--- In , Brian Moerdyk <bmoerdyk2@y...> wrote: > You're right... To get memory in this space, you need to add an external EPROM....unless you always want to run in BS mode... Thanks for responding Brian and confirming my conclusions. Yes, using external memory and expanded-mode with E1s is a solution, but for simple jobs, I would like to stick with the simple BOT1's and E1s (I have 5 of them) so I will have to run in BS-mode. It seems that to do this, I will need to add battery backup to preserve the talker prog in RAM and also write prog in EEPROM to change the bootloader's interupt vector JMPs after I disconnect JBug. I haven't figured out how to do this yet. If it gets too complicated, I'll give up and use external memory. I have 1 68HC11E2 which would also solve the problem, but only for 1 application. Fortunately, I also have a few bigger, more complicated, BOT2 prototype boards which support external memory. I was planning to use these boards with E1s for more ambitious projects requing bigger programs and lots of I/O. Maybe I will use them universaly? You also said... > In BS mode, the interrupt vectors are starting at $BFC4 or something like that, but they are three bytes (never understood this) I think I can help YOU there - extended jump instuctions need 3 bytes Thanks again for your support and quick response. FYI My 1st project is a deisel engine controller/monitor for my yacht (glowplug timer, tacho, engine temp, oil pressure, hydraulic oil temp, alarms, etc). Then I plan on an electronic compass (using a VECTOR compass module) and more ambitiously, a fast (eventualy adaptive) autopilot with yaw accelerometer inputs. Should keep me occupied for a while! Regards, jem |
Reply by ●May 11, 20042004-05-11
You are correct, it won't. Please refer to the MC68HC11 Reference Manual (the White Book), Table 1-1. There you will find that the E1 is a ROM-less device which can't be expected to run at all in the absence of program memory. You can run in expanded mode with an external ROM attached. To run Single Chip mode, you should be looking at an E9 or an E20 device. Forget the E2's, they are obsolete. Best wishes, Bob Smith --- Avoid computer viruses, Practice safe hex --- -- Specializing in small, cost effective embedded control systems -- http://www.smithmachineworks.com/embedprod.html Robert L. (Bob) Smith Smith Machine Works, Inc. 9900 Lumlay Road Richmond, VA 23236 804/745-2608 ----- Original Message ----- From: "John" <> To: <> Sent: Tuesday, May 11, 2004 5:54 AM Subject: [m68HC11] Re: HC11E1 - won't run in SC mode? > I can now get the program to work fine in BS-mode (having looped the > SCI Tx-Rx with a pullup to +). It runs OK on power-up and after > resets. > > It still won't work in SC-mode - I now figure that it never will, > because a 68HCE1 has no memory implemented at $FFC0..FFFF!!!! > > [A 68HCE2, on the other hand will work, because it has EEPROM > implemented there] > > The REAL program I want to run (not this simple test program) uses > interrupts, so I will need to write JMP's at the interrupt vector > locations (I think that they are 20x3bytes at $00C4..FF?). > > If someone would be kind enough to confirm that I have figured it out > correctly (or put me on the right track) I would very much appreciate > it. > > Regards, jem > -- ------ > Yahoo! Groups Links > > a.. To |
Reply by ●May 11, 20042004-05-11
A much simpler (and probably less expensive solution) is to throw away
the E1s and drop in an E9. Both PCBUG11 and Jbug11 program them just fine. Bob --- Avoid computer viruses, Practice safe hex --- -- Specializing in small, cost effective embedded control systems -- http://www.smithmachineworks.com/embedprod.html Robert L. (Bob) Smith Smith Machine Works, Inc. 9900 Lumlay Road Richmond, VA 23236 804/745-2608 ----- Original Message ----- From: "John" <> To: <> Sent: Tuesday, May 11, 2004 11:54 AM Subject: [m68HC11] Re: HC11E1 - won't run in SC mode? > > --- In , Brian Moerdyk <bmoerdyk2@y...> wrote: > > You're right... To get memory in this space, you need to add an > external EPROM....unless you always want to run in BS mode... > > Thanks for responding Brian and confirming my conclusions. > > Yes, using external memory and expanded-mode with E1s is a solution, > but for simple jobs, I would like to stick with the simple BOT1's and > E1s (I have 5 of them) so I will have to run in BS-mode. > > It seems that to do this, I will need to add battery backup to > preserve the talker prog in RAM and also write prog in EEPROM to > change the bootloader's interupt vector JMPs after I disconnect JBug. > I haven't figured out how to do this yet. If it gets too complicated, > I'll give up and use external memory. > > I have 1 68HC11E2 which would also solve the problem, but only for 1 > application. > > Fortunately, I also have a few bigger, more complicated, BOT2 > prototype boards which support external memory. I was planning to use > these boards with E1s for more ambitious projects requing bigger > programs and lots of I/O. Maybe I will use them universaly? > > You also said... > > In BS mode, the interrupt vectors are starting at $BFC4 or > something like that, but they are three bytes (never understood this) > > I think I can help YOU there - extended jump instuctions need 3 bytes > > Thanks again for your support and quick response. > > FYI > My 1st project is a deisel engine controller/monitor for my yacht > (glowplug timer, tacho, engine temp, oil pressure, hydraulic oil > temp, alarms, etc). > Then I plan on an electronic compass (using a VECTOR compass module) > and more ambitiously, a fast (eventualy adaptive) autopilot with yaw > accelerometer inputs. > > Should keep me occupied for a while! > > Regards, jem > > > -- ------ > Yahoo! Groups Links > > a.. To |
|
Reply by ●May 11, 20042004-05-11
On Tue, 2004-05-11 at 12:36 -0400, Bob Smith wrote: > A much simpler (and probably less expensive solution) is to throw away > the > E1s and drop in an E9. Both PCBUG11 and Jbug11 program them just > fine. If you have a windowless E9, then its EPROM can only be programmed once? -- Torgeir Veimo < |
Reply by ●May 11, 20042004-05-11
Any individual bit can only be cleared, not set. As long as one is careful, there can be many programming sessions. But, there are methods where one can have multiple pseudo-interrupt vector tables so only the last table is active and any previous table is cleared. Emmett Redd Ph.D. mailto: Associate Professor (417)836-5221 Department of Physics, Astronomy, and Materials Science Southwest Missouri State University Fax (417)836-6226 901 SOUTH NATIONAL Dept (417)836-5131 SPRINGFIELD, MO 65804 USA > -----Original Message----- > From: Torgeir Veimo [mailto:] > Sent: Tuesday, May 11, 2004 11:48 AM > To: > Subject: Re: [m68HC11] Re: HC11E1 - won't run in SC mode? > > On Tue, 2004-05-11 at 12:36 -0400, Bob Smith wrote: > > A much simpler (and probably less expensive solution) is to throw away > > the > > E1s and drop in an E9. Both PCBUG11 and Jbug11 program them just > > fine. > > If you have a windowless E9, then its EPROM can only be programmed once? > -- > Torgeir Veimo < |
Reply by ●May 11, 20042004-05-11
That is correct, the windowless E9's cannot have the EPROM erased which
is why they are known as OTP devices. The EEPROM (512 bytes) still works normally. Windowed E9 (CFSn suffix) which can be erased are still available, but are quite expensive (about $30.00) although you only need 1-2 of them to test your code with. Oh, btw, the OTP E9s are known as 68HC711E9s, not 68HC11E9s as I think I stated in an earlier post. So OTP E9s can be programmed once, windowed E9s can be programmed many times, and E1s can be programed zero times. Have you considered that if your code will fit in the RAM space of an E1 it will also fit in the EEPROM space of an E9. Best wishes, Bob Smith --- Avoid computer viruses, Practice safe hex --- -- Specializing in small, cost effective embedded control systems -- http://www.smithmachineworks.com/embedprod.html Robert L. (Bob) Smith Smith Machine Works, Inc. 9900 Lumlay Road Richmond, VA 23236 804/745-2608 ----- Original Message ----- From: "Torgeir Veimo" <> To: <> Sent: Tuesday, May 11, 2004 12:47 PM Subject: Re: [m68HC11] Re: HC11E1 - won't run in SC mode? > On Tue, 2004-05-11 at 12:36 -0400, Bob Smith wrote: > > A much simpler (and probably less expensive solution) is to throw away > > the > > E1s and drop in an E9. Both PCBUG11 and Jbug11 program them just > > fine. > > If you have a windowless E9, then its EPROM can only be programmed once? > -- > Torgeir Veimo < > -- ------ > Yahoo! Groups Links > > a.. To |
Reply by ●May 12, 20042004-05-12
WOW! - I'm impressed! - 6 replies with good advice in less than
24hrs! Thanks to all for your interest and quick responses. It seems that the easy solution to running SC-mode on a BOT1 board is to buy some E9s. The disadvantage is the time/cost/difficuly of buying E9s from Australia. Nevertheless, it may be the right "final solution". Working my way up a steep learning curve and information overload - I now know that an E1 in BS-mode (with Tx-Rx looped) will boot-up and re-boot from reset or power-up, jump to $b600 user programe (which doesn't use interrupts)and work OK in a working environment (ie. when not connected to JBug). The bootloader doesn't use RAM or interrupts - so I don't need RAM battery back-up. If I can get all/most of the interrupt facilities to work (primarily timer related ones) with E1s in BS-mode, then that would suit my purposes at zero cost. I don't need SWI, SCI or SPI facilities in my simpler applications. I would appreciate advice on the following asessments of operating E1s in BS-mode with programs that use timer interrupts:- a)It appears to me that the bootloader re-locates interrupt vectors to RAM at $00C4..$0040. So, I could include setup instructions in my user programs to write JMP instructions to these RAM vector locations (the inaccessable BS-mode $BF40 RESET vector is no problem because it results in a JMP to $B600, as required). If this is correct, then the only remaining problem is de-bugging. b) It also appears that JBug uses only the SCI interrupt. The ILLEGAL OPCODE INT jumps to $0000 and all other interupts jump to $0058 which contains an RTI. Since my user interrupt routines will also end in an RTI, I think (not sure?) that JBug will still work OK with my interrupt intensive user programmes running, provided that I don't use RAM below $0100 and don't change the SCI or ILLOPCODE vectors. c)If JBug works OK under these circumstances, I realise that it's processing overhead will affect precise timing - I can live with that. d) Are there any "Gotchas" that I haven't yet identified? Regards, jem |
|