Getting started with UART, SPI, I2C on K70F120M

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

Getting started with UART, SPI, I2C on K70F120M

Jump to solution
1,922 Views
lakkimsetty
Contributor II

Hello.

I was wondering if someone could point me the direction of using UART, SPI, I2C on K70. If possible please point me to some examples so that it would be easy to get started.

Thank you for your help.

1 Solution
1,496 Views
mjbcswitzerland
Specialist V

Hi

See µTasker Kinetis TWR-K70F120M support

UART: http://www.utasker.com/docs/uTasker/uTaskerUART.PDF (Interrupt and DMA driven on all UARTs, with optional flow control)

SPI: http://www.utasker.com/docs/uTasker/uTaskerFileSystem_3.PDF (file system in SPi Flash)

I2C: http://www.utasker.com/docs/uTasker/uTaskerIIC.PDF  I2C master for various devices

All can be simulated for easiest learning and development.

Also FS and HS USB, SD card, FAT, LCD, Ethernet, CAN etc.for the K70 (all fully integrated and all can be simulated - most in real-time).

All work out-of-the-box with CW, KDS, IAR, Keil, Greenhills, Rowley Crossworks, Atollic, CooCox, GCC standalone, VisualStudio.

Regards

Mark

Kinetis: µTasker Kinetis support

K70: µTasker Kinetis TWR-K70F120M support  / µTasker EMCRAFT K70F120M support

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

View solution in original post

0 Kudos
Reply
7 Replies
1,497 Views
mjbcswitzerland
Specialist V

Hi

See µTasker Kinetis TWR-K70F120M support

UART: http://www.utasker.com/docs/uTasker/uTaskerUART.PDF (Interrupt and DMA driven on all UARTs, with optional flow control)

SPI: http://www.utasker.com/docs/uTasker/uTaskerFileSystem_3.PDF (file system in SPi Flash)

I2C: http://www.utasker.com/docs/uTasker/uTaskerIIC.PDF  I2C master for various devices

All can be simulated for easiest learning and development.

Also FS and HS USB, SD card, FAT, LCD, Ethernet, CAN etc.for the K70 (all fully integrated and all can be simulated - most in real-time).

All work out-of-the-box with CW, KDS, IAR, Keil, Greenhills, Rowley Crossworks, Atollic, CooCox, GCC standalone, VisualStudio.

Regards

Mark

Kinetis: µTasker Kinetis support

K70: µTasker Kinetis TWR-K70F120M support  / µTasker EMCRAFT K70F120M support

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

0 Kudos
Reply
1,496 Views
lakkimsetty
Contributor II

Thank you Mark.

I know this is a bit off-topic, but how do I flash the binary code onto the memory so that I can use it even after the power cycle.

0 Kudos
Reply
1,496 Views
mjbcswitzerland
Specialist V

Hi

The TWR-K70F120M has an OSJTAG debugger on-board (as well as connectors for an external debugger).

If you build the project in CodeWarrior you can load it by connecting the debugger to the target - it will automatically program the Flash; after a power cycle/reset the program will start from Flash each time.

Another possibility of programming from CodeWarrior is to use its Flash programming utility: You can see this in the following video: uTasker for Kinetis using CodeWarrior - YouTube (at about 8 minutes into the video).

Regards

Mark

Kinetis: µTasker Kinetis support

K70: µTasker Kinetis TWR-K70F120M support  / µTasker EMCRAFT K70F120M support

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

1,496 Views
lakkimsetty
Contributor II

I am a bit confused.

Before I watched the video,

1. I build the project for Flash target.

2. I started the debugger by pressing "F11", then pressed the "play" button which loaded the code. It is working as it is supposed to.

3. When I disconnect and repower the device, The program is not running? as I didnt see any LED blinking.

After watching the video,

1. Does uTasker work as some sort of bootloader?

2. Is it possible to program it with any extra code in the sameway we do in uVision? (As in uVision, the flashed image is loaded even after the power cycle)

Thanks for helping.

0 Kudos
Reply
1,496 Views
mjbcswitzerland
Specialist V

Hi

1. It may be that you built for and loaded to SRAM and not to Flash (check the target used).

2. The uTasker project does include boot loaders (Ethernet, USB, Serial, Kboot, SD card) but these also need to be loaded to the Flash using the same methods as the application uses.

If one of the uTasker boot loader variants in installed there is no need to have a debugger to load applications since it flashes the code.

Regards

Mark

P.S. Which IDE are you using CodeWarrior or Keil uVision?

Kinetis: µTasker Kinetis support

K70: µTasker Kinetis TWR-K70F120M support  / µTasker EMCRAFT K70F120M support

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

1,496 Views
lakkimsetty
Contributor II

That was quick Mark.I was able to resolve the issues.

I was wondering if there is a simple example of each peripheral, instead of all combined into one like uTasker.

0 Kudos
Reply
1,496 Views
mjbcswitzerland
Specialist V

Hi

You can get examples of various individual peripherals at K70_120 |Kinetis K70 120/150 MHz MCUs|Freescale

However the uTasker project allows you to already enable and disable any combination of peripherals so that you only have the ones that you need by controlling a few defines in config.h and app_hw_kinetis.h. All combinations have been developed to work together in any configuration so that you always have a complete and industrially proven framework to easily add product application code to - including documented and supported code. It can also be simulated for fastest learing/project development, works on any Kinetis K, KL, KE, KV, KEA part and builds with almost any IDE, so there is no porting effort in case you need to do the same on a different chip (assuming adequate peripheral features available).

The examples, on the other hand, are each simple (undocumented and un-supported) stand-alone tests that can only be used together in a complete project by combining them accordingy and possible solving potental problems of compatibility. Also they only work with one or two IDEs and if you need to move code later to other Kinetis part you may need to start over again since the packages are very target specific.

Regards

Mark

Kinetis: µTasker Kinetis support

K70: µTasker Kinetis TWR-K70F120M support  / µTasker EMCRAFT K70F120M support

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