Problem: USB and SPI together (FRDM-K22F)

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

Problem: USB and SPI together (FRDM-K22F)

675 Views
lucasbertinetti
Contributor I

Hello!

I'm using the FRDM-K22F board with KDS IDE to control a Analogic-Digital Converter (Write/Read Registers and get converted data) by a SPI communication. The FRDM-K22F is controlled by a PC software (Interface), in a USB communication. When I use the SPI and USB in different projects, it works but if I try to use SPI and USB together, at the same Kinetis Project, it's not work. I'm thinking the problem could be in the master clock, because SPI and USB have different standard clocks..

Does someone know how to solve this problem?

It's my first request, sorry if I didn't explain correctly :smileygrin:

Thanks!

Tags (4)
0 Kudos
2 Replies

413 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Lucas Bertinetti:

As mentioned by Mark the SPI and USB clocking should not affect each other, but there will be erroneous behavior if you merge 2 codes with different system clocks configuration (MCG, Oscillator, SIM). The configurations should match in case of using both interfaces at the same time, or changing the configuration at run-time to achieve USB or SPI desired frequencies (not common).

If using KSDK then check a similar question in this thread: Re: Problem merging USB CDC and RTC demo

In case you are still having trouble please attach the project or provide more details about what exactly is not working.

Regards!

Jorge Gonzalez

0 Kudos

412 Views
mjbcswitzerland
Specialist V

Hi

SPI clock usage should not affect USB operation - if you use the IRC48 for USB clock generation you can be doubly sure that other clocks can't affect it too.

The links below show the FRDM-K22F used for composite USB as well as with SD card or SPI based Flash or SPI RF tranceiver (in parallel), which you could look at in case you prefer a complete and industrially proven solution to save development efforts.

Otherwise it would be helpful to known what software sources you are using presently so that someone can tell you what incompatibilities they may have between each other.

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html

K22: http://www.utasker.com/kinetis/FRDM-K22F.html / http://www.utasker.com/kinetis/TWR-K22F120M.html

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

:smileyinfo: Out-of-the-box support for 46 Kinetis boards and 10 IDEs (460 combinations from a single code source with no porting required)

0 Kudos