DS1996
5 of 19
MEMORY
The memory map in Figure 5 shows a 32-byte page called the scratchpad and additional 32-byte pages
called memory. The DS1996 cont a ins 256 pages which comprise the 65536-bit SR AM. The scr atchp ad i s
an additiona l page that acts as a buffer w hen writing to memory.
ADDRESS REGISTERS AND TRANS FER STATUS
Because of the serial dat a transfer, the DS1996 em plo ys t hree addr ess regist er s, called T A1, TA2 and E/S
(Figure 6). Registers TA1 and TA2 must be loaded with the target address to which the data will be
written o r from which d ata will be se nt t o the master up on a Read command. Reg ist er E / S acts like a b yte
counter and Transfer Status register. It is used to ver ify data integrit y wit h Write co mmands. Therefore,
t he mast er only h as read acce ss t o this regist er . T he lower 5 b it s of the E/S r egist er indicat e the addr ess of
t he last b yte t hat h as been written t o the scratchpa d. T his ad dr ess is cal led End ing O ffset . Bit 5 of the E / S
register, called PF or ”partial byte flag,” is set if the number of data bits sent by the master is not an
integ er multip le of 8. B it 6, OF or ”Over flo w,” is set if mo r e b it s ar e se nt b y t he mast er than can be stored
in the scratchpad. Note that the lowest 5 bits of the target address also determine the address wit hin the
scrat chpad, w here inter mediat e sto rage o f d ata w ill begin. T his address is ca lled byt e o ffset . If t he tar get
address for a Write command is 13CH for example, then the scratchpad will store incoming data
beginning at the byte offset 1CH and will be full after only 4 bytes. The corresponding ending offset in
this example is 1FH. For best economy of speed and efficiency, the target address for writing should
point to t he beginning o f a ne w page, i. e., t he byt e o ffset w ill be 0. T hus t he full 32-byt e cap ac ity o f t he
scratchpad is available, result ing also in the ending offset of 1FH. However, it is possible to write one or
several contiguous bytes somewhere within a page. The ending offset together with the Partial and
Overflow Flag is mainly a means to support the master checking the data integrity after a Write
co mma nd. The h ighest valued b it o f t he E/S r eg ist er, ca lled AA or Aut horizat io n Accept ed, act s as a flag
to indicate that the data stored in the scratchpad has already been copied to the target memory add r e ss.
Writing data to the scratchpad c lears this flag.
WRITING WITH VERIFICATION
To write data to the DS19 96, the scratchpad has t o be u sed as intermediat e stor ag e. F irst the master issues
t he Writ e S cr atchpad command to spec ify the desir ed tar g et ad dr ess, followed b y t he d ata t o be writ ten to
the scratchpad. In the next step, the master sends the Read Scratchpad command to read the scratchpad
and to verify data integrity. As preamble to the scratchpad data, the DS1996 sends the requested target
address TA1 and T A2 a nd t he content s of the E/S r egister . I f one of the f lag s O F or PF is set, dat a did not
arr ive co rr ect ly in t he scr at chpad. The ma st er does no t need to co nt inue r eading ; it can st art a new t rial t o
write data to the scratchpad. Similarly, a set AA flag indicates that the Write command was not
recognized by the iButton. If everyt hing went correctly, all three flags are cleared and the ending offset
indicates the address of the last byte written to the scratchpad. Now the master can continue verifying
every dat a b it . After the mast er has ver ified t he dat a, it has t o send t he Co py Scrat chpad co mma nd. Thi s
command must be followed exactly by the data of the three address registers TA1, TA2 and E/S as the
master has read them verifying the scratchpad. As soon as the iButton has received these bytes, it will
co py the dat a to the requested locatio n beg inning a t t he t ar g et address.
MEMORY FUNCTION COMMANDS
The “Memory Function Flow Chart” (Figure 7) describes the protocols necessary for accessing the
memory. An e xamp le fo llows the flowchart. The communication bet ween ma ster and DS19 96 takes place
either at regular speed (default, OD=0) or at Overdrive Speed (OD=1). If not explicitly set into the
Overdrive Mode t he DS1996 assumes regu lar speed.