J'ai un probleme concernant la sauvegarde de données dans une EEPROM.
J'utilise un Pic 16f877A Avec une memoire 24C08.
Le programme consiste a ecrire les chiffres de 1 a 100 dans la EEPROM sous la forme de caracteres ASCII.
Donc je prend 3 octets de memoir dans la EEPROM pour chaque chiffre enregistrer.
Ensuite je lis ces valeur et je les envois par liaison serie directement sur le pc et je visualise avec l'hyper terminal.

Mon prob c'est que je ne visualise pas les bon chiffres ...
Si vous avez une carte EasyPic avec mikroc et biensur un modul EEPROM vous pouvez essayer.

Quand je met la variable Inc a 60 ( dans les boucle for)les bon chiffres s'affiche mais quand il y a 100 comme présenté ci-dessous ca ne m'affiche pas les bon chiffres.
C'est un vrai mystere ...


Code:
int Inc = 0 ;
int Adr  = 0;
char Tampon[4];



void Conversion3(unsigned int Nbr)
  {
   char toto;

 toto = Nbr /100 ;             // Récuperation chiffre des centaines
 Tampon [1] = toto +48 ;   //

 toto = (Nbr /10);              //
 toto =toto  % 10 ;            // Récupération chiffre des dizaines
 Tampon [2] = toto + 48 ;  //

 toto = Nbr ;                      //
 toto = toto % 10;              // Récupération du chiffre des unitées
 Tampon [3] = toto +48 ;   //

   }
   
   void main()
   {
    I2C_Init(100000);
  Soft_Uart_Init(PORTC, 7, 6, 9600, 0);
  LCD_Init(&PORTD);                  // initialize  (4-bit interface connection)
  LCD_Cmd(LCD_CURSOR_OFF);
  LCD_Cmd(LCD_CLEAR);

   for(Inc = 0 ; Inc <100;Inc++)
      {
      
        Conversion3(Inc);
        
       LCD_Chr(1,1,Tampon[1]);
       LCD_Chr(1,2,Tampon[2]);
       LCD_Chr(1,3,Tampon[3]);
        Delay_ms(10);

        I2C_Start();
        I2C_Wr(0xA2);
        I2C_Wr(Adr);
        I2C_Wr(Tampon[1]);
        I2C_Wr(Tampon[2]);
        I2C_Wr(Tampon[3]);
        I2C_Stop();
        while (!I2C_Is_Idle());
        Adr = Adr +4 ;
         
      }
  adr= 0 ;
  
for(Inc = 0 ; Inc <100;Inc++)
      {

 I2C_Start();
 I2C_Wr(0xA2);
 I2C_Wr(adr);
 I2C_Repeated_Start();
 I2C_Wr(0xA3);

 Soft_UART_Write(I2C_Rd(1));
 Soft_UART_Write(I2C_Rd(1));
 Soft_UART_Write(I2C_Rd(0));
 Soft_UART_Write(10);
 Soft_UART_Write(13);
 I2C_Stop();
 while (!I2C_Is_Idle());
 Adr = Adr + 4 ;
 }

      }