Jump to content

GLion

Members
  • Content count

    4
  • Joined

  • Last visited

About GLion

  • Rank
    Noob Class

Recent Profile Visitors

159 profile views
  1. GLion

    SPI with DMA for MSP432

    When i try to step over Interrupt_enableInterrupt(INT_DMA_INT1); with the debugger in CCS it never finishes stepping over.
  2. GLion

    SPI with DMA for MSP432

    Hi, I'm a bit new to this... I'm wanting to improve the performance of the SPI, I understand that using DMA is the best solution. Are their any example of SPI with DMA? Currently without DMA, I have the SPI setup to send 1 byte at a time with: SPI_transmitData(LCD_EUSCI_MODULE, data); What I want to do is change this so I can fill a buffer with bytes, then say Send. Once thats finished sending I want to fill the buffer again and send the next set of bytes. I tried to use this code although it appears to hang at the last line! DMA_enableModule(); DMA_setControlBase(m_controlTable); DMA_assignChannel(DMA_CH0_EUSCIB0TX0); DMA_disableChannelAttribute(DMA_CH0_EUSCIB0TX0, UDMA_ATTR_ALTSELECT | UDMA_ATTR_USEBURST | UDMA_ATTR_HIGH_PRIORITY | UDMA_ATTR_REQMASK); DMA_setChannelControl(UDMA_PRI_SELECT | DMA_CH0_EUSCIB0TX0, UDMA_SIZE_8 | UDMA_SRC_INC_8 | UDMA_DST_INC_8 | UDMA_ARB_8); DMA_setChannelTransfer(UDMA_PRI_SELECT | DMA_CH0_EUSCIB0TX0, UDMA_MODE_BASIC, m_data_array, (void*)SPI_getTransmitBufferAddressForDMA(EUSCI_B0_MODULE), 1024); DMA_assignInterrupt(DMA_INT1, 0); Interrupt_enableInterrupt(INT_DMA_INT1); ? I was planning to use the code above by filling the buffer "m_data_array" then calling DMA_enableChannel(0); although this didn't work. How do i know when the buffer has been transmitted?
  3. GLion

    ILI9341 Display on MSP432 with SPI

    I worked it out, This display uses 4 wires, although its a 3 wire SPI, 4 wire SPI is for 2 masters in the SPI system. This Display has an extra wire for Data or Command, this is not part of the SPI just a switch for the Display. In the Datasheet its called 4 waire SPI this is not correct! I also had the Phase of the SPI incorrect. SPI code for anyone with this issue. // // Configure SPI peripheral. // GPIO_setAsPeripheralModuleFunctionOutputPin(LCD_SPI_MOSI_PORT, LCD_SPI_MOSI_PIN, LCD_SPI_MOSI_PIN_FUNCTION); GPIO_setAsPeripheralModuleFunctionInputPin(LCD_SPI_MISO_PORT, LCD_SPI_MISO_PIN, LCD_SPI_MISO_PIN_FUNCTION); GPIO_setAsPeripheralModuleFunctionOutputPin(LCD_SPI_CLK_PORT, LCD_SPI_CLK_PIN, LCD_SPI_CLK_PIN_FUNCTION); eUSCI_SPI_MasterConfig spiMasterConfig = { EUSCI_B_SPI_CLOCKSOURCE_SMCLK, // SMCLK Clock Source CS_getSMCLK(), // Get SMCLK frequency 15000000, // SPICLK = 15 MHz EUSCI_B_SPI_MSB_FIRST, // MSB First EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, // Phase // EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW, // Low polarity EUSCI_B_SPI_3PIN // SPI Mode }; SPI_initMaster(LCD_EUSCI_MODULE, &spiMasterConfig); SPI_enableModule(LCD_EUSCI_MODULE); SPI_clearInterruptFlag(LCD_EUSCI_MODULE, EUSCI_B_SPI_RECEIVE_INTERRUPT); P.S The reason I don't want to use Energia is I don't like the IDE!
  4. Hi, I'm struggling to get the the ILI9341 display to work on a MSP432. I've used it on an arduino with this display driver, so I figured that would be a good start for the porting. This display is setup to use SPI (SCK,MISO,MOSI, CS,DC). I understand this is called 4 wire SPI? The following is the code used to init the SPI is this correct? GPIO_setAsOutputPin(LCD_RESET_PORT, LCD_RESET_PIN); GPIO_setOutputLowOnPin(LCD_RESET_PORT, LCD_RESET_PIN); GPIO_setAsOutputPin(LCD_DC_PORT, LCD_DC_PIN); GPIO_setOutputLowOnPin(LCD_DC_PORT, LCD_DC_PIN); GPIO_setAsOutputPin(LCD_SPI_CS_PORT, LCD_SPI_CS_PIN); GPIO_setOutputLowOnPin(LCD_SPI_CS_PORT, LCD_SPI_CS_PIN); // // Configure SPI peripheral. // GPIO_setAsPeripheralModuleFunctionOutputPin(LCD_SPI_MOSI_PORT, LCD_SPI_MOSI_PIN, LCD_SPI_MOSI_PIN_FUNCTION); GPIO_setAsPeripheralModuleFunctionOutputPin(LCD_SPI_MISO_PORT, LCD_SPI_MISO_PIN, LCD_SPI_MISO_PIN_FUNCTION); GPIO_setAsPeripheralModuleFunctionOutputPin(LCD_SPI_CLK_PORT, LCD_SPI_CLK_PIN, LCD_SPI_CLK_PIN_FUNCTION); eUSCI_SPI_MasterConfig spiMasterConfig = { EUSCI_B_SPI_CLOCKSOURCE_SMCLK, // SMCLK Clock Source CS_getSMCLK(), // Get SMCLK frequency 15000000, // SPICLK = 15 MHz EUSCI_B_SPI_MSB_FIRST, // MSB First EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT, // Phase EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW, // Low polarity EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH // SPI Mode }; //EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH //EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_LOW SPI_initMaster(LCD_EUSCI_MODULE, &spiMasterConfig); SPI_enableModule(LCD_EUSCI_MODULE); SPI_clearInterruptFlag(LCD_EUSCI_MODULE, EUSCI_B_SPI_RECEIVE_INTERRUPT); The code i'm unsure about is: - GPIO_setAsPeripheralModuleFunctionOutputPin Should SCK, MOSI, MISO all be set as output or input? - EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW Not really sure what this means is it correct? - EUSCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT Not really sure what this means is it correct? -EUSCI_B_SPI_4PIN_UCxSTE_ACTIVE_HIGH Not really sure what this means is it correct? - SPI_clearInterruptFlag(LCD_EUSCI_MODULE, EUSCI_B_SPI_RECEIVE_INTERRUPT); I'm not using interrupts should I remove this line? Board: MSP432 Launchpad Datasheet: http://www.adafruit.com/datasheets/ILI9341.pdf
×