yes hendric it works well with the offset for ports , cheers
i will need to find out how to change the code so that it pulses using ASm , cos even at 32mhz the high pulse is still over 7us , with 2 pauseus command
if anyone can advise how to change allow this code to work in ASM to reduce the pulse length , where multi i/o ports are used be great
Cheers
Sheldon
Code:
For T = 0 to 9 ' Select IR LED for Pulses
LOOKUP T, [1,2,4,5,16,17,18,19,20,21],PortOffset ' Offsets from Port A to point to port A and port C I/O ports ( number of offset relates to bits offset in mem map of chip)
Cycles = 0 ' Set to 0
for Cycles = 1 to Pulse_cnt ' Each IR led increments the amount of pulses by 2 for IR LED ID use
PORTA.0[PortOffset] = 1 ' Set IR LED High
pauseus 2 ' Remain on for 2uS
PORTA.0[PortOffset] = 0 ' Set IR LED Low
pauseus 9 ' remain off for 9uS
next Cycles
Pulse_cnt = Pulse_cnt +2 ' increment pulse count by offset of 2 for each IR LED
pauseus 320 ' Wait 350us( adj) between pulse bursts and selecting next IR LED
Next T
Bookmarks