View previous topic :: View next topic |
Author |
Message |
Jim McBride
Joined: 24 Mar 2004 Posts: 21
|
Viewing I/O ports with debugger |
Posted: Thu May 27, 2004 4:28 pm |
|
|
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!! |
|
 |
|