Using TWR-K60 board without ethernet

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Using TWR-K60 board without ethernet

ソリューションへジャンプ
1,646件の閲覧回数
MWMinor
Contributor V

Hi, Im trying to use a TWR-K60 board in an application that doesn't require Ethernet, so I removed the EXTAL0 link to the 50MHz clock source on the TWR board, but the board no longer boots. It looks like the processor is using the 50MHz clock for other peripherals. Is there a way of running the processor without the EXTAL0 input applied...?

1 解決策
1,228件の閲覧回数
mjbcswitzerland
Specialist V

Ken

For USB operation you will need a crystal reference since the IRCs are not accurate enough - you either need to use an external crystal source and generate the internal clocks using the PLL (for jitter reasons) or use a dedicated 48MHz USB clock input on the USB_CLOCK pin.

Due to low power requirements and not needing a crystal I would just move to a K64 since it will allow you to then use the internal IRC48M as USB clock source (crystal-less mode) and you can then use it or another IRC for the system clocks, which are no longer required for the USB. If you need USB host mode you will nevertheless need a good source since the IRC48M is only possible for USB device.

Regards

Mark

Kinetis: µTasker Kinetis support

K60: µTasker Kinetis TWR-K60N512 support  / µTasker Kinetis TWR-K60D100M support  / µTasker Kinetis TWR-K60F120M support

K64: µTasker Kinetis FRDM-K64F support  / µTasker Kinetis TWR-K64F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

元の投稿で解決策を見る

12 返答(返信)
1,228件の閲覧回数
Masmiseim
Senior Contributor I

Check Jumper 6. It should be at position 1-2 when you run without the TWR-SER Module

0 件の賞賛
返信
1,228件の閲覧回数
MWMinor
Contributor V

Hi Markus

Thanks for the suggestion. Jumper 6 (or J6) on the TWR-K60 board is a header for Touch TWRP. I think you might have been suggestion J10 pins 1-2 which links the 50MHz oscillator to the EXTAL0 line 0n PTA18

BUTI would like to find a clock configuration that doesn't use EXTAL0 input. I'm sure it must be possible - the clock configuration is just so complicated, so I was hoping to find some assistance..

I'm using Codewarrior V10.6 and MQX version 4,3

Regards

Ken

0 件の賞賛
返信
1,228件の閲覧回数
Masmiseim
Senior Contributor I

Hey Ken,

I’m not that familiar with Codewarrior and MQX, but when the controller comes up it runs without a need of an external oscillator. It runs with the Internal Reference Clock. I think Codewarrior changes the clock source of the Controller in the startup code. You should find the startup code in startup_<controllertyp>.S and system_<controllertype>.c. There should be a SystemInit which does the job.

If you like to run with different clock settings, you should take a deeper look at the reference manual and change the startup code.

Hope this helps.

Regards

0 件の賞賛
返信
1,228件の閲覧回数
derek_lau
Contributor III

There are several TWR-K60 boards. I suppose you are using the TWR-K60D100M (clock jumper is J10) while Markus is properly refereeing to the TWE-K60N512 board (J6).

As Mark and Jeremy said you need to set the appropriate MCG. If you don't set the MCG it still can boot and run using internal ICG. If you set the wrong MCG the program runs until the wrong MCG is set (eg: MCG is set to use external 50MHz input)

0 件の賞賛
返信
1,228件の閲覧回数
MWMinor
Contributor V

Hello Derek

Thanks for the clarification and yes I'm using the TWR-K60D100M board.

I also concluded that what I needed to do was modify the MCG settings to maybe use the 32.768KHz clock from the RTC. I attempted to do this using processor expert within CodeWarrior but the permutations seem almost endless. Is there a simpler "guide" for doing this or is it really that complicated...?

Regards

Ken

0 件の賞賛
返信
1,228件の閲覧回数
mjbcswitzerland
Specialist V

Hi Ken

Setting the clock is in fact very easy once you understand a few basic concepts - I linked a guide but you seem to have missed it so here it is again:

µTasker MCG Configuration Support

If you tell me which clock source you require, which core and bus frequencies (and whether FLL or PLL derived) I can send you code for a specific case - it is usually just a handful of lines of code which can be inserted into the iitialisation.

PE will often be able to do it but is not fool-proof and will tend to insert unnecessary initialisations and large amounts of code, from which only a few lines are usually needed - I would however expect it to work fine with the K60 since it is a very standard chip.

Regards

Mark

Kinetis: µTasker Kinetis support

K60: µTasker Kinetis TWR-K60N512 support  / µTasker Kinetis TWR-K60D100M support  / µTasker Kinetis TWR-K60F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

1,227件の閲覧回数
MWMinor
Contributor V

Hello Mark

Thanks again for the response. I didn't miss the linked guide - but did find it a little heavy reading - but I'm persisting and trying to get my head around the subject as it seems a pretty important one.

In the new application we are developing the code for, we want to make use of the Low Power Modes and have measured significant reductions in power dissipation between the "run" mode and "sleep" where I believe the processor continues to clock but at a much reduced core frequency of 2MHz - so whatever changes we make we'd like to keep that flexibility.

Other than that, and in "normal" run mode we want to run the core at 96MHz - which is what I understand the current configuration is set to. We need to use the USB interface as a device so I'm assuming we need to make use of the PLL mode for jitter reasons to generate our 48MHz clock. What I'd like to be able to do is just not drive the EXTAL0 input which is currently driven by the 50MHz clock source, and make use of the 32.768KHz clock. Is this possible..?

Thanks again for your support...

Ken

0 件の賞賛
返信
1,229件の閲覧回数
mjbcswitzerland
Specialist V

Ken

For USB operation you will need a crystal reference since the IRCs are not accurate enough - you either need to use an external crystal source and generate the internal clocks using the PLL (for jitter reasons) or use a dedicated 48MHz USB clock input on the USB_CLOCK pin.

Due to low power requirements and not needing a crystal I would just move to a K64 since it will allow you to then use the internal IRC48M as USB clock source (crystal-less mode) and you can then use it or another IRC for the system clocks, which are no longer required for the USB. If you need USB host mode you will nevertheless need a good source since the IRC48M is only possible for USB device.

Regards

Mark

Kinetis: µTasker Kinetis support

K60: µTasker Kinetis TWR-K60N512 support  / µTasker Kinetis TWR-K60D100M support  / µTasker Kinetis TWR-K60F120M support

K64: µTasker Kinetis FRDM-K64F support  / µTasker Kinetis TWR-K64F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

1,227件の閲覧回数
MWMinor
Contributor V

Hi Mark

Thanks. We'll probably look at using the EXTAL0 input again as the 50MHz source but it's been a useful exercise in getting my head around the MCG...!

Regards

Ken

0 件の賞賛
返信
1,227件の閲覧回数
Masmiseim
Senior Contributor I

You are right; I was refereeing to the TWE-K60N512 board. Sorry for the confusion.

0 件の賞賛
返信
1,228件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi Ken,

I think you need to check whether MCU enters a appropriate MCG or not after power up.

Please go for configure MCG mode by refer to the Mark shared.
Have a great day,
Ping

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

0 件の賞賛
返信
1,228件の閲覧回数
mjbcswitzerland
Specialist V

Hello Ken

There are various clocking options - from internal slow/fast IRC or IRC48M sources, as well as from external crystals/oscillator, including the 32.768 RTC crystal.

See µTasker MCG Configuration Support for complete set of options.

Regards

Mark

Kinetis: µTasker Kinetis support

K64: µTasker Kinetis FRDM-K64F support  / µTasker Kinetis TWR-K64F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 件の賞賛
返信