Hi, I have following code:

void draw_board(const unsigned char board[]) {

unsigned char i, j, k, tmp;

for(i=0; i<20; i++) {
  for(j=0; j<3; j++) {
    gotoxy(i*4+j, 0);  
    for(k=0; k<5; k++) {
      tmp = 0x00;
      if(k<4) {
        if(board[i] & (0x01 << 7 - k*2)) tmp += 0x07;
        if(board[i] & (0x01 << 6 - k*2)) tmp += 0x70;
        write_data(tmp);
        }
      else {
        tmp=board[i-0];
        delay_ms(1000);
        write_data(tmp);
        }
    }
    gotoxy(i*4+4, 0);
    for(k=0; k<5; k++) 
      write_data(0x00);
  }
}
}

My problem is so as soon as tmp=board[i-0]; is executed pic (16f877a) will 
reset. tmp=board[i]; is OK also tmp=board[tmp-0]; is OK. Why is this 
happening? Is this known issue? How can I get aound this problem? Thanks.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to