AnsweredAssumed Answered

SSP0 interrupt stuck , lpc1766

Question asked by Adrian Cojocari on Aug 22, 2016
Latest reply on Sep 15, 2016 by soledad

Hi everyone, i`m trying to send some data in ssp0 interrupt handler to my lcd , but as the interrupt activates , it won`t get out of it , here I have my code :

/*

* ssp_init.c

*

*  Created on: Jul 25, 2016

*      Author: student

*/

 

 

#include "chip.h"

#include "ssp.h"

#include "lcd.h"

#include "audio.h"

#include "arm_math.h"

#include "fft.h"

 

 

//uint16_t data;

float32_t outArray[64];

 

 

// DEMO VERSION

void ssp_init(LPC_SSP_T *pSSP) {

 

 

  // Assign GPIO to SSP0 - SCK, MOSI, MISO

  Chip_GPIO_Init(LPC_GPIO);

  Chip_IOCON_PinMuxSet(LPC_IOCON, 3, 25, IOCON_FUNC0); //LCD_RES

  Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 21, IOCON_FUNC0); //SSEL0

  Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 20, IOCON_FUNC3); //SCK

  Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 23, IOCON_FUNC3); //MISO

  Chip_IOCON_PinMuxSet(LPC_IOCON, 1, 24, IOCON_FUNC3); //MOSI

  //

  Chip_GPIO_SetPinDIR(LPC_GPIO, 3, 25, true);

  Chip_GPIO_SetPinDIR(LPC_GPIO, 1, 21, true);

 

 

  Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SSP0);

  Chip_SSP_Disable(pSSP);

  Chip_SSP_Set_Mode(pSSP, SSP_MODE_MASTER);

  Chip_SSP_SetFormat(pSSP, SSP_BITS_9, SSP_FRAMEFORMAT_SPI,

  SSP_CLOCK_CPHA0_CPOL0);

  Chip_SSP_SetBitRate(pSSP, 5000000);

  Chip_SSP_Int_Enable(LPC_SSP0);

  Chip_SSP_Enable(pSSP);

  Chip_SSP_ClearIntPending(LPC_SSP0,SSP_RTIC);

  NVIC_SetPriority(SSP0_IRQn, 29);

  NVIC_EnableIRQ(SSP0_IRQn);

}

 

 

void SSP0_IRQHandler(void) {

getArray(outArray);

}

 

 

Thanks !!!

Outcomes