Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

SPİ Proglem

$
0
0

Hi everyone,

I can't send data to spi. Code is here. Please help me.


#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "inc/hw_ssi.h"
#include "driverlib/ssi.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"

#define NUM_SSI_DATA 3

const unsigned char renk1[480] = {
0X1E,0X19,0X74,0X0F,0X0C,0X7F,0X3F,0X94,0XFF,0X2E,0XB1,0XBE,0X33,0XB9,0XA2,0X37,
0XA0,0X57,0X0E,0X2A,0X0D,0X22,0X61,0X17,0X45,0X83,0X17,0X74,0X73,0X1B,0X98,0X5B,
0X1D,0X94,0X26,0X1A,0X2D,0X0E,0X0D,0X33,0X0F,0X0F,0X64,0X17,0X73,0XC3,0X37,0XF0,
0X05,0X01,0X82,0X00,0X00,0X8B,0X28,0X82,0XFF,0X1A,0XB6,0XCD,0X25,0XC5,0XA9,0X2A,
0XA9,0X4E,0X00,0X30,0X00,0X11,0X5F,0X08,0X43,0X86,0X0B,0X7C,0X7B,0X0D,0XA1,0X59,
0X0B,0X8A,0X0D,0X05,0X20,0X00,0X01,0X2D,0X03,0X04,0X65,0X04,0X78,0XB8,0X18,0XF4,
0X11,0X0B,0XA6,0X06,0X01,0XA2,0X1B,0X77,0XFE,0X0F,0XBB,0XD7,0X1E,0XCA,0XAE,0X24,
0XB4,0X4D,0X02,0X42,0X00,0X12,0X60,0X08,0X49,0X8C,0X0D,0X84,0X84,0X10,0XA9,0X5D,
0X0A,0X8A,0X08,0X01,0X28,0X02,0X00,0X34,0X01,0X08,0X73,0X03,0X87,0XBC,0X1D,0XF7,
0X14,0X0F,0XB8,0X05,0X00,0XB0,0X11,0X6E,0XFF,0X0B,0XC1,0XDF,0X1C,0XCC,0XAF,0X1C,
0XBE,0X4E,0X00,0X57,0X01,0X10,0X60,0X05,0X53,0X97,0X0A,0X92,0X94,0X0C,0XAD,0X5D,
0X08,0X83,0X03,0X04,0X3A,0X01,0X00,0X3F,0X03,0X0B,0X7D,0X01,0X93,0XB8,0X1A,0XF6,
0X11,0X0C,0XCB,0X05,0X00,0XC1,0X08,0X60,0XFA,0X08,0XC9,0XEB,0X19,0XD6,0XB7,0X18,
0XC3,0X4F,0X00,0X6A,0X00,0X09,0X63,0X04,0X5D,0XA3,0X09,0XAC,0XAD,0X09,0XB6,0X63,
0X07,0X7F,0X01,0X06,0X45,0X00,0X00,0X48,0X03,0X0D,0X84,0X02,0X9D,0XB3,0X18,0XF7,
0X12,0X0C,0XDF,0X07,0X01,0XD2,0X05,0X4C,0XEA,0X05,0XD0,0XF3,0X15,0XE6,0XC4,0X19,
0XC8,0X50,0X00,0X7A,0X02,0X02,0X63,0X03,0X66,0XAC,0X0B,0XC5,0XC4,0X08,0XBD,0X6A,
0X07,0X78,0X01,0X02,0X4C,0X00,0X01,0X54,0X01,0X10,0X8B,0X01,0XA6,0XAB,0X18,0XEE,
0X10,0X0E,0XE4,0X04,0X00,0XE1,0X08,0X41,0XDD,0X08,0XCF,0XF0,0X10,0XF2,0XCF,0X15,
0XCB,0X4F,0X01,0X86,0X00,0X03,0X69,0X03,0X6F,0XB4,0X05,0XD8,0XD5,0X08,0XC4,0X70,
0X0A,0X72,0X00,0X00,0X56,0X00,0X00,0X5C,0X02,0X0F,0X8E,0X00,0XAD,0XA0,0X15,0XE8,
0X16,0X12,0XE0,0X04,0X00,0XEA,0X0E,0X3F,0XD7,0X0B,0XC6,0XE5,0X12,0XF3,0XD7,0X0F,
0XC7,0X51,0X02,0X89,0X00,0X0A,0X6C,0X08,0X70,0XB4,0X09,0XDC,0XD9,0X0C,0XC5,0X70,
0X0D,0X6C,0X01,0X03,0X5C,0X00,0X00,0X59,0X03,0X0D,0X8A,0X01,0XA9,0X9B,0X19,0XD8,
0X1D,0X1B,0XD9,0X03,0X00,0XF0,0X10,0X41,0XCD,0X10,0XBF,0XD9,0X15,0XF1,0XD3,0X14,
0XC3,0X55,0X03,0X87,0X00,0X0A,0X6D,0X09,0X6F,0XB1,0X0C,0XD7,0XDA,0X09,0XC1,0X6E,
0X0B,0X6B,0X00,0X03,0X60,0X00,0X01,0X52,0X04,0X0B,0X84,0X03,0XA2,0X96,0X1A,0XD2,
0X28,0X23,0XD2,0X05,0X00,0XF0,0X11,0X3F,0XC2,0X18,0XBC,0XCF,0X1A,0XEB,0XCF,0X18,
0XBA,0X54,0X08,0X85,0X00,0X0F,0X72,0X0C,0X70,0XAD,0X11,0XD7,0XD8,0X0C,0XB8,0X6B,
0X0E,0X69,0X00,0X05,0X5E,0X01,0X00,0X4D,0X05,0X0B,0X82,0X04,0X9D,0X97,0X1D,0XCF,
};


#ifdef DEBUG
void
__error__(char *pcFilename, uint32_t ui32Line)
{
}
#endif


int
main(void)
{
//
// Setup the system clock to run at 50 Mhz from PLL with crystal reference
//
SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
SYSCTL_OSC_MAIN);


uint32_t pui32DataTx[NUM_SSI_DATA];
uint32_t ui32Index;

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

GPIOPinConfigure(GPIO_PA2_SSI0CLK);

GPIOPinConfigure(GPIO_PA5_SSI0TX);

GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_2);

SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_TI,
SSI_MODE_MASTER, 100000, 24);
SSIEnable(SSI0_BASE);

static uint16_t bir; static uint16_t iki; static uint16_t uc;

bir = 0; iki = bir + 1; uc = iki + 1;

while(1)
{
SysCtlDelay(2500000);
bir++;iki = bir + 1; uc = iki + 1;
if(bir == 477){
GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_5,0x00);
while(1){} }
//bir = 0; iki = bir + 1; uc = iki + 1;

pui32DataTx[0] = renk1[bir];
pui32DataTx[1] = renk1[iki];
pui32DataTx[2] = renk1[uc];

//
// Send 3 bytes of data.
//
for(ui32Index = 0; ui32Index < NUM_SSI_DATA; ui32Index++)
{

SSIDataPut(SSI0_BASE, pui32DataTx[ui32Index]);
}
while(SSIBusy(SSI0_BASE))
{
}
}
}


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>