Home arrow Support arrow Forums

Luminary Micro Forums

tdavila

Fresh Boarder

2008/07/11 12:44

Problem with Luminary Library and freeRtos

Hello, that is my first message , i recently bought a EKI-LM3S6965, I started to develop using eclipse+CodeSourcery+OpenOCD and freeRTOS too, I want to control some parallel bus device and I try to setup the GPIO ports, initially I miss the SysCtlPeripheralEnable( SYSCTL_PERIPH_GPIOA ); call and MPUHandler interrupt hang it. but now I have a very strange behaviour :

I execute the next code before run the task manager :

#define dd0_Port GPIO_PORTA_BASE
#define dd1_Port GPIO_PORTA_BASE
#define dd2_Port GPIO_PORTA_BASE
#define dd3_Port GPIO_PORTA_BASE
#define dd4_Port GPIO_PORTA_BASE
#define dd5_Port GPIO_PORTA_BASE
#define dd6_Port GPIO_PORTA_BASE
#define dd7_Port GPIO_PORTA_BASE

#define dd0_Pin GPIO_PIN_0
#define dd1_Pin GPIO_PIN_1
#define dd2_Pin GPIO_PIN_2
#define dd3_Pin GPIO_PIN_3
#define dd4_Pin GPIO_PIN_4
#define dd5_Pin GPIO_PIN_5
#define dd6_Pin GPIO_PIN_6
#define dd7_Pin GPIO_PIN_7

function() {

SysCtlPeripheralEnable( SYSCTL_PERIPH_GPIOA );

// Configurar los recursos del procesador
GPIODirModeSet( dd0_Port, dd0_Pin, GPIO_DIR_MODE_OUT );
GPIODirModeSet( dd1_Port, dd1_Pin, GPIO_DIR_MODE_OUT );
GPIODirModeSet( dd2_Port, dd2_Pin, GPIO_DIR_MODE_OUT );
GPIODirModeSet( dd3_Port, dd3_Pin, GPIO_DIR_MODE_OUT );
GPIODirModeSet( dd4_Port, dd4_Pin, GPIO_DIR_MODE_OUT );
GPIODirModeSet( dd5_Port, dd5_Pin, GPIO_DIR_MODE_OUT );
GPIODirModeSet( dd6_Port, dd6_Pin, GPIO_DIR_MODE_OUT );
GPIODirModeSet( dd7_Port, dd7_Pin, GPIO_DIR_MODE_OUT );

GPIOPadConfigSet( dd0_Port, dd0_Pin, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );
GPIOPadConfigSet( dd1_Port, dd1_Pin, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );
GPIOPadConfigSet( dd2_Port, dd2_Pin, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );
GPIOPadConfigSet( dd3_Port, dd3_Pin, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );
GPIOPadConfigSet( dd4_Port, dd4_Pin, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );
GPIOPadConfigSet( dd5_Port, dd5_Pin, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );
GPIOPadConfigSet( dd6_Port, dd6_Pin, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );
GPIOPadConfigSet( dd7_Port, dd7_Pin, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );

// I have 8 leds in all pins of the port A.
// I set a breakpoint here and then I run
// step by step
GPIOPinWrite(dd0_Port, dd0_Pin, 1 ); //This led light on

// now the problem...
//BUt the next leds doesn't light on !!!
GPIOPinWrite(dd1_Port, dd1_Pin, 1 );
GPIOPinWrite(dd2_Port, dd2_Pin, 1 ); GPIOPinWrite(dd3_Port, dd3_Pin, 1 );
GPIOPinWrite(dd4_Port, dd4_Pin, 1 );
GPIOPinWrite(dd5_Port, dd5_Pin, 1 );
GPIOPinWrite(dd6_Port, dd6_Pin, 1 );
GPIOPinWrite(dd7_Port, dd7_Pin, 1 );

// here only the GPIO_PIN_0 of the PORTA is light on.

GPIOPinWrite(dd0_Port, dd0_Pin, 0 );// this light off the led.
// the next do nothing because te leds are already off..
GPIOPinWrite(dd1_Port, dd1_Pin, 0 );
GPIOPinWrite(dd2_Port, dd2_Pin, 0 );
GPIOPinWrite(dd3_Port, dd3_Pin, 0 );
GPIOPinWrite(dd4_Port, dd4_Pin, 0 );
GPIOPinWrite(dd5_Port, dd5_Pin, 0 );
GPIOPinWrite(dd6_Port, dd6_Pin, 0 );
GPIOPinWrite(dd7_Port, dd7_Pin, 0 );


}


I don't know what I did wrong (obviously)

Any Hint to solve this, thank you for reading.

Post edited by: tdavila, at: 2008/07/11 12:45

login or register to reply

ravaz

Platinum Boarder

2008/07/11 17:02

Re:Problem with Luminary Library and freeRtos

Hi tdavilla,

this problem has already been raised on the past. If you read more carrefully the datasheet or the source examples you will find that actually the last parameter of GPIOPinWrite must have the bit with the value you want to set.

Two options:

#1

// now the problem...

//BUt the next leds doesn't light on !!!

GPIOPinWrite(dd1_Port, dd1_Pin, dd1_Pin );

GPIOPinWrite(dd2_Port, dd2_Pin, dd2_Pin ); GPIOPinWrite(dd3_Port, dd3_Pin, dd3_Pin );

GPIOPinWrite(dd4_Port, dd4_Pin, dd4_Pin );

GPIOPinWrite(dd5_Port, dd5_Pin, dd5_Pin );

GPIOPinWrite(dd6_Port, dd6_Pin, dd6_Pin );

GPIOPinWrite(dd7_Port, dd7_Pin, dd7_Pin);



#2


// now the problem...

//BUt the next leds doesn't light on !!!

GPIOPinWrite(dd1_Port, dd1_Pin, 0xFF);

GPIOPinWrite(dd2_Port, dd2_Pin, 0xFF ); GPIOPinWrite(dd3_Port, dd3_Pin, 0xFF );

GPIOPinWrite(dd4_Port, dd4_Pin, 0xFF );

GPIOPinWrite(dd5_Port, dd5_Pin, 0xFF );

GPIOPinWrite(dd6_Port, dd6_Pin, 0xFF );

GPIOPinWrite(dd7_Port, dd7_Pin, 0xFF );



regards

Post edited by: ravaz, at: 2008/07/11 23:54

login or register to reply

tdavila

Fresh Boarder

2008/07/11 17:42

Re:Problem with Luminary Library and freeRtos

Hi ravaz, first, thank you very much, I really sorry I miss that information on datasheets ,my fault, I will pay more attention in a future.

That explain why the first bit works and the other not,
it should do an AND with the pin data ?

Another time, thank you,

login or register to reply

JorgeOrlando

Junior Boarder

2008/11/05 13:18

Re:Problem with Luminary Library and freeRtos

eyy, tdavila, I would appreciate if I could contact with you, I'm having almost the same problem. I'm new at this. Could we talk each other through msn or something ? I need some help with a project I'm making with the LM3S6965, mail me: clavat.knight@gmail.com

login or register to reply