Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

(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.

Latest threads

New Articles From Microcontroller Tips

Back
Top