That's because when you pass _ledred to the macro as the argument, it uses the 'address'@ delaycycles _ledred it gives a delay of 33uS no matter what the value of the leded var is ??
of ledred, and not the actual value in RAM. Look at the address PBP places ledred at to see
why that happens.
You can't put a macro inside a loop with a variable as the argument. What you're looking to do just
isn't possible (as far as I know) with a macro inside the loop, and calls to any .asm routine, timer, etc,
just aren't going to give you from 1uS to 1000uS delay periods you need immediately after
placing a value on GPIO.
I would re-think the whole process if I'm stuck at 8MHz, or switch osc speed & PIC to support using
the pauseus commands.
Bookmarks