MC68HC908QB8 problems

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC68HC908QB8 problems

2,937 Views
irob
Contributor V
When you want something to work in a timely fashion, it usually won't. Isn't that one of Murphy's Laws? :smileyhappy:

So I'm working on a MC68HC908QT4 project that uses the internal EEPROM routines and ran into a very strange bug. That drove me back to my DEMO QB8 board to try to debug it.

Problem #1

Well that in turn revealed a totally different bug. I'm unable to change the RAM on this known working demo board at the addresses: $EE-F4. I can't tell if this is because my program is locking up those addresses somehow (not even sure if that's possible), or what. The datasheet claims that $80-FF should be RAM. Beyond $F4 can be edited in the debugger.

Problem #2

Both CodeWarrior 3.1 and 5.0 are compiling the following lines of C bizarrely.

Code:
if (variable1 == CONSTANT1)
Compiled:
c60000 LDA variable1

Code:
if (variable2 == CONSTANT2)
Compiled:
c60000 LDA variable2


See the problem? Both are compiling as a LDA from memory address $0000. That's the PTA control register! How can both variable1 and variable2 be in the same spot? More importantly, they're not in the PTA! I'm confused.

One clarification: both variable1 and 2 are defined as enums. But that shouldn't be a problem, right?

Message Edited by irob on 06-05-2006 10:28 PM

Labels (1)
0 Kudos
Reply
3 Replies

793 Views
tonyp
Senior Contributor II

Problem 1 guess: The debugger is using some RAM locations for its own needs, so it keeps overwriting them.

Problem 2 guess:  The code you see is pre-linker.  The linker will fill the 0000 portion of the various instructions with the actual address.

0 Kudos
Reply

793 Views
irob
Contributor V
Ahh, thanks Tony. I didn't realize that about the linker step. Is there a file with the final dis-assembly so I can see where that memory is being read from? I guess I can find that in the debugger too.
0 Kudos
Reply

793 Views
CrasyCat
Specialist III

Hello

Two solution to see actual code from the application:

  1- After you download the code in the debugger (either simulator or target board), you should be able to see the assembly code of the application in the Assembly component.

2- If you wish to see a disassembly listing from the current executable file:

  - Add the .abs file to the project
  - Click with the right mouse button on the newly added .abs file and select "Disassemble" in the pop up menu. You will get a new window with the actual disassembly of the executable file.

Be careful, you will need to remove the .abs from the project afterward, otherwise you will not be able to link the application any more.

I hope this helps.  

CrasyCat

0 Kudos
Reply