Can you use the debugger to view I/O ports while stepping through your code? I have tried but don't seem to be getting the syntax correct. How is this done?
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
Posted: Thu May 27, 2004 5:24 pm
Let's say you are trying to watch PORT B. Define a byte variable like this:
#byte PORTB=0x06 //The address depends on the PIC you are using
And then add PORTB (or PORTB,b or PORTB,h) to the watch window. You can also use it as a normal variable; for example for setting RB0 and clearing the rest you can use
PORTB=0b00000001;
Guest
Posted: Fri May 28, 2004 9:11 am
I can't seem to find the syntax you came up with. Am I correct in assuming that PORTB,b would give you binary, PORTB,h would give you hex?
Thanks for the help!!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum