Hi,
Am trying to interface 32x16 DMD(single colour) to TM4c1294ncpdt controller. The 32x16 display driver is for aurdino boards but i want to use it for TM4c board.The communication is SPI.The Dot matrix display is connected to tiva board using DMDCon connector which has 16 pins. The display board has the Foll pins as shown in attachment
1) A and B pins to select row(as only 128 leds can be on out of 512)
2)R acts as MOSI
3)there are 2 pins CLK and SCLK which am not sure to which I/O it should be connected.Clk is PIXEL clock and Sclk is like strobe pin.
4)OE pin is for controlling all led high /low at a time (output Enable)
5)pin C,G and D are NC and remaining are grounded.
Have written the code to transfer some data on DMD but i am unable get any data.
please let me know
1)where i can find c library for 32x16 DMD
2) Should i use Legacy Mode SPI or below code should work?
3)The Clk and Sclk difference
4)the configuration flow if anyone knows
have Used SSI3
GPIOPinTypeGPIOOutput(GPIO_PORTQ_BASE, GPIO_PIN_4); //pq4 is oe pin 1
GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_2); //PN2 is A pin 5
GPIOPinTypeGPIOOutput(GPIO_PORTJ_BASE, GPIO_PIN_1); //PJ1 is B pin 9
GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, GPIO_PIN_5); //PE5 is SCLK pin 13
Code *********Below is a test code which was for to display TI only using 8x8 .only.
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "inc/hw_ssi.h"
#include "inc/hw_types.h"
#include "driverlib/ssi.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
uint32_t ui32SysClkFreq;
#define NUM_SSI_DATA 8
const uint8_t pui8DataTx[NUM_SSI_DATA] =
{0x88, 0xF8, 0xF8, 0x88, 0x01, 0x1F, 0x1F, 0x01};
// Bit-wise reverses a number.
uint8_t
Reverse(uint8_t ui8Number)
{
uint8_t ui8Index;
uint8_t ui8ReversedNumber = 0;
for(ui8Index=0; ui8Index<8; ui8Index++)
{
ui8ReversedNumber = ui8ReversedNumber << 1;
ui8ReversedNumber |= ((1 << ui8Index) & ui8Number) >> ui8Index;
}
return ui8ReversedNumber;
}
int main(void)
{
uint32_t ui32Index;
uint32_t ui32Data;
ui32SysClkFreq = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinConfigure(GPIO_PF3_SSI3CLK);
GPIOPinConfigure(GPIO_PF2_SSI3FSS);
GPIOPinConfigure(GPIO_PF1_SSI3XDAT0);
GPIOPinTypeSSI(GPIO_PORTF_BASE,GPIO_PIN_3|GPIO_PIN_2|GPIO_PIN_1);
//conf oE,A,B,Clk)/
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
GPIOPinTypeGPIOOutput(GPIO_PORTQ_BASE, GPIO_PIN_4); //pq4 is oe pin 1
GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_2); //PN2 is A pin 5
GPIOPinTypeGPIOOutput(GPIO_PORTJ_BASE, GPIO_PIN_1); //PJ1 is B pin 9
GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, GPIO_PIN_5); //PE5 is SCLK pin 13
GPIOPinWrite(GPIO_PORTQ_BASE,GPIO_PIN_4,0x10);
SSIConfigSetExpClk(SSI3_BASE, ui32SysClkFreq, SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 10000, 8);
SSIEnable(SSI3_BASE);
while(1)
{
GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_2,0x0);
GPIOPinWrite(GPIO_PORTJ_BASE,GPIO_PIN_1,0x0);
GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_2,0x00);
GPIOPinWrite(GPIO_PORTJ_BASE,GPIO_PIN_1,0x02);
GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_2,0x04);
GPIOPinWrite(GPIO_PORTJ_BASE,GPIO_PIN_1,0x00);
GPIOPinWrite(GPIO_PORTN_BASE,GPIO_PIN_2,0x04);
GPIOPinWrite(GPIO_PORTJ_BASE,GPIO_PIN_1,0x02);
GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_5,0x20);
for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
{
//ui32Data = (Reverse(pui8DataTx[ui32Index]) << 8) + (1 << ui32Index);
ui32Data=0x01;
SSIDataPut(SSI3_BASE, ui32Data);
while(SSIBusy(SSI3_BASE))
{
}
}
}
}