PRM file

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

PRM file

3,685 Views
mizer101
Contributor I
I am new to Code Warrior.  I had a couple of semesters with the 68HC11 in college (used the MGTEK MiniIDE).
 
Now I have taken over a project at work that includes an MC68HC908QY4.
 
I am trying set the TIM interrupt vectors.  I figured out that it needs to be done in the prm file.  One of the example programs has this file included with it.  But it does not have the processor.h with all the memory declarations or I would just use that one to start my project.  In my project I need to include the prm or be able to create/add the processor file.
When I try to add or create the prm file CW gives an error on compile and says the project has been modified by an outside source and reloads the project without including my new file.  What am I doing or not doing?  Please help.  Also anyone recommend a good book, I would be up for that too, as I would rather figure out my problems myself.  Headed to Barnes & Noble tonight.
 
 
Thanks,
 
Steve
Labels (1)
0 Kudos
6 Replies

628 Views
baddad
Contributor I
Why not use Processor Expert?
 
It will generate the ISR code for you.  All you have to do is add some "do this code" in the ISR created.  You also won't have to worry about the PRM file changes.
 
BadDad
0 Kudos

628 Views
Geezer
Contributor I
Declare your ISR in this manner

void interrupt 8 TIM1_OVF_ISR(void){} // the number is the position in the vector table

and it will be independent of the PRM file.

The 'official' way is to diddle with the PRM file, but this has side effects. For example changing targets... and your hand-modified PRM gets blown away. By the way I haven't had trouble EDITING the PRM ile that CW generates. ADDING or CREATING is a different beast, haven't tried it.
0 Kudos

628 Views
mizer101
Contributor I
Thanks Geezer.
 
Not sure about the C code as I do not know how to do C.
 
Using what you talked about, and a decent nights sleep I was able to figure out what I was doing wrong.  The example program called the prm file "default.prm" and I was trying to import it.  My program calls it "project.prm"
Opened the project.prm and there was a declared vector.  Put my vectors below it.  Compliled - Downloaded and looked at the vector memory address and there was my vectors.:smileyhappy:
 
I did find that the vectors are not declared as they are listed in the data sheet.
TIM Channel 0 is Vector 4 not 3 as the data sheet states.
 
The best I figure to get my code to auto start on power up, I will put my code at vector 0.  Is this correct?
 
Thanks,
 
Steve
0 Kudos

628 Views
Geezer
Contributor I
For your chip there is no vector 3, it is reserved (unused), so indeed your reference appears to have an error.

Good luck, you are ready to move on to a grander class of frustrations, mysteries, and errors!


INT_ADC: equ $0000FFDE
INT_KBI: equ $0000FFE0
Reserved2: equ $0000FFE2
Reserved3: equ $0000FFE4
Reserved4: equ $0000FFE6
Reserved5: equ $0000FFE8
Reserved6: equ $0000FFEA
Reserved7: equ $0000FFEC
Reserved8: equ $0000FFEE
Reserved9: equ $0000FFF0
INT_TIMOvr: equ $0000FFF2
INT_TIMCH1: equ $0000FFF4
INT_TIMCH0: equ $0000FFF6 ; VECTOR 4
Reserved13: equ $0000FFF8
INT_IRQ: equ $0000FFFA
INT_SWI: equ $0000FFFC
INT_RESET: equ $0000FFFE ; VECTOR 0
0 Kudos

628 Views
joerg
Contributor II

Dear minzer101
you do not have to declare all the int stuff in the prm file.
A easy way is to use absolute assembly, where no sections etc. Have to be declared.
If you are interested in a simple OS look at my EBS08. A sample environment
(also ready for the Qx family) can be found at www.systech-gmbh.ch -> EBS08.
Simply download the project files (zipped) and try it with the CW simulator.
In the xxx-vec.mmw (mmw Module for Metro Werks) you can see all the definitions of the
interrupt vectors (only the start vector is defined in the prm file).

Saluti Joerg

0 Kudos

628 Views
Geezer
Contributor I
"The best I figure to get my code to auto start on power up, I will put my code at vector 0. Is this correct?"

Not really, VECTOR 0 must contain the ADDRESS of your starting code, not THE code itself.

Your project.prm has a line similar to:
VECTOR 0 _Startup

Fine, make it happy and give it this in your .ASM:

;********************
XDEF _Startup

_Startup

;do your thing....
BRN * ;

;********************
0 Kudos