Hello all,
The data sheet for the GP32 seems to be quite clear that, whenever a peripheral module such as a TIM channel is enabled, this will over-ride the underlying general purpose I/O at the pin. This would make sense since the TIM must determine whether each channel pin is an input or an output , quite independently of the the DDR setting.
The same would also seem to apply to other modules, such as SCI, SPI and ADC. The one exception appears to be the KBI module, where input status may be read at any time.
Peg, I don't share your concerns that disabling the TIM channel within the ISR would be problematic, provided the timer channel register is read prior to disable. When a TIM channel is enabled during initialisation,or here within the ISR, I think it is a good policy to ensure than any spurious interrupt flag is cleared. This needs to be explicitly done within the ISR anyway, so there would be little effect on code complexity.
Peter, I think you have an error with the line -
BRSET 6,0,JumpLocation
Address 0 refers to Port A; for the timer channel pins at Port D the address should be $03.
Regards,
Mac