PDA

View Full Version : DX2ST Interupt in USIC SPI Slave Mode



danbeadle
May 5th, 2013, 04:07 PM
I hacked a DAVE3 app to create SPI Slave.

Basically, I set PCR = 0x8000 to allow interrupts on DX2ST. Set DX2CR to trigger on rising edge of DX2.

I am getting an interrupt on every character via the attached protocol interrupt. I want it to happen on the falling edge of the frame only.. (Frames are currently 5 bytes, so I expect the frame interrupt to happen at 1/5th the rate of the character interrupts).

This is on AB silicon, USIC0CH0.

Any suggestions. I think I have the main hookup right. If I disable DX2TIEN i get no interrupts to this service. (RX still happens). So, I don't have any other Protocol Event enabled.. It is clearly this signal causing the interrupt - just too often!

danbeadle
May 9th, 2013, 08:29 AM
I found that my host was deselecting my slave on every byte.

This code works once I fixed the master side.

danbeadle
May 28th, 2013, 11:30 AM
The documentation says that slave will interrupt on both edges of chip select in slave mode. I have found this not to be true. The interrupt happes on the selection only, not deselection. Is the documentation wrong? Or my configuration? I looked at all configuration registers and don't see any that specify rising/falling edges.

Rou
Jun 13th, 2013, 02:34 AM
Hi danbeadle,

The edge selection is available in the register DX2CR.CM.


rgds,
Rou