Need help setting up MCG on K70

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

Need help setting up MCG on K70

879 Views
crezyoz
Contributor IV

I want to run a K70 at 120Mhz using a 12 Mhz xtal connected to EXTAL1/XTAL1(ext osc 1). Nothing connected to Ext Osc 0.

How do I setup the MCG to do that? I can't seem to figure that out. PE's cpu.c init_hardware code hangs here:

  while((MCG_S & MCG_S_IREFST_MASK) != 0x00U) { /* Check that the source of the FLL reference clock is the external reference clock. */

  }

  while((MCG_S & 0x0CU) != 0x08U) {    /* Wait until external reference clock is selected as MCG output */

  }

But FLL is disabled.   Please advise.



0 Kudos
8 Replies

533 Views
Petr_H
NXP Employee
NXP Employee

Hi,

Could you please post a sample project with the settings? Are you using PLL?

This could also be a hardware issue. Do you use your own board?

best regards

Petr Hradsky

Processor Expert Support Team

0 Kudos

533 Views
crezyoz
Contributor IV

Petr. It is a bit confusing as to how I use OSC1 as the source for the MCG. I was only able to get OSC0 to work. I am using P.E. to set up the cpus.

I tried it on the TOWER and on my K70 board. I suppose a code segment that does it would be helpful. Perhaps P.E. is messing up?

0 Kudos

533 Views
Petr_H
NXP Employee
NXP Employee

Please find attached an example project configured to use System Oscillattor 1 only in PEE mode with PLL. During startup, RTC oscillator is used instead of System oscillator 1, as the oscillator 1 cannot be used for this.

I was also informed that there has been some errors corrected so I recommend to download latest CodeWarrior 10.3.

best regards

Petr Hradsky

Processor Expert Support  Team

0 Kudos

533 Views
crezyoz
Contributor IV

I don't see an attachment?

0 Kudos

533 Views
Petr_H
NXP Employee
NXP Employee

You are probably looking via inbox only. Please click on the thread name and see my previous post, you should see the attachment there.

best regards

Petr Hradsky

Processor Expert Support Team

0 Kudos

533 Views
crezyoz
Contributor IV

Thanks Petr. I have it now.

Do you know if CW10.3 installs over CW10.2 or separately? Since I am at the end of a project I would like ot make sure I can go back to 10.2

Thanks.

P

0 Kudos

533 Views
BlackNight
NXP Employee
NXP Employee

Hi Phil,

do *not* install 10.3 _over_ 10.2 (into the same folder). This is not how it will work. Install 10.3 into a differnt folder, as proposed by the installer. That way you have 10.2 and 10.3 side by side, and can switch back and forwared.

Just keep in mind that typically the project files are upwards compatible, that means that you can import a 10.2 project into 10.3. But the other way round might not work well. I have not seen much issues, but better to make you aware.

Erich

0 Kudos

533 Views
crezyoz
Contributor IV

Thank you Erich

0 Kudos