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.
I have to iplement a program with the microcontroller, a joystick click and a 8x8 y click. For example showing letters (alphabet), if you go left it goes backwards, up and down for switching between uppercase letters and lower case letters.
My problem is, that i do not know how to adress the to booster packs with the joystick and the 8x8 y click..
I have until now nothing, so i am glad about every help, suggestion, etc..
thanks!
Babsi
Let the record show that, "NO/ZERO" LM4F devices were (ever) produced for the general market! Instead each/every "M4" device my firm ordered & received (multiple, different devices) carried the (lesser) LX4F nomenclature - which was described as, "Not quite ready for prime-time."
It is these LX4F devices which are the (real) predecessors of your newer - TM4C123 MCUs.
I must disagree w/the statement, "...LM4F232H5QD" which are predecessors of the Tiva devices and should port fairly easily to TM4C129 launchpad (especially the LM4F232 device). Is not the 4C129 markedly different from the 4C123? (especially so the 4C129's I2C peripheral) It is the 4C123 series which has the best chance of "crossing" to (past/dispatched) LX4F!
I'd be (most) surprised if (any) 4C129 is listed as the (selected/optimal "equivalent device") for ANY (past) LX4F device...
We must then, "agree to disagree" re: "migrate from LX4F to TM4C129. (as your writing advised)
My belief - being a 5K+ client-user of (past/discarded) LX4F: TM4C129 is substantially different from the TM4C123. (more complex)
Thus the TM4C123 provides a much more, "Likely to succeed" migration path (due to its "far better matching") of performance/features to poster's LM3S or LX4F (past) device.
The TM4C129 is far higher in cost as well - thus seems to "lose" on ALL fronts... (and we note that no justification for 4C129's "recommendation" appeared...)
Hello,
i have now this code (below), and it the LEDs are working, but they just are blinking sometimes and so on.. I am doing something wrong?
And can you give me maybe a hint how i can work on just switch on special LEDs? For example to show a letter or just a row?
Thanks and regars,
Barbara
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/ssi.h" // Driver library for SPI peripheral
#include "driverlib/uart.h"
#include "eight_x_eight_font.h"
uint32_t g_ui32SysClock;
void Init(void)
{
g_ui32SysClock = SysCtlClockFreqSet(( SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
IntMasterEnable();
GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTConfigSetExpClk(UART0_BASE, g_ui32SysClock, 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
IntEnable(INT_UART0);
UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
}
void InitSpi (void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3); // Enable the peripheral "SSI3" (SPI3).
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_SSI3)){
}
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ); // Enable Port where the pins are allocated from "SSI3" (Port Q)
GPIOPinConfigure(GPIO_PQ0_SSI3CLK);
GPIOPinConfigure(GPIO_PQ3_SSI3XDAT1);
GPIOPinConfigure(GPIO_PQ2_SSI3XDAT0);
GPIOPinTypeSSI(GPIO_PORTQ_BASE, GPIO_PIN_3 | GPIO_PIN_2 | GPIO_PIN_0);
SSIConfigSetExpClk(SSI3_BASE, g_ui32SysClock, SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 9000000, 16);
SSIEnable(SSI3_BASE);
}
void InitMax7219 (void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP);
GPIOPinTypeGPIOOutput(GPIO_PORTP_BASE, GPIO_PIN_5);
GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_5, GPIO_PIN_5);
}
void SpiSendRoutine (uint8_t data, uint8_t data2)
{
short combined = 0;
combined = (data << 8) | (data2 & 0xff);
//SSIDataPut(SSI3_BASE, data);
//SysCtlDelay(100);
SSIDataPut(SSI3_BASE, combined);
//SysCtlDelay(100);
GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_5, 0);
//SysCtlDelay(100);
GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_5, GPIO_PIN_5);
}
int getJoystick()
{
return 0;
}
void main()
{
int count = 65; // start with 'a'
int upper = 0; //
int brigth = 0; // brigthness of ouptut
int someDelay = 100; //
Init();
InitSpi();
InitMax7219();
while(1)
{
int joy = getJoystick();
switch(joy)
{
case 1: count++; break;
case 2: count--; break;
case 3: upper = 32; break;
case 4: upper = 0; break;
case 5: brigth++; break;
default: break;
}
SpiSendRoutine(0x0B, 0xFF); //Scan Limit
SpiSendRoutine(0x0A, 0x03); //Intensity
SpiSendRoutine(0x09, 0x00);
SpiSendRoutine(0x0C, 0x01);
int i = 1;
//for(i=1; i<=8; i++)
//SpiSendRoutine(i, font[count+upper][i]);
SpiSendRoutine(0x03, 0xFF);
SpiSendRoutine(0x04, 0xFF);
/*SpiSendRoutine(0x0F, 0x01);
SysCtlDelay(10);
SpiSendRoutine(0x0F, 0x00);
SysCtlDelay(10);*/
//SpiSendRoutine(0x0F, 0x00); //ausschalten Display Test
//SpiSendRoutine(0x0F, 0x01); //einschalten Display Test
SysCtlDelay(someDelay);
}
}
Hello Barbara,
I believe the way that this board works is that you have to send some encoded information to it to display the leters. i.e., the matrix is 8X8 so you have to send it information pertaining to which column and which LED's within that column you wish to illuminate. I haven't dug deep enough to tell you specifically which values correspond to which letters, but you should be able to determine this by review of the examples.
For example, int he mikrobasic examples for the LM4 device, it has a table of values to define the font 8x8 FONT.mbas . In this table the caracter '1' is represented by the string of values -- 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFE, 0x40, 0x00, ' Char 049 (1)' and if you draw out an 8x8 matrix you can similate the 8x8 LED matrix and reverse engineer the rows and columns the values correspond with.
Such as if we read the values from left to right with the left most being column 0 and the right most being column 7 and the upper LEDs being the MSbits and the lower being the LSbits. The matrix would look like this:
0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 1 1 0 0 0 0
0 0 1 1 0 0 0 0
0 0 1 1 0 0 0 0
0 0 1 1 0 0 0 0
0 0 1 1 0 0 0 0
0 0 1 1 0 0 0 0
Likewise, the string of values for the letter 'A' would be 0x00, 0x3E, 0x7E, 0xC8, 0xC8, 0x7E, 0x3E, 0x00, ' Char 065 (A) as shown in the same table.
Remember, though, before sending each column value you would need to provide the offset for the column as well as shown in the example.
Hope this makes since.
Hello,
thank you, now the LED is no problem anymore.
But with the joystick ih have some:
I initialized i2c, etc.. but in the datasheet there is written that i have to switch the joystick on (start up), but i do not how i can soft reset de Reg 0Fh [1] or how to enter the start up phase.
best regards,
babsi
Hello Barbara,
There should be similar code examples for the Joystick showing the I2C message sequence to do this Joystic startup. Essentially you will have to send the address to the device/board over I2C then the Data to be written to the register. Have a look around the click website to see if you can locate the SW examples and, even if the SW is not directly portable, you should be able to see the sequence/data that is being send over I2C and if there are certain delays, expected responses, etc...