Ulrich Neumayer

MC56F8255: Do-loop works not correct with fast interrupt

Discussion created by Ulrich Neumayer on Mar 24, 2017

Hello,

i have the following problem:

- MC56F8255VLD
- Core running with PLL at 60MHz
- SPI is activated in slave-mode running with a frequency at 10MHz
- SPI-receiver-full-IRQ configured as fast-interrupt-irq
- every 1,6us occurs an SPI-receiver-full-irq

 

In the main-loop i have a do-loop. In the do-loop the Accumulator B is incremented. The do-loop is executed 19 times. At the beginning the accumulator is cleared, so after the do-loop the accumulator should have the value of 19. Dependent of the number of NOPs in the do-loop the accumulator have the value 19 or 20. The value 19 is correct, the value 20 is not correct. The value 20 depends of the number of the NOPs and only happens when the SPI-receiver-full-irq is enabled. The SPI-receiver-full is a fast-irq.

 

Here is the Code:

_MainLoop:
  CLR       B

  DO        #19,_DoLoop
      INC.L     B
      ;// No NOP  --> O.k.
      ;//  1 NOP  --> O.k.
      ;//  2 NOPs --> fail
      ;//  3 NOPs --> O.k.
      ;//  4 NOPs --> fail
      ;//  5 NOPs --> O.k.
      ;//  6 NOPs --> fail
      ;//  7 NOPs --> O.k.
      ;//  8 NOPs --> fail
      NOP
      NOP
_DoLoop:    
 ;// Here i check if the result is correct:    
 MOVE.W  B0,Y1
 CMP.W   #19,Y1
 BEQ     _ResultIsCorrect
 NOP
 NOP

_ErrorLoop:
  ;// Result is not correct --> Error-Loop
 BRA _ErrorLoop
   

_ResultIsCorrect:
  BRA _MainLoop

 


Here is the SPI-receiver-full-irq-code:
SPIRxFullIRQ:
    MOVE.W    X:SPI0_SPDRR,Y0
    FRTID                   
    NOP
    NOP

 

 

The 56F8322 and 56F8335 DSPs don't have this problem!
What is the reason for this behavior and what can i do to avoid this problem?

Many thanks for your help!
Best regards
Ulrich Neumayer

 

Attachment: The Project

Original Attachment has been moved to: Project.rar

Outcomes