FRDM-KL25Z annoying useless piece

17 Sep 2014

I do apologize if I am rude , but this board has annoyed me for many weeks I have posted here and there(freescale community) to no avail.I have tried all the methods suggested by there forum members . So I have come to realize that I have wasted my money and time on a piece of crap ware that does not do any super fast prototype instead it derails you till the point of coming to your wits end.

Sorry for the rant, coming to the point ....I am having a problem with SPI and I have interfaced it with nokia 5110 lcd , have tried many of the libraries and most of them have not worked for me so I tried building my own library but the results are fruitless

The nokia lcd does not show anything. when debugging through CRO I have come to notice that there is no showing of clock on SCLK PIN.

Please let me know how to rectify this Problem.

18 Sep 2014

John,

I haven't tried SPI with my KL25Z, because I don't have any peripherals, but I did find a comment on this thread

http://mbed.org/forum/bugs-suggestions/topic/4419/?page=1#comment-22907

The comment seems to indicate that there are a few pins that aren't suitable for SCLK. A couple of other problems are discussed in that thread which may also be common, along with solutions.

Hope that helps!

18 Sep 2014

John I see you also got an LPC1768, does it work using that one? Since the options are either a problem with the KL25, with the wiring, or with the 5110.

Quick search shows some libs at least increasing the spi frequency, keeping that on the default might be saver to debug. And in general we will need more information regarding your code and your setup to help you.

23 Dec 2014

Hi All,

I am having similar frustration with the KL25, things that just work on a real mbed, just dont on the KL25. SPI signals are appearing to be inverted, have I missed some obvious special configuration thats needed for the KL25?

23 Dec 2014

A couple months back, I purchased an Adafruit proto shield that has a DS1307 RTC and a SD Flash interface. The SD Flash interface (SPI based) worked just fine for me. I did add a wire with a pullup resistor to the Card Detect pin and tied it to PTD5 as well as added a pullup to the MISO pin so I could use Neil Thiessen's version of SDFileSystem, but the mbed official SDFileSystem works just as well (no Card Detect signal needed).

I did have trouble with the I2C, because the Adafruit board had the I2C pins for the DS1307 going to PTC1 and PTC2 (PTC1 on the KL25Z has 32KHz on it to run the internal KL25Z RTC). grrrr.... I cut the I2C traces from the DS1307 and wired them to the normal PTE1 and PTE0 I2C pins. All is now right with the world.

To make a long story short, I had no issue with the KL25Z's SPI interface when using it with SDFileSystem.

23 Dec 2014

Hi Kevin Thanks for the info. I checked out the SPI clock/data this afternoon on an analyser and they looked fine, so I I think the problem I am running into is probably related to how slave select is being done and some timing issue... But it was one of those days and I ran out of time to check...thats a job for later.

I do find going from LPC1768 to freedom is never quite as straight-forward as you expect :-) I guess it adds to the fun.

23 Dec 2014

Dear John-san,

I have written my version of SPI_STMPE610 touch sensor library and it is working fine (at least) for me. But in the library, I had to control the chip select, m_cs in my case, manually. So in the constructor, readRegs and writeRegs, at the first line I wrote

m_cs = 0 ; /* assert chip select */

at the last line I wrote

m_cs = 1 ; /* deassert chip select */

If you have not done these, may be this makes some change. Or if you have already done so, I'm sorry for disturbing you.

moto

24 Dec 2014

Dear Motoo Many thanks. yes I do that.

I should explain the problem I have got more clearly.

The code works fine on a 1768, but not on a KL25Z. The first thing I notice is that MOSI idles high on the 1768 but low on the KL25Z (which is what I meant by inverted). But the timing of data and clock looked OK. I now need to check what the timing of the load signal is.

Also does anyone know how, using the online compiler notcodewarrior to get the KL25 control slave select itself?

best wishes

Jon

24 Dec 2014

The mbed SPI library only uses SS in slave mode, master mode is always done using DigitalOut.

IIRC LPC1768 MOSI is high-Z when idle, while KL25Z is high output, but some time ago I looked into that.

24 Dec 2014

I've had no problems using SPI to drive a Noklia 3110 lcd shield on the FRDM-KL25Z. The code was conversion from an arduino library for the same shield.

Code available at http://developer.mbed.org/users/SomeRandomBloke/code/FRDM_N3110LCD/ This included a snake type game using an accelerometer to change direction.

Hope this helps

Andrew

24 Dec 2014

Erik, Many thanks for that info, thats what I suspected but thankyou for confirming it :-)

Andrew thanks for the info I had already spent some time look at your very helpful page.

best wishes

Jon

24 Dec 2014

Dear John-san,

I have just tested it on my FRDM-KL25Z without any device attached. MOSI (PTD2) is high in idle, SCLK (PTD1) is low.

So may be, you want to check your connection around MOSI (PTD2).

moto

24 Dec 2014

Hi Moto

thanks for that. When I get back to work (next year :-))) ) I shall take a closer look.

I will let you know what I find.

Have a good christmas and new year.

24 Dec 2014

Dear John-san,

I just hacked a tiny spi test program

http://developer.mbed.org/users/Rhyme/code/test_spi/wiki/Homepage

this could be used to check if the spi module of your board is working as you expect. (Try it next year ;-))

Have a nice holiday season and a happy new year!

moto

07 Jan 2015

My thanks to all those who replied with suggestions and test code :-)

After a morning with a logic analyser and a refreshed brain following the christmas break the problem has been resolved.

It was a problem with the board we were talking to., some dubious earthing and some very odd signal threshold problem.

(the board contained a maxim 7221 driving matrix led displays)

What is strange is that it worked perfectly OK with an LPC1768.

Happy new year to you all.

Jon