5402 - GPIO problem

Started by vijay_asm August 18, 2006
I work on 5402 DSP. I face a problem in I/O. 5402 has HPIport which
can also be used as IO Port. I am using this port as Output.

The problem is Iam able to write to the IO in Main loop, but is ISR
the port is not in control. I written a toggling code, the pins
toggled well in mainloop, but the same didnt work in ISR.

I Tried both Asm and C, no use. in asm, i tried different
instructions to write to the pin, it worked only in main loop.

This applied for all 8 I/Os.

The interrupt i use is Timer 0

THis is the flow of my code.

I/O Init:-
Config the GPIOCR direction
Timer Init:-
Enable Global interrupts at INTM
Enable Timer 0 interupt at IMR
Stop the Timer - TCR
Load TIM with timer reload value
Start the timer
Stop the Timer

Read the port
Compliment it
Write back

Load the TIM with timer reload
Start the timer

Anyone has an idea why is it so?

Note:I have grounded the HPIENA pin in DSP, to disable the HPI
Functionality[as per datasheet]