s32k344, LPSPI small clock gap between frames of a continuous sequence

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

s32k344, LPSPI small clock gap between frames of a continuous sequence

447 Views
ekmas-19
Contributor II

- I am having a problem communicating between an NXP MCU S32K344 LPSPI module (Controller) and a Holt HI-35930 (Peripheral).

The code is writing 2 frames, each an 8 bit word. over the LPSPI to an ARINC communication device HI-35930.  I verified all settings are correct. cpol = 0, cpha = 0,  LSBF = MSB, BYSW=no, RXMSK, TXMSK =0, TCR[FRMSZ]=7.

The code uses the TRC[CONT and TRC[CONTC] bits to control the PCS. The PCS stays asserted for the entire sequence of 2 frames, see picture. The clock, likewise pulses over the 2 frames. The SOUT signal has the expected data on it, frame 1 = opcode 0x80, frame 2 - dummy data 0x00

The problem is with SIN. There is no data back. ( opcode 0x80 is to read a register where I was expecting at least one bit set high).

The RXCOUNT does increment on each frame to a max of 2.

-Using the same settings, I concatenate the same opcode and data into one 16-bit frame, set TRC[CONT and TRC[CONTC] = 0 since there is one frame TRC[FRMSZ]=15. The transmission works and SIN returns real data.

What do you think is wrong here?

Yellow - PCS signal

Pink - Clock signal

Blue - SIN to the MCU

Green - SOUT from the MCU

 

 

Tags (2)
0 Kudos
Reply
2 Replies

397 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @ekmas-19,

You described the transmission as sending 2 bytes — 0x80 and 0x00. However, the oscilloscope clearly shows 2 x 32-bit words separated by a small gap, not 2 x 8-bit frames. Can you clarify this?

Regarding the inter-frame gap — this is expected behaviour. CONT = 1 only keeps CS/PCS asserted between frames; it does not affect SCK. The clock behaves exactly as it would with CONT = 0.

 

Regards,

Daniel

 

 

 

0 Kudos
Reply

413 Views
db16122
Contributor IV

The data for MOSI and MISO is empty. Do you have right SPI bus hardware schematics design?

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2398853%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Es32k344%2C%20LPSPI%20small%20clock%20gap%20between%20frames%20of%20a%20continuous%20sequence%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2398853%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E-%20I%20am%20having%20a%20problem%20communicating%20between%20an%20NXP%20MCU%20S32K344%20LPSPI%20module%20(Controller)%20and%20a%20Holt%20HI-35930%20(Peripheral).%3C%2FP%3E%3CP%3EThe%20code%20is%20writing%202%20frames%2C%20each%20an%208%20bit%20word.%20over%20the%20LPSPI%20to%20an%20ARINC%20communication%20device%20HI-35930.%26nbsp%3B%20I%20verified%20all%20settings%20are%20correct.%20cpol%20%3D%200%2C%20cpha%20%3D%200%2C%26nbsp%3B%20LSBF%20%3D%20MSB%2C%20BYSW%3Dno%2C%20RXMSK%2C%20TXMSK%20%3D0%2C%20TCR%5BFRMSZ%5D%3D7.%3C%2FP%3E%3CP%3EThe%20code%20uses%20the%20TRC%5BCONT%20and%20TRC%5BCONTC%5D%20bits%20to%20control%20the%20PCS.%20The%20PCS%20stays%20asserted%20for%20the%20entire%20sequence%20of%202%20frames%2C%20see%20picture.%20The%20clock%2C%20likewise%20pulses%20over%20the%202%20frames.%20The%20SOUT%20signal%20has%20the%20expected%20data%20on%20it%2C%20frame%201%20%3D%20opcode%200x80%2C%20frame%202%20-%20dummy%20data%200x00%3C%2FP%3E%3CP%3EThe%20problem%20is%20with%20SIN.%20There%20is%20no%20data%20back.%20(%20opcode%200x80%20is%20to%20read%20a%20register%20where%20I%20was%20expecting%20at%20least%20one%20bit%20set%20high).%3C%2FP%3E%3CP%3EThe%20RXCOUNT%20does%20increment%20on%20each%20frame%20to%20a%20max%20of%202.%3C%2FP%3E%3CP%3E-Using%20the%20same%20settings%2C%20I%20concatenate%20the%20same%20opcode%20and%20data%20into%20one%2016-bit%20frame%2C%20set%20TRC%5BCONT%20and%20TRC%5BCONTC%5D%20%3D%200%20since%20there%20is%20one%20frame%20TRC%5BFRMSZ%5D%3D15.%20The%20transmission%20works%20and%20SIN%20returns%20real%20data.%3C%2FP%3E%3CP%3EWhat%20do%20you%20think%20is%20wrong%20here%3F%3C%2FP%3E%3CP%3EYellow%20-%20PCS%20signal%3C%2FP%3E%3CP%3EPink%20-%20Clock%20signal%3C%2FP%3E%3CP%3EBlue%20-%20SIN%20to%20the%20MCU%3C%2FP%3E%3CP%3EGreen%20-%20SOUT%20from%20the%20MCU%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2398934%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k344%2C%20LPSPI%20small%20clock%20gap%20between%20frames%20of%20a%20continuous%20sequence%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2398934%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThe%20data%20for%20MOSI%20and%20MISO%20is%20empty.%20Do%20you%20have%20right%20SPI%20bus%20hardware%20schematics%20design%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2399118%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20s32k344%2C%20LPSPI%20small%20clock%20gap%20between%20frames%20of%20a%20continuous%20sequence%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2399118%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F252673%22%20target%3D%22_blank%22%3E%40ekmas-19%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EYou%20described%20the%20transmission%20as%20sending%202%20bytes%20%E2%80%94%200x80%20and%200x00.%20However%2C%20the%20oscilloscope%20clearly%20shows%202%20x%2032-bit%20words%20separated%20by%20a%20small%20gap%2C%20not%202%20x%208-bit%20frames.%20Can%20you%20clarify%20this%3F%3C%2FP%3E%0A%3CP%3ERegarding%20the%20inter-frame%20gap%20%E2%80%94%20this%20is%20expected%20behaviour.%20CONT%20%3D%201%20only%20keeps%20CS%2FPCS%20asserted%20between%20frames%3B%20it%20does%20not%20affect%20SCK.%20The%20clock%20behaves%20exactly%20as%20it%20would%20with%20CONT%20%3D%200.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E