Reply by Jeff Brower February 15, 20082008-02-15
Dayah-

> I want to use HPI0-HPI7 as the output pins/GPIO to blink the external
> LEDs. How to do this by using c programming ? I'm using dsk5416. What
> I know is I need to set the address for GPIOCR(003Ch) and the
> GPIOSR(003Dh). Then I need to set which pin that I want to use as
> input or output for GPIOCR. Then I need to set the output as GPIOSR.
>
> Here is my program...but not working. Can someone help me ?

If this is with DSK 5416 board, then you may need to disable HPI (clear HPIENA pin at
boot-time). If you use GPIO on HD0-HD7 then multiplexed HPI (HPI8 mode) will be
disabled -- on the DSK 5416 HPI8 is one of the expansion connectors. Is that where
you are monitoring the pins?

-Jeff

> #include #define GPIOCR 0x003c;
> #define GPIOSR 0x003d;
>
> ioport unsigned port3C,GPIOCR;
> ioport unsigned port3D,GPIOSR;
>
> void delay(void)
> {
> long i, j=0;
> for(i=0;i<1000;i++)
> {
> j++;
> }
>
> }
> void main()
> {
> GPIOCR=0xf0;
>
> while(1)
> {
> GPIOSR=0x00;
> delay();
> GPIOSR=0xf0;
> delay();
> }
> }
>
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467