Reuse driver (CAN, Flash, Watchdog) from S12G128 for S12ZVMC256 ?

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

Reuse driver (CAN, Flash, Watchdog) from S12G128 for S12ZVMC256 ?

662 Views
huuhuynhchi
Contributor III

Dear everybody,

From the last project, I had the drivers of S12G128 consist of CAN, Flash, EEPROM, Watchdog driver. But I don't know that those driver can be reused on other S12 platform or not ? because I would like to reuse on S12ZVMC256.

Thank you very much and have a nice day !

Labels (1)
3 Replies

400 Views
RadekS
NXP Employee
NXP Employee

Hi Huu,

S12G and S12ZVMC256 uses different core, therefore assembler code cannot be used directly.

However I suppose that that your drivers are written in C language. Correct?

Of course, reset and interrupt vector tables are different.

Since S12Z use linear address space you don’t need to care about keeping interrupt routines in non banked flash.

CAN module should be the same – I am not aware about any significant changes except additional CAN PHY and appropriate routing options. So, you should be able reuse S12G CAN driver without any significant effort (compilers are different, therefore some cosmetic changes in code may be necessary).

COP Watchdog works the same way with except of missing special COP reset vector at S12ZVMC256. S12Z use just one reset vector and COP reset causes set of CPMURFLG_COPRF flag.

Note: The clock monitor reset is handled similar way.

Note: access to illegal address will not cause directly Illegal address reset at S12ZVMC256 but it invokes machine exception (this in not interrupt routine).

The Flash and EEPROM are very similar with exception of

1.    different sizes of P-Flash and EEPROM

2.    different memory map (S12ZVMC256 have linear address space).

3.    vectors have 4 bytes instead 2 therefore Flash Configuration Field starts at 0xFFFE00 instead 0xFF00

4.    slightly different register map

5.    different functionality of FCCOBIX. FCCOBIX at S12ZVMC256 do not multiplex access to FCCOB registers, but it just contains number of used FCCOB registers – they are not multiplexed.

6.    Since, S12ZVM bus clock could be set up to 50MHz, wait-states are enabled by default (could be disabled for lower bus clock values).

7.    Protection Override feature at S12ZVMC256.

8.    …

Simple example codes for S12Z Flash and EEPROM are in attachment.


I hope it helps you.

Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

400 Views
huuhuynhchi
Contributor III

Dear RadekS,

Thank you so much for your answer !

It's really useful for me now.

Besides that, I also have a one more question related to driver. If I'm having driver but I don't have Hardware, How can I test the functionality of driver without HW ? Or is there any tool can support simulation for this ?

0 Kudos

400 Views
RadekS
NXP Employee
NXP Employee

Hi Huu,

Unfortunately, I am afraid that CW10.6 do not support Full Chip Simulation mode for the S12Z core.

You could use already available derivatives like S12ZVML128 or S12ZVMC128 and test your algorithms on such target until S12ZVMC256 will be available.

The Cosmic tools for S12Z contain simulator, however personally I don’t have experience with that.

http://www.cosmic-software.com/s12z_des.php


I hope it helps you.

Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------