mc912dg128ccpv  developing /compiling envirement?

cancel
Showing results for 
Search instead for 
Did you mean: 

mc912dg128ccpv  developing /compiling envirement?

Jump to solution
248 Views
Contributor II

Hello,we are programing a  mcu (MC912DG128CCPV) to accomplish our requirement.

Because this mcu is out of date, we can obtain only a few materials,  we can not definite which developing/compiling envirement  we need to use is accurate.

Someone suppose that we should use CODE WARRIOR V5.1,including some freescale FAE .But we can see  that CODE WARRIOR V5.1 is using to programme for MC912DG128A mcu on the freescale official website,and MC912DG128C mcu should be programing in COSMIC /ZAP BDM HCS12(paged).

So,we want to definite which developing/compiling envirement  is accurate.

Additionally,we need to using this chip on normal expended norrow mode,and programing to write/read a dual-port RAM.so we need a free example code,no matter that is programing in C.W. or COSMIC.   Thank you very much.

您好,我们最近在使用一款飞思卡尔芯片,MC912DG128CCPV,我们需要编写这个芯片的程序以完成需要的功能。但是由于芯片比较老旧,我们不清楚这种芯片的开发编译环境,有人认为是CODE warrior5.1,包括一些飞思卡尔技术支持工程师,但是从官网上看mc912dg128A系列新品应该是使用code warrior 5.1,而mc912dg128c系列芯片应该使用COSMIC4.8.6/ZAP BDM HCS12paged)。所以我们希望能确定到底应该使用哪个环境,因为在CW5.0环境开发这个程序的时候时钟配置会出现程序跑飞的情况。另外我们需要设置这种这种新品进入外部扩展模式,以完成外部双口RAM的读写,我们希望得到这种芯片,或者这类芯片的例子程序,无论COSMICCW环境下的都可以

Labels (1)
0 Kudos
1 Solution
1 View
NXP Employee
NXP Employee

Hi,

You can use any of the two (or both) IDEs.

The datasheet says:

http://cache.freescale.com/files/microcontrollers/doc/data_sheet/MC912DT128A.pdf

     "The MC68HC912DG128C and MC68HC912DG128P are devices similar to the MC68HC912DG128A, but with different oscillator configurations.

     Sections of this book applicable to the MC68HC912DG128A also apply to the MC68HC912DG128C and MC68HC912DG128P, except for the

     differences highlighted in Section 13. Oscillator."

The difference between DG128A and DG128C are related only to oscillator architecture, some features were added and improved on 1L05H maskset (DG128C).
Therefore i don't see any problem to select DG128A in CW51 and program/debug DG128C device.

Regarding the example code for expanded narrow mode, i will have to check if we have something like that.

Regards,

iggi

View solution in original post

0 Kudos
3 Replies
2 Views
NXP Employee
NXP Employee

Hi,

You can use any of the two (or both) IDEs.

The datasheet says:

http://cache.freescale.com/files/microcontrollers/doc/data_sheet/MC912DT128A.pdf

     "The MC68HC912DG128C and MC68HC912DG128P are devices similar to the MC68HC912DG128A, but with different oscillator configurations.

     Sections of this book applicable to the MC68HC912DG128A also apply to the MC68HC912DG128C and MC68HC912DG128P, except for the

     differences highlighted in Section 13. Oscillator."

The difference between DG128A and DG128C are related only to oscillator architecture, some features were added and improved on 1L05H maskset (DG128C).
Therefore i don't see any problem to select DG128A in CW51 and program/debug DG128C device.

Regarding the example code for expanded narrow mode, i will have to check if we have something like that.

Regards,

iggi

View solution in original post

0 Kudos
1 View
Contributor II

Thank you for your answer.

By the way,do you want to tell me that we should not to focus the mcu it is in dg128A series ,or in dg128C series,or in dg128P series? but only use dg128 in short.

I can tell you my situation, when we create a new project in CW V5.1,after that ,we choose the mcu MC68HC912DG128A.

We need to use a sub-function in our program to initial the PLLCLK to be the SYSCLK.

so we write like that:

void PLL_init()

{

CLKSEL = 0x00;

PLLPC = 0x40;

SYNR = 0x02;

REFDV = 0x04;

while(!(PLLFLG&0X40));

CLKSEL = 0x40;

}

when the program jump to the CLKSEL =0x40;

the program will be certainly running away.

But if SYNR = 0x01,REFDV = 0x01,everything is ok.

Another problem,we want to use external dual-port ram,so we should configue some page to be an external flash space,can you tell me how can we do that?thank you

--

发自我的网易邮箱手机智能版

在 2015-06-10 17:23:31,iggi <admin@community.freescale.com> 写道:

>|

>|

>|

>|

>mc912dg128ccpv developing /compiling envirement?

>reply from iggi in S12 / MagniV Microcontrollers - View the full discussion

>Hi,

>You can use any of the two (or both) IDEs.

>The datasheet says:

>http://cache.freescale.com/files/microcontrollers/doc/data_sheet/MC912DT128A.pdf

"The MC68HC912DG128C and MC68HC912DG128P are devices similar to the MC68HC912DG128A, but with different oscillator configurations.

Sections of this book applicable to the MC68HC912DG128A also apply to the MC68HC912DG128C and MC68HC912DG128P, except for the

differences highlighted in Section 13. Oscillator."

>The difference between DG128A and DG128C are related only to oscillator architecture, some features were added and improved on 1L05H maskset (DG128C).

>Therefore i don't see any problem to select DG128A in CW51 and program/debug DG128C device.

>Regarding the example code for expanded narrow mode, i will have to check if we have something like that.

>Regards,

>iggi

>| Did your question get answered? If so, say thanks by clicking Correct Answer in the community thread! |

>| Reply to this message by replying to this email, or go to the message on Freescale Community |

>| Start a new discussion in S12 / MagniV Microcontrollers by email or at Freescale Community |

>| Following mc912dg128ccpv developing /compiling envirement? in these streams: Inbox |

>This email was sent by Freescale Community because you are a registered user.

>You may unsubscribe instantly from Freescale Community, or adjust email frequency in your email preferences

>|

>|

0 Kudos
1 View
NXP Employee
NXP Employee

For correct CRG register settings, use the PLL calculator for S12 devices:

S12X PLL (Filter) Calculator

In your case, there is some bad calculation and so oscclk, synr and refdv are not in conjuction.

I am not aware of PLLPC register. There is only PLLCTL. And also PLLFLG does not exist as well. Are these your definitions?

Moreover, the CLKSEL has one bit as Write once in Normal mode (no BDM connection) and you write twice that register which might be a problem.

Here is an example how to initialize a PLL correctly:

void PLL_init()     //initialization of PLL:   

{

//for example: 4MHz osc -> 1MHz Bus clock (2MHz PLL clock)

   CLKSEL = 0;       //system clocks are derived from OSCCLK

   PLLCTL = 177;

  

//setting of PLL clock 

//PLLCLK = 2 * OSCCLK * (SYNR + 1)/(REFDV + 1)

//PLLCLK = 2 * 16MHz * (0 + 1)/(1 + 1) = 48MHz

   SYNR = 2;     

   REFDV = 1;

 

   PLLCTL = 241;

//PLLCTL = 0x60;                //PLL is turned on, AUTO bit is set -> PLL will lock automatically

   while(!CRGFLG_LOCK);   //wait until PLL clocks are within desired tolerance of target frequency

   CLKSEL_PLLSEL = 1;      //system clocks are derived from PLLCLK

}

0 Kudos