PEmicro has added a new Chip Select Diagnostic mode to its interactive flash programmers to allow the user to diagnose memory map configuration problems.
PEmicro’s flash programmers support an extensive array of external flash devices connected to the processor. PEmicro’s algorithms are designed to work by default when the flash device is connected to the boot chip select and no modification is needed to the reset configuration of the output enable and write enable lines. However, there are numerous ways in which the flash can be connected that may require changes to the default reset configuration of the processor’s chip select, write enable, and output enable operation.
When another configuration is used, the algorithm may require some modification to work. This often involves writing to the chip select registers to change which chip select is used, to make certain chip selects read only or write only, or to change the base address of the chip select. PEmicro’s algorithms expect the flash to be located at a specific location in the memory map. This location is listed in the algorithm itself as a comment. An example can be seen here:
;begin_cs device=$00000000, length=$00800000, ram=$10000000
This line indicates that the flash must be configured to be in the memory map at address 0, and that the full range $00000000-$00800000 must be configured to address the flash. This is separate from the “Base Address” capability in the programmer user interface which makes the flash appear to be anywhere the user selects it (internally it physically resides at a specific location).
On many devices the boot chip select is enabled everywhere. If a configuration change is needed, there are many commands which allow the registers on the device to be written during startup. The WRITE_LONG, WRITE_WORD, and WRITE_BYTE commands are examples of commands which can be used to write to memory mapped registers. There are also commands on some architectures to allow the configuration of where the registers are located, such as the CONTROL command on the ColdFire architecture. Here is an example of initializing the CS1 chip select on a 5272 device instead of the default CS0 chip select (the boot chip select).
CONTROL=20000001/0C0F/ ;set mbar on with address $20000000
WRITE_LONG=00000000/20000040/ ;cs0 off
WRITE_LONG=00000201/20000048/ ;proc=5272 cs=CS1 16 bits, r/w
WRITE_LONG=00000078/2000004C/ ;proc=5272 cs=CS1 on
The question often comes up : How do I know my chip select configuration is correct?
PEmicro has added a diagnostic tool to it’s interactive flash programmers which allow the user to test the chip select configuration to make sure the chip select, write enable, and output enable signals have been properly configured. The utility may be chosen from the “ChipSelectsDiagnostic” selection on the main menu bar. A portion of the utility is shown here:
Chip Selects Diagnostics
The user will need a scope or a logic probe to see if the signals maintain the proper state during the test read and test write functions. Setting the chip select registers properly solves the majority of support questions PEmicro receives regarding external flash algorithms.
New flash algorithms may be requested on PEmicro's Flash Programming Algorithms page.