View previous topic :: View next topic |
Author |
Message |
chava
Joined: 07 Sep 2003 Posts: 56
|
debugger stops running without breakpoint |
Posted: Thu Mar 11, 2004 3:16 pm |
|
|
Hello
I run a program which reads buttons status.
this is a 4X4 button array connected to portb.
each time I press on a button which is located in column 3 of the array the debugger stops the running of the program. more then that, it always stops at the same line.
I cleared all breakp points but... no use... the debugger still stops at that line.
when I press on a button in column 1,2 the button is recognized.
when I press on a button in column 4 the press is igbored
after it stoped I can re-run it, allthough the problem stil occure.
here is the code if it helps:
Code: |
void read_key(){
//this function sets bits 0-15 of "keys_flag" acording to the pressed buttons
//more then one button can be detected
#use fast_io(b)
char temp;char i;
trisb=0xf0;
keys_flag=0;//zero all bits
for (i=1;i<16;i*=2)//sets b0,b1,b2,b3 in turn
{
portb=0|i;
temp=portb ;;//read pins b7-4
temp =temp >> 4//this is where it stops
if (temp!=0) set_key_bit(i,temp);
} |
chava |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Mar 11, 2004 3:46 pm |
|
|
Are you running your keypad on pins B4, B5, B6 and B7 ?
If so, pins B6 and B7 are used by the ICD2 debugger.
Don't press any keys that will put ground on those pins.
If you do, you will interfere with the operation of the ICD2. |
|
|
wedilo
Joined: 16 Sep 2003 Posts: 71 Location: Moers, Germany
|
|
Posted: Fri Mar 12, 2004 1:34 am |
|
|
Hello chava,
If the program is finished, remove the 'ICD=True' behind the #device command and make a final compile of your code. Then program the PIC and you will have full access to the pins B4...B7.
The limitations are for debug use only.
73 Sven |
|
|
chava
Joined: 07 Sep 2003 Posts: 56
|
thanks |
Posted: Fri Mar 12, 2004 10:27 am |
|
|
"PCM programmer" and "wedolo" thank you both!
how come I didnt think about that.... |
|
|
|