SPIMaster_LDD problem

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

SPIMaster_LDD problem

Jump to solution
2,289 Views
waldes
Contributor I

Hello,

I have a problem with SPIMaster_LDD component. When I communicate with slave device, the received data is still zero. But I receve the data correctly only in debug mode. I tried to check data communication on an osciloscope and everything is absolutely the same, in run even in debug mode. Program is written according to "help on component" for SPIMaster_LDD. 

 

Thanks a lot for response. 

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,910 Views
ProcessorExpert
Senior Contributor III

Hi,

 

From a quick look on the project, I haven't found any problem with SPI. However, there seem to be declared interrupts in Init_ADC, Init_PDB, Init_eDMA that have defined ISRs in Events.c. The interrupts are enabled but the handlers do not contain any code. This means that if any of these interrupts comes, the cpu gets stuck in endles loop because the interrupts flag is not cleared. For peripheral initialization components, clearing the flag is up to the user and I recommend to put the flag clearing code there or completely disable these components and try if the problem persists.

 

There is also an example project available that you can check. It's available via welcome screen, using the menu Help > Welcome > Example projects > Processor Expert examples for Kinetis and select SPI.

 

 

best regards
Petr Hradsky
Processor Expert Support Team

 

View solution in original post

0 Kudos
Reply
3 Replies
1,910 Views
ProcessorExpert
Senior Contributor III

Hi, 

 

Could you post a sample project showing the problem?

What MCU and CodeWarrior version do you use?

 

best regards
Petr Hradsky
Processor Expert Support and Servicepacks Team

 

0 Kudos
Reply
1,910 Views
waldes
Contributor I

Hello,

I use mcu kinetis MK20DX256ZVLL10 and CW10.2. 

0 Kudos
Reply
1,911 Views
ProcessorExpert
Senior Contributor III

Hi,

 

From a quick look on the project, I haven't found any problem with SPI. However, there seem to be declared interrupts in Init_ADC, Init_PDB, Init_eDMA that have defined ISRs in Events.c. The interrupts are enabled but the handlers do not contain any code. This means that if any of these interrupts comes, the cpu gets stuck in endles loop because the interrupts flag is not cleared. For peripheral initialization components, clearing the flag is up to the user and I recommend to put the flag clearing code there or completely disable these components and try if the problem persists.

 

There is also an example project available that you can check. It's available via welcome screen, using the menu Help > Welcome > Example projects > Processor Expert examples for Kinetis and select SPI.

 

 

best regards
Petr Hradsky
Processor Expert Support Team

 

0 Kudos
Reply