I am writing the flash programmer. Flash memory 128K connected to uP via CS0. Did somebody know which address ranges flash occupyes in memory space of uP?
Address ranges for the chip selects are programmable. CS0 is kind of a default chip select meaning if you are accessing memory that is not being used by other things such as internal memory or other chip selects, CS0 will be active. Therefore you do not need to located it to any specific location, just access unused memory and you will access the device using CS0. See the datasheet for more information.
Thank you. I have another question yet. For example, flash occupies addresses 0x0-0x7fff, then it is interrupted by IRAM,SFR etc. And it's address range is continued from 0x10000. I accessing the byte at address 0x10000 - what byte of flash i'll get - number 32768 or 65536(numeration from 0)?
what byte of flash i'll get - number 32768 or 65536(numeration from 0)? Check the user manual for the C16x for the exact memory map; it's not the whole first segment that gets "cut out", only certain area's. If I recall correctly, SFR's, IRAM (and XRAM) are checked first, then CS1 and CS3, then CS2 and CS4. If the address doesn't fall in these ranges, CS0 is used. Of course this depends on how many CS's you're using. Hmm, I'm interested in what happens when you disable CS0 (BUSCON0.act = 0) and an address doesn't fall in the CS1-4 ranges... About the addresses: the address doesn't change, only the chip select. So, the same address is put on the address lines -> 0x01'0000 is read from flash. As you can see, some memory area's in flash can not be accessed because of the SFR, etc. area's. You could create a second memory range and also connect it to the flash chipselect. That way the whole flash area is accessible, but using a different address range. Regards, Joost Leeuwesteijn
Thanks for information.