This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with Keil program, help me please!

Block the printf function in Keil 4, please!

I just learned to program a program for the microcontroller AT89C52 using Keil 4:

I have my program and Keil complier posted: "0 Errors (s), 0 Warning (s)." But when I do Debug step with F10 .. The program works fine until the "printf" function and not continue.

I would write to you to ask your advice and support.

Sincerely
Tommy

Here is my program:

#include <regx52.H>
#include <ctype.h>
#include <stdio.h>
#include <termios.h>
#include <stdlib.h>
#include <intrins.h>

void delay_ms(unsigned int ms)
{ unsigned int x,y; for(x=0;x<ms;x++) for(y=0;y<=125;y++);
}

void main()
{

unsigned char seg7[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; unsigned char etat7[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; int h,i,j=0;

P0 = 0x00;

P1 = 0x00;

while(h<10) { for(i;i<8;i++) { P0=seg7[i]; delay_ms(1000); P1=seg7[i+2]; delay_ms(1000); printf(" cable bien branché à l'entrée %d et sortie %d",i,i);

} h++; }

}