Switch from CASM08Z to CodeWarrior

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

Switch from CASM08Z to CodeWarrior

6,994 Views
sctang
Contributor I
I am switching from CASM08Z to CodeWarrior. I made assembly programs using P&E WINIDE (CASM08Z, PROG08SZ) before. It generates S19 file and I use the PROG08SZ to program to HC908GT8 through P&E Cyclone Pro.
Now, I want to use the CodeWarrior (the user interface seems nicer) to program the MCU. But I cannot find how to generate S19 file and how to program the MCU.
Is there anyone who can give me a hint how to get start as I spent a few days on that?
Thanks
Labels (1)
Tags (1)
0 Kudos
6 Replies

632 Views
sctang
Contributor I
Thanks Mac,
It took me a while to switch from CASM08Z to CW , which I feel more versatile though the file structure is more complicated.

Your advice shows very helpful for my switch to CW. I am still using the P&E Prog08sz to program the MCU, and try to find out if the CW can program the target directly. If you, or anyone, know how to program the MCU with CW, please advise. Thanks.
0 Kudos

632 Views
bigmac
Specialist III
Hello sctang,
 
Assuming you wish to stay with absolute assembly for the converted P & E CASM08 assembly files, and also maintain a very simple project directory structure,  it is possible to run the CW assembler and debugger/simulator programs independently of the CW IDE, and the more complex project structure.  Please refer to the previous thread, where some of these issues are discussed:
 
 
You will generally also need to alter your existing .ASM files so that they will assemble under CW - I will attempt to list some of the differences:
  • Use dc.b in lieu of db, and dc.w in lieu of dw pseudo-ops.
  • Many of the listing directives are different.
  • Conditional assembly directives are quite different, but are more powerful.
  • Macro definitions have a different format.
  • Left-shift and right-shift operands now use a double symbol rather than single symbol, i.e. >> and <<.
  • For instructions like  " bra * " only the asterisk symbol may be used - the optional $ symbol is not available for CW assembler.
  • And most importantly, all instances of curly braces { } will need to change to parenthesis ( ).  This has created the most hassles for me because it is difficult to pick the difference with some font types.

This should help reduce some of the assembly errors.  You could still use PROG08 to program the device.  The S19 file directly generated by CW assembler has an extra line right at the beginning of the file (contains file path data) - not sure if you would need to delete this for compatibility with PROG08.

Regards,
Mac

 

Message Edited by bigmac on 03-29-200605:15 PM

0 Kudos

632 Views
peg
Senior Contributor IV

Hi Mac,

You have obviously been through all the pain of conversion and setup etc.

I am quite interested in doing the same. (maybe with a little less pain)

But my main question is:

What are the benefits of doing command line absolute assembly in CW over P&E's stuff?

I like the idea of "more powerful conditional assembly directives" as P&E are very restrictive and the limitations only discovered through trial and error.

But is there anything else?

BTW I am very put off by using the full blown CW in assembler mode, its all just too complicated and abstruse.

BR Peg

 

0 Kudos

632 Views
bigmac
Specialist III

Hello Peg,

Sorry for the delay in responding.  This is my second attempt - I lost the first when my log-in to the forum timed out.


peg wrote:

But my main question is:
What are the benefits of doing command line absolute assembly in CW over P&E's stuff?
I like the idea of "more powerful conditional assembly directives" as P&E are very restrictive and the limitations only discovered through trial and error.
But is there anything else?

BTW I am very put off by using the full blown CW in assembler mode, its all just too complicated and abstruse.


I guess I am probably in the position where existing HC08 projects will remain in CASM08 format, but new projects will be done in CW format, whether in assembler or C.  I seem to recall it was you who once said that, adding an 'S' to the part made the P&E solution expensive.

I recently converted a couple of my simpler past CASM08 projects to CW format, as a method of learning CW assembler - so far I have not used C for an embedded project (this is another learning curve).  Another reason for becoming familiar CW assembler and C, is because it now seems to be the "lingua franca" in forums (perhaps the word should be fora) such as this.

The CASM08 conditional assembly directives I previously found very limiting, with nested conditional assembly, problematic.  On the other hand, the CW assembler seems to behave predictably, with capability not unlike that of the C pre-processor (perhaps expected).  As a simple example, I now have a file "default.inc" used for the automatic inclusion of a default interrupt handler, for all vectors not previously defined within the code.  I could never achieve this with CASM08.

Another capapably, unavailable with CASM08, is the handling of simple structures within assembly code.  Sub-routines may not be referenced within the structure, but there are other ways around this.

On the down side, I also find the complexity of the CW project structure rather daunting - compared with my very simple structure for CASM08 projects, with all files required for a project in a single directory.  For an assembly project I would typically have the main ASM file plus perhaps two or three INCLUDE files.  So the use of the CW tools as separate entities is more in keeping with the process I am used to - absolue assembly by default, a simple directory structure, and no .PRM file to worry about.  At the moment, I see no particuar reason to move away from absolute assembly.

For future projects written in C, I will obviously need to use the full-blown CW project structure.  However, so far the HC08 devices I have used are the QY2 and  QY4, hardly canditates for C programming, when RAM and flash resources are tight.  For new projects I am currently working on, I would like to use the QB8 (but am still having difficulty in getting hold of the silicon) - I am still tossing up whether to use assembler or C, but am leaning towards assembler because at least I know the code will fit (some of these are upgrades of old HC05 projects).

Regards,
Mac

0 Kudos

632 Views
peg
Senior Contributor IV

Hi Mac,

Thanks very much for your comments!

This is my second attempt - I lost the first when my log-in to the forum timed out.

Yeah this puts a smile on your face doesn't it?

I seem to recall it was you who once said that, adding an 'S' to the part made the P&E solution expensive.

Yep that was me, I have spent the money though. FYI the S stuff you pay for is basically exactly the same as the free stuff except it handles the S bits. This is good because you seamlessly move between the two, but you seem to pay a lot for just a little bit extra.

I fully concur with what you have said and may now look into using CW like this for its better conditional assembly.

BTW, have you noticed the problem with the QT/QY simulator I have posted about here? I am getting no comment from P&E on it.

BR Peg

0 Kudos

632 Views
peg
Senior Contributor IV
Hello Mac,
 
Nudge, nudge
 
Thanks, Peg
0 Kudos