I don't know why, I would like to implement a printf function in my C program for my T89C51CC01. When I run the debugger, my program stop during the execution of the printf function. The manual say that printf use the putchar function. OK. I try to take a look on the disassembly windows, and the program stop just when it tries to send the first character of my string. This is a sample of my program:
void main(void) { while(1) { // Fonctionnement normal // Mode de configuration modeConfig = 1; init_mode_config(); TR0 = 1; while(modeConfig == 1) { switch(niveauMenu) { // Attente des caractères CR,CR pour activer le menu case 0x00: if(flgDataRecu) // Test si le mode config a bien été demandé ? { // Attente de 2 CR flgDataRecu = 0; if(cara_recu == CR) { temps = 0; if(flgDemandeMenu == 1) { TR0 = 0; niveauMenu = 0x01; } else flgDemandeMenu = 1; } else { if(flgDemandeMenu == 1) flgDemandeMenu = 0; // Mauvais caractère ! } } break; // Menu principal case 0x01: printf("\n---------- STDI ----------", table_divers[1], "\n\n"); // printf("A - Vitesse de Transmission serie\n"); printf("B - Format des Donnees\n");
I forget to tell you that my program stop at the beginning of the case 0x01: when the execution of the printf begin...