SPI not working at a device using KL25Z128VLK4

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

SPI not working at a device using KL25Z128VLK4

892 Views
alinekafer
Contributor I

I'm dealing with a very particular issue. Me and my coworkers developed an application using the FRDMKL25Z board. This application uses SPI to communicate with another chip, and the code works fine with the Freedom board. So, we developed another board, to run the application we were developig, and we uploaded the codes. Everything was working fine, despite the SPI. Neither MOSI pin was showing any oscilation or the ONBlockSent interrupt was been generated. We tried then to use setVal and clearVal with the MOSI pin, with the very same period requested by the SPI, ans it worked properly. So, if neither the software or the hardware have problems, why isn't SPI working? Anybody has a clue?

Tags (2)
0 Kudos
Reply
4 Replies

766 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Aline Kafer:

If transitioning to your custom board, some things you may check:

- FRDM-KL25Z has a KL25Z128 device, if yours is a device with less memory, change the CPU component in Processor Expert to match and regenerate code. This way the linker file will be replaced to match the memory range in your KL25.

- Check that pin PTA4 is not connected to ground at any moment, a pull-up to VDD is recommended instead of floating.

- What do you mean with "We uploaded the codes"? Did you make any changes to the application that was working on Freedom board?

- If there is no signal for MOSI, it may be that the pin is not configured for SPI function (PORTx_PCRn[MUX]).

- I suppose interrupts are enabled in your project.

If nothing of this helps, please provide more details or if possible share the project to give it a check.


Regards!,
Jorge Gonzalez

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

0 Kudos
Reply

766 Views
alinekafer
Contributor I

Hi Jorge

First of all, thank you for answering my question. To your questions, I have the following answers:

- They are the very same processors, no modification needed.

- At our board, PTA4 is not connected to the ground, but there is a resistor connected to it in some way that there is always 0,8V on that pin. Why is that important?

- "We uploaded the codes" only means that we made them run at the new board, no modifications

- Well, I haven't configured them for SPI function, but if it was running at the freedom board, what else do I have to do? I'm really not aware.

- Interrupts were enabled, since as I said, they were working at the freedom board. Nevertheless, I tried to force an external interrupt to work at our board and it didn't work at all. So, there is any other configuration that I'm missing?

I can send you the codes if needed, I just need to clean them up a little.

Thanx again,

Aline

0 Kudos
Reply

766 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Aline:

Try removing the resistor on PTA4. It is important because that pin is the NMI (non-maskable interrupt) and if grounded then the interrupt will fire. If not attended and cleared then it will hold any other interrupts and most probably continuously trigger.

You can also disable the pin with Processor Expert, just enable the "Advanced" settings:

pastedImage_0.png

Regards!
Jorge Gonzalez

0 Kudos
Reply

766 Views
alinekafer
Contributor I

Hi Jorge

it really makes sense that this could be the problem, but I did what you said and nothing changed.

At the link is the project I'm using, just a very simple send message to test the serial. Maybe this can help...

https://drive.google.com/open?id=0B77keiHdlmjTeF9XdWhHZ0NzbFE

Regards,

Aline

0 Kudos
Reply