After making some changes to the memory alogorithum i found that storing data in a certian part of the eeprom caused altering data in blokes 60 below.
is the comand that is used to store the data that is required, if address = 60 then issues arrise, it so far has been the only issue area of the new programme design. if address = 50, or 70 as far as i can tell anything else all is fine.
when a start address of 60 is used it overwrights the data stored in at least address 5 (it the address that stores if thing have been calibrated or not)
i wrote this little prorgamme for testing the wrting of the eeprom
the only thing that did suprise me at first was if i only wrote 1 variable (b0) it would write every other address, so address 2 would be 1, address 3 would be zero, address 4 would be 2.
after adding in the second variable to write (b1) every address was writen, and writen correctly from the data fed back to the terminal
address is variable w23 in the main programme, the others are byte variables. i2cslow was used as the FPU run at i2cslow
debug shows that address = 60 when error accours
Just looking back over some debuging data indicates that when address 60 is used it starts from adress 0
Code:
hi2cout address, (imagelow,imagehigh,apertlow,aperthigh,shutlow,shuthigh,whole_d,deci_d, overlap,strfocal)
when a start address of 60 is used it overwrights the data stored in at least address 5 (it the address that stores if thing have been calibrated or not)
i wrote this little prorgamme for testing the wrting of the eeprom
Code:
[color=Blue]symbol eprom [/color][color=DarkCyan]= [/color][color=Navy]%10101110[/color]
[color=Blue]symbol ret [/color][color=DarkCyan]= [/color][color=Navy]13[/color]
[color=Blue]symbol lfeed [/color][color=DarkCyan]= [/color][color=Navy]10[/color]
[color=Blue]symbol com [/color][color=DarkCyan]= [/color][color=Navy]44
#no_table
#terminal 9600[/color]
[color=Black]init:
[/color][color=Blue]high b.2
hi2csetup i2cmaster[/color][color=Black], [/color][color=Blue]eprom[/color][color=Black], [/color][color=Blue]i2cslow[/color][color=Black], [/color][color=Blue]i2cword
let [/color][color=Purple]b0 [/color][color=DarkCyan]= [/color][color=Navy]0
[/color][color=Blue]let [/color][color=Purple]b1 [/color][color=DarkCyan]= [/color][color=Navy]100[/color]
[color=Black]main:
[/color][color=Blue]high b.4
for [/color][color=Purple]w1 [/color][color=DarkCyan]= [/color][color=Navy]0 [/color][color=Blue]to [/color][color=Navy]100
[/color][color=Blue]hi2cout [/color][color=Purple]w1[/color][color=Black],[/color][color=Blue]([/color][color=Purple]b0[/color][color=Black],[/color][color=Purple]b1[/color][color=Blue])
pause [/color][color=Navy]10
[/color][color=Blue]inc [/color][color=Purple]w1
[/color][color=Blue]inc [/color][color=Purple]b0
[/color][color=Blue]inc [/color][color=Purple]b1
[/color][color=Blue]next [/color][color=Purple]w1
[/color][color=Blue]low b.4
let [/color][color=Purple]b0 [/color][color=DarkCyan]= [/color][color=Navy]0
[/color][color=Blue]for [/color][color=Purple]w1 [/color][color=DarkCyan]= [/color][color=Navy]0 [/color][color=Blue]to [/color][color=Navy]100
[/color][color=Blue]hi2cin [/color][color=Purple]w1[/color][color=Black],[/color][color=Blue]([/color][color=Purple]b1[/color][color=Blue])
sertxd ([/color][color=Black]#[/color][color=Purple]w1[/color][color=Black],[/color][color=Navy]32[/color][color=Black],#[/color][color=Purple]b1[/color][color=Black],[/color][color=Blue]ret[/color][color=Black],[/color][color=Blue]lfeed)
next [/color][color=Purple]w1
[/color][color=Blue]low b.2[/color]
after adding in the second variable to write (b1) every address was writen, and writen correctly from the data fed back to the terminal
address is variable w23 in the main programme, the others are byte variables. i2cslow was used as the FPU run at i2cslow
debug shows that address = 60 when error accours
Just looking back over some debuging data indicates that when address 60 is used it starts from adress 0