Question about flash programming of xc167. Flash is devided into 6 sectors, which can be erased separetly(?). I need to use flash for variable storage, which can be modified while program running, and for storage of executable code. But executable code i want to allocate to most significant adresses C1'0000 - C2'0000 (in sector of 64 kb) and modified variables to least significant adresses C0'0000 - C1'0000 (in sectors of 8 kb). How to do this and where i can determine start position for executeable code? And what means 256-byte wordline in "Programming operations are supported by a 128-byte page buffer which can be loaded with maximum speed, and is then programmed with one single command sequence.Erase operations clear all bits of a selected sector or of a 256-byte wordline." Thanks.
Hi, yes the sectors are separately eraseable. The vectortable is free programable, so there is no difficulty to tell the Linker/Locator where it should be placed. ( Options for Target -> L166 Misc) The same can be done easy with your code, which you can locate also by some options under "Options for Target -> L166 Locate". ( Good example how to do , you can find in the C166 manual and A166 & Utiliies Guide under 'definition of the memory layout') Be sure to set your VECSEG Poiner to 0x00C1 in startup code. The wordline simply means that you are able to clear 256 Byte (2 pages) per sector with one command sequence of the flash state machine,
// AC - step and higher pseudo code /* 1 command */ A=Cx'xxAAh D=xx'80h /* 2 command */ A=Cx'xx54h D=xx'AAh /* 3 command * / A=WLA ; WLA= Word Line Address D=xx03h
// AC - step and higher pseudo code /* 1 command */ A=Cx'xxAAh D=xx'A0h /* 2 command */ A=Cx'xx5Ah D=xx'AAh
// AC - step and higher pseudo code /* 1 command */ A=Cx'xxAAh D=xx'80h /* 2 command */ A=Cx'xx54h D=xx'AAh /* 3 command * / A=SLOC ; SLOC= Sector Start Location D=xx33h
Thanks. But what file is flashlib.c? I can't find it.
Leave your mail account here, I will send it to you. Stefan
Please to a-cht@yandex.ru
Done Stefan