This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI-RTOS
Hi.
I have trouble with Tiva TM4C1294XL and SPI interface.
i have to use 7×10 R click – dual character display to display some number in several speeds!
I need some help howe can i write a number or character over SPI ?
every answer is welcome !
Thank you !!!
Do you have a specific question about using the TM4C1294? Are you using the EK-TM4C1294XL launchpad for your development? You can see a simple SPI example in TivaWare
C:\ti\TivaWare_C_Series-2.1.4.178\examples\peripherals\ssi
If you need to use an RTOS, there is a TI-RTOS example included with the TM4C TIRTOS.
You need to look at documentation for your display to identify what data to send out the SPI.
Hello Bob,
first thanks for your help.
I have to programme a modul named 7x10 R click at the Boosterpack 1 of EK-TM4C1294XL in order to display numbers and char's.
.
inow i can initialize the SPI.
but i have to iniitlaize not only the Chip 74HC595 but and the Chip CD4017 at the same time !!! and i am not so clearly how i have to programme this array to display any number or to set only one darlington diod !!!
Below some code of me:
#include <stdbool.h> #include <stdint.h> #include <inc/hw_memmap.h> /* XDCtools Header files */ #include <xdc/std.h> #include <xdc/cfg/global.h> #include <xdc/runtime/System.h> #include <xdc/runtime/Error.h> #include <xdc/runtime/Memory.h> /* BIOS Header files */ #include <ti/sysbios/BIOS.h> #include <ti/sysbios/knl/Task.h> /* Currently unused RTOS headers that are needed * for advanced features like IPC. */ #include <ti/sysbios/knl/Semaphore.h> #include <ti/sysbios/knl/Mailbox.h> #include <ti/sysbios/knl/Event.h> #include <ti/sysbios/hal/Timer.h> /* Driverlib headers */ #include <driverlib/gpio.h> /* Board Header files */ #include <Board.h> #include <EK_TM4C1294XL.h> /* Application headers */ #include <Blink_Task.h> #include <UART_Task.h> #include <TCPEcho_Task.h> #include <driverlib/sysctl.h> #include <driverlib/pin_map.h> #include <driverlib/ssi.h> #include "BSPIBus.h" uint32_t g_ui32SysClock; uint32_t ui32SysClock; //uint16_t data; uint32_t ui32SysClkFreq; uint32_t ui32Index; uint32_t ui32Data; uint32_t ui32SysClkFreq; uint32_t g_ui32SysClock; // system clock in Hz uint8_t font[10] = {0x7E, 0x0A, 0xB6, 0x9E, 0xCA, 0xDC, 0xFC, 0x0E, 0xFE, 0xDE}; // 7-Segment font, letters 0 to 9 //**************************************************************************** // Configuration of SPI (SSI2, on BoosterPack 2 connector, master mode, 9 Mbps) //**************************************************************************** void InitSpi(void) { // enable peripherals SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2); // enable SSI2 (for SPI) SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ); // enable port Q for SSI I/O-pins // configure pins as SSI2 pins GPIOPinConfigure(GPIO_PQ0_SSI3CLK); // Q0 for Clk GPIOPinConfigure(GPIO_PQ3_SSI3XDAT1); // Q3 for Master Output Slave Input (MOSI) GPIOPinConfigure(GPIO_PQ2_SSI3XDAT0); // Q2 for Master Input Slave Output (MISO) // configure pins for SSI2 GPIOPinTypeSSI(GPIO_PORTQ_BASE, GPIO_PIN_3 | GPIO_PIN_2 | GPIO_PIN_0); // configure SSI2 communication SSIConfigSetExpClk(SSI2_BASE, ui32SysClock, SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 10000000, 16); SSIEnable(SSI2_BASE); // enable the SSI2 module // Configure latch pin for 74HC595 (7seg click) SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP); // enable port Q GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_5, GPIO_PIN_5); // set pin P5 to 1 GPIOPinTypeGPIOOutput(GPIO_PORTP_BASE, GPIO_PIN_5); // configure pin P5 for output } //**************************************************************************** // send byte over SPI on BoosterPack 1 connector, latch byte to outputs of 74HC595 (7seg click) after sending void SpiSend (uint8_t data) { SSIDataPut(SSI2_BASE, data); // send byte over SPI SysCtlDelay(100); // wait until byte was sent GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_5, 0); // latch byte to outputs of 74HC595 (7seg click) with 0 on P5 GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_5, GPIO_PIN_5); // set P5 back to 1 // pulse width with no delay and optimization 2 is about 100 ns (measured), slow enough } int main(void) { int i; InitSpi(); while(1){ for (i=0; i<10; i++) { SpiSend(font[i]); // output next digit // SysCtlDelay(g_ui32SysClock/3); // delay for about 1 second (3 cpu clock cycles per loop count) SysCtlDelay(1000000); // fast scrolling of numbers, for inspection of signals on scope } } }
Initializing the 7x10 R click display is beyond the scope of what I can help you with. You should contact MikroElektronica for help with their device.