Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/06/06 07:39
Modified:
  07/06/06 09:28

Read: times


 
#119721 - Don't know how to use the RAM in 'C'
Responding to: ???'s previous message
Hi,

I know the basic I2C, i know there are 4 basic functions in I2C implenentation
- I2C_Start
- I2C_Send_Byte
- I2C_Get_Byte
- I2C_Stop

and i got 1 sample eeprom in 'C' i can understand the code but not very well the eeprom functioning...

Let say i got this sample code below:
#include <reg52.h> 

#define countNum P0 
unsigned char a[110]={0}; 

void Deley(unsigned int Dly) 
{ 
   int i, j , k; 
   for( i=0; i<255; i++) 
   { 
      for( j=0; j<Dly; j++) 
      { 
         for( k=0; k<1; k++); 
      } 
   } 
} 

void Run(void) 
{ 
   unsigned char count; 

   if(count<16) 
   { 
      countNum = count; 
      a[count] = 0xaa; 
      count++; 
   } 
   if(count>15) 
   { 
      count = 0; 
   } 
} 

void Port_Init(void) 
{ 
   countNum = 0x00; 
} 


void main() 
{ 
   Port_Init(); 

   while(1) 
   { 
      Run(); 
      Deley(100); 
   } 
   return; 
}


After i increment the array size the data will OVERFLOW.

List of 11 messages in thread
TopicAuthorDate
PCF8570 interface to AT89C52            01/01/70 00:00      
   If that has i2c interface,            01/01/70 00:00      
   You mean one of these?            01/01/70 00:00      
      Not XRAM            01/01/70 00:00      
      Don't know how to use the RAM in 'C'            01/01/70 00:00      
         Please post formatted code            01/01/70 00:00      
   yes, but why do it externally            01/01/70 00:00      
      reason without changing uC            01/01/70 00:00      
         ISP            01/01/70 00:00      
            How to make ISP programmer            01/01/70 00:00      
               you do not 'make' isp            01/01/70 00:00      

Back to Subject List