Forums

GPIO in C6713

Started by kostbill November 10, 2005
Hello.

I am using this code

#include <dsk6713.h>

#define GPIO_ENABLE_ADDRESS		0x01B00000
#define GPIO_DIRECTION_ADDRESS	0x01B00004
#define GPIO_VALUE_ADDRESS		0x01B00008

void main( void )
{
	int* GPIO_ENABLE_REGISTER,* GPIO_DIRECTION_REGISTER, *
GPIO_VALUE_REGISTER ;
	
	GPIO_ENABLE_REGISTER 	= (int*)GPIO_ENABLE_ADDRESS ;
	GPIO_DIRECTION_REGISTER = (int*)GPIO_DIRECTION_ADDRESS ;
	GPIO_VALUE_REGISTER 	= (int*)GPIO_VALUE_ADDRESS ;
	
	*GPIO_ENABLE_REGISTER		= 255 ;
	*GPIO_DIRECTION_REGISTER	= 255 ;
	
DSK6713_init();	
	
	while( 1 )
	{
		*GPIO_VALUE_REGISTER	=	255 ;
		DSK6713_waitusec(500000);
		*GPIO_VALUE_REGISTER 	=	0 ;
		DSK6713_waitusec(500000);
	}
	
}

It is not working, it is only working in the GPO[ 2 ] pin, and I think
this is because it is also connected internally to the CLKOUT2.

Why it is not working???? And also, I want to use my own delay functions
because I want to make an application out of the DSK one day.

Thanks a lot.


I was going to try this but haven't had the time yet. I can't see
anything particularly wrong with how you set things up and wondered if
your DSP was little endian. My GPIO registers are 16 bit and if they're
little endian (which I think mine is) I was going to attempt the same
code but with values 0xFF00 instead of 0x00FF

kostbill wrote:
> Hello. > > I am using this code > > #include <dsk6713.h> > > #define GPIO_ENABLE_ADDRESS 0x01B00000 > #define GPIO_DIRECTION_ADDRESS 0x01B00004 > #define GPIO_VALUE_ADDRESS 0x01B00008 > > void main( void ) > { > int* GPIO_ENABLE_REGISTER,* GPIO_DIRECTION_REGISTER, * > GPIO_VALUE_REGISTER ; > > GPIO_ENABLE_REGISTER = (int*)GPIO_ENABLE_ADDRESS ; > GPIO_DIRECTION_REGISTER = (int*)GPIO_DIRECTION_ADDRESS ; > GPIO_VALUE_REGISTER = (int*)GPIO_VALUE_ADDRESS ; > > *GPIO_ENABLE_REGISTER = 255 ; > *GPIO_DIRECTION_REGISTER = 255 ; > > DSK6713_init(); > > while( 1 ) > { > *GPIO_VALUE_REGISTER = 255 ; > DSK6713_waitusec(500000); > *GPIO_VALUE_REGISTER = 0 ; > DSK6713_waitusec(500000); > } > > } > > It is not working, it is only working in the GPO[ 2 ] pin, and I think > this is because it is also connected internally to the CLKOUT2. > > Why it is not working???? And also, I want to use my own delay functions > because I want to make an application out of the DSK one day. > > Thanks a lot.
I'm not familiar with your DSK library, but I suspect you might be able to do things better if you used the Chip Select Library (CSL) that comes with Code Composer Studio, which I presume also came with your DSK. Check out the help files accompanying CCS on the topic "GPIO Module Description" and on the related pages. Cheers! --M
Hello.

Problem is now solved. It was that the HPI is multiplexed with the GPIO
and at reset one specific pin (H14) must be pulled down via an external
resistor.

Thanks for you answers.