I want to write a program to transfer data to my offboard EEprom. My data to transfer is 111 bytes long. I am going to use a 16F877A. If I read the data sheet correctly, there should be 368 bytes of data memory. When I try to compile I get the message “Unable to fit variable ELoad”. Am I misinterpreting the data sheet? To test that this is a variable load problem I placed an END program after “ELoad VAR BYTE[111]” and compiled. The same error message occurs. Will someone please explain? I have searched for a discussion on this error only to find comments about 12F controllers or “If this occurs during compilation select another MCU with more general purpose RAM”. My program uses 119 bytes of general purpose data memory (I think) so why is an 877A coming up short? Question; does General Purpose Ram equate to device available Data Memory? Comments please!
Code:Avar var byte ;General use variables Bvar var byte Cvar var byte ; 24LC02B EEPROM - I2C dataEE var PORTB.4 ;EEPROM Data I2C clkEE VAR PORTB.5 ;EEPROM Clock I2C ; RS232 LINK TO PC RX_232 var PortC.7 ;rs232 TX_232 var PortC.6 ;rs232 ; EEprom data eload var byte[111] ; ; 16F887A has 368 bytes of Data Memory eload[0]=$68 eload[1]=$68 ----- ----- ----- ----- eload[109]=$2A eload[110]=$2B LoadEE: ; FOR LOADING EXTERNAL EEPROM bvar=0 For Avar = 100 TO 210 I2cWrite dataEE,clkEE,$A0, avar, [eload[bvar]] Pause 10 ' Delay 10ms after each write bvar=bvar+1 next avar END




Bookmarks