.........The CY545 may be operated with up to 64K bytes of external memory, which hold various sequences of commands to run. A number of CY545 commands are used to support the external memory, allowing you to set the memory address pointer, enter commands into memory, and execute commands from memory.
Several types of external memory may be used, including RAM, EEPROM, and EPROM. Note that EPROM memory must be programmed separately from its use in a CY545 application, so the CY545 Enter command and the ability to define the contents of memory are given up when an EPROM is used. The other two forms of memory allow the CY545 to write to memory as well as read it.
When RAM is used, the contents are lost when power is removed, unless some battery back-up power is provided. Normally, the contents of RAM must be redefined whenever the CY545 application is started.
With EEPROM, the memory can still be written by the CY545, especially if a 5-volt-only version is used, but the memory contents are not lost when power is removed.
An applications schematic, provided with this manual, illustrates the use of an EEPROM as the external data memory for the CY545. The device shown is a Xicor X28256 EEPROM, which has 32K bytes of memory. Smaller devices may be used if less memory is required, and a larger device, with a full 64K bytes of memory could be supported.
![[Figure 12.1]](gif/545-28.gif)
The CY545 provides all address and strobe timing signals to the memory. Signals involved are the data bus, XMEM_SEL, ALE, WR, and RD. Special use is made of the data bus, which provides all 16 bits of address, plus the actual data transfers. Two external latches are required to hold the address. The example uses 74LS373s for this purpose.
When the CY545 reads or writes the external memory, it starts by placing the most significant address byte on the data bus. It then selects the memory by driving XMEM_SEL low. This both chip-enables the memory and latches the upper address byte into the 74LS373 which holds address lines A8 to A15. The CY545 then performs a read or write operation.
The read or write is broken into two steps. First the lower address byte is generated on the data bus. This value is latched into the other 74LS373, using the ALE signal. Then the actual data transfer occurs. For a write, the CY545 generates the write data on the data bus, along with a write strobe, WR. For a read, the data bus is floated, and a read strobe is generated, using RD, so the memory can now drive the bus.
When the memory transfer is over, the XMEM_SEL signal goes high again, de-selecting the external memory. This allows the lower address byte and RD and WR strobes to be used with other hardware as well, without interference from the memory. Only the memory uses the upper address byte.
![[Figure 12.2]](gif/545-29.gif)
As a special feature, the CY545 performs a verify read after writing to the memory. This function is provided in support of EEPROM memories, that require a long time to perform a write operation, and cannot perform another random write or read while the first one is in progress. Many of these memories support Data/ polling, in which at least one bit of data is inverted while the memory is busy writing the byte. When a read is performed, the data read does not match the data written until the write operation is complete. This change in data values indicates when the memory is ready for the next operation.
The CY545 performs the verify read repeatedly until the data matches the value written, or a time out occurs. For RAMs, the match will occur immediately, so the CY545 simply continues at that point. For an EEPROM, the match will occur after the EEPROM write is finished, and the CY545 waits during this time before going on to the next function.
You should be aware of this time period delay when using EEPROM, because it is possible to send serial characters to the CY545 faster than the EEPROM can accept them, when running the serial interface at higher baud rates. It is best to have a time delay between each character in this case, or else use the CTS signal to hold off the communications until the CY545 is ready.
Note that the parallel interface takes care of this time delay on its own, since the CY545 will stay busy while it is writing the character to the memory.
Another special feature of the CY545 is the use of the external memory to automatically run a command sequence at power-up, or whenever the CY545 is reset.
When the CY545 is reset, it will read the first three locations of the external memory. If the values read are 12H, 34H, and 56H respectively, the CY545 will then switch to the program execution mode, and start reading commands from location 00003 of the memory. This allows the CY545 to work in a stand alone mode, without any commands from a host computer or other source than the memory itself. This function is shown below:
00000.....12H.....12H
in address 0
00001.....34H.....34H
in address 1
00002.....56H.....56H
in address 2
00003 ....... ....First
CY545 command in address 3
This feature will only occur if the first three bytes have the proper key codes in them. Any other values in those locations will keep the CY545 in the direct command mode, waiting for commands from a host system before doing anything.
To set up the auto start function, simply record the data bytes 12h, 34h, and 56h, in locations 0 to 2 of the memory, followed immediately by the command sequence desired. For example:
Y 0<cr>.......Set memory pointer
address to zero
E<cr>.........Following sequence is
recorded to memory
<Ctrl-R>4V....key sequence
12h, 34h, 56h
R 125<cr>.....standard CY545 commands
follow now
F 15<cr>
..............additional start up commands
Q<cr>.........End of memory content definition
When the CY545 is now reset, it will execute the memory based commands, starting with the “R125<cr>” command, since the key sequence was found in the first three locations.
As a special convenience, you may command the CY545 to ignore the auto start command sequence, by holding the XMEM_SEL signal low while the CY545 is reset. If the signal is low, the CY545 will not test the memory contents for the 12h, 34h, 56h key sequence. Instead, the CY545 will set itself into the Command mode, and wait for commands from the serial or parallel interface.
This is especially useful during program development, where errors in the memory content must be corrected before the CY545 can run the memory based commands. Without this feature, you would be forced to remove the memory and delete the key sequence, before the CY545 could be operated with the memory again.
The sequence for bypassing the Auto Start tests is:
00 Contents ..|..
01 Intro ..|..
02 Pins & Packages ..|..
03 Cmd Interfaces ..|..
04 Commands..|..
05 Motor Cmds
06 Bit Cmds..|..
07 Memory Cmds..|..
08 Prog Branch Cmds..|..
09 Mode Cmds ..|..
10 Misc Cmds
11 Circuits ..|..
12 External Memory ..|..
13 Thumbwheel Switch
..|.. 14 Output
Display ..|..
15 Proto Boards
16 Timing & Control
..|.. 17 Rate
Tables ..|..
18 Electrical Specs ..|..
19 Examples ..|..
20 Up & Running
Back to CY545 Data Sheet
© 1988 - 1999 Cybernetic Micro Systems, Inc.
All rights reserved.
CY545 Manual 22MAR99