(CCS) printf bug?

Status
Not open for further replies.
#include <16F877a.h>
//#include <18f452.h>
#device adc=8
#use delay(clock=4000000)
#fuses NOWDT,XT, PUT, NOLVP
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)
#use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3)

void main() {
int8 z=0;

while(1) {
z++;
printf("press any key to start\n\r");
getc();

printf("i love it!");
printf("%2u\n\r", z);
}
}

The screen stop responding if i pressed and held down the key (any key) for a while. However, if i commented out the
//printf("press any key to start\n\r");
the system works fine.

#include <16F877a.h>
//#include <18f452.h>
#device adc=8
#use delay(clock=4000000)
#fuses NOWDT,XT, PUT, NOLVP
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)
#use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3)

void main() {
int8 z=0;

while(1) {
z++;
//printf("press any key to start\n\r");
getc();

printf("i love it!");
printf("%2u\n\r", z);
}
}


Could anyone tell me why does it happen?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…