The Display (or "Dump") commands

The syntax of the "D" command is:
D[[ES|SE]|[E]|[F|P]|[R|S]|[U|V]|N][H|I][8][+][-][=][~] [[Start] [Count|[- End]]
  where "ES" (or "SE") is a special mnemonic meaning "Display EEPROM System",
  "E" selects EEPROM as the data type,
  "F" or "P" selects FLASH (or PROGRAM) memory as the data type,
  "R" or "S" selects RAM or SRAM as the data type (the default unless "E", "F" or "P" are specified),
  "U" or "V" selects the User Variables,
  "N" selects the nRF24L01 memory structure,
  "H" or "I" changes the output from DEBUG style to iHEX text output,
  "8" limits the line width to 8 data bytes in iHex output,
  "+" generates the output in the FOREGROUND instead of the (default) BACKGROUND,
  "-" omits printing "SRAM contents:" or "EEPROM contents:" or "FLASH (program memory) contents:",
  "=" omits printing the iHEX Extended Segment record (only applies to iHEX mode),
  "~" omits printing the iHEX End-Of-File record (only applies to iHEX mode),
  Start  is the optional starting address in either decimal or hexadecimal format, and
  Count  is the optional number of bytes to be output (or)
  - End  is the optional final address to be output,
Notes:
  No distinction is made between uppercase and lowercase commands.
  Select either none or only one from this memory type set: "E", "ES", "F", "N", "P", "R", "S", "SE", "U", or "V".
  If "DES" or "DSE" is input, every character which follows that will be ignored.
  The "H" or "I" option is a modifier to any of the memory type options (except "DES" and "DSE".)
  The "8" option is only valid with the "H" option, so it also selects it.
  Either, or both, or neither of the "+" and "-" options may be used.
  The options above are mostly order independent but MUST occur BEFORE the first space.
  The starting address, ending address, and count may be specified in decimal or hexadecimal format.
  Sending a BACKSPACE while output is being generated in the BACKGROUND ends the output.

There are quite a few options, but since this is only dumping (or displaying) memory and not changing it, please try some to get the feel for them. In the examples which follow on this page and all the other manual pages, each command that was (or is to be) input is shown in this text style. Comments (i.e, unquoted text which begin with a ';') in this style may be omitted, of course.

The first example displays the EEPROM system variables, which are the first 80 bytes of EEPROM:
(Refer to the EEPROM map manual page for more information about each is used.)
Also note that the "DES" (or "DSE") command output is always generated in the FOREGROUND, which means that it cannot be terminated prematurely.

>DES
EEPROM contents:
0000:  00 20 01 00 01 01 80 FF-08 20 FF FF 28 3C FF FF  . ....... ..(<..
0010:  C0 00 3F FF A0 08 03 FF-FF 25 FF FF FF FF FF FF  ..?......%......
0020:  28 05 FF FF 10 FF FF FF-FF 14 FF 20 00 30 FF 10  (.......... .0..
0030:  FF FF 06 00 FF FF FF FF-FF FF FF FF FF FF FF FF  ................
0040:  FF FF FF FF FF FF FF FF-50 00 FF FF 70 03 D0 03  ........P...p...
>                                                                               
The command "D" below will perform a BACKGROUND dump of all SRAM. Since the last address in an ATmega328P is 0x08FF, this may generate more data output than is desired. It will certainly overflow the screen page. Press the BACKSPACE key while printing in the BACKGROUND to terminate the output prematurely.
>d  ; That semicolon marked the beginning of a comment
SRAM contents:
>0000:  00 00 58 1E 40 09 28 FF-10 16 00 00 0C 00 A9 08  ..X.@.(.........
0010:  10 0E 01 82 02 00 00 2E-2D 00 FF 08 B6 08 1F 00  ........-.......
0020:  B8 B8 B8 81 A7 81 00 3F-00 8F 70 8C B8 B8 B8 B8  .......?..p.....
0030:  B8 B8 B8 B8 B8 06 27 07-B8 B8 B8 00 00 00 02 00  ......'.........
0040:  FF 1A 00 00 03 03 06 00-00 B8 02 82 00 00 00 B8  ................
0050:  00 FF 15 00 00 02 B8 00-B8 B8 B8 00 B8 A5 08 83  ................
0060:  00 00 B8 B8 00 B8 BE B8-00 00 B8 00 00 00 01 00  ................
0070:  00 B8 B8 15 B8 B8 B8 B8-77 01 87 00 40 B8 00 00  ........w...@...
0080:  01 03 00 B8 7E 00 EC 00-00 00 00 00 B8 B8 B8 B8  ....~...........
0090:  B8 B8 B8 15 B8 B8 35 B8-B8 B8 B8 B8 B8 B8 B8 B8  ......5.........
00A0:  15 B8 B8 B8 B8 B8 B8 B8-B8 B8 B8 B8 B8 B8 B8 B8  ................
00B0:  01 04 EE 00 00 B8 00 B8-00 F8 FE FF 00 00 B8 B8  ................
00C0:  42 B8 06 B8 10 00 36 B8-B8 B8 B8 B8 B8 B8 B8 B8  B.....6.........
00D0:  B8 B8 B8 01 B8 B8 35 B8-B8 B8 B8 B8 B8 B8 B8 B8  ......5.........
00E0:  B8 B8 B8 23 B8 B8 35 B8-B8 35 B8 B8 B8 B8 B8 B8  ...#..5..5......
00F0:  B8 B8 B8 15 B8 B8 35 B8-B8 15 B8 B8 B8 B8 B8 B8  ......5.........
  (BACKSPACE)                                                                   
Note that the system prompt for the next line (the ">") occurred before the first line of data was output and it also caused the first line to be shifted to the right one position. This happens during BACKGROUND output, since the system resumes and continues its other tasks, only generating output when there is room in the output buffer for another full line.

To place the ">" prompt after the entire output, use the "+" option. This causes the output to be generated in the FOREGROUND, does not cause the first data line to shifted right, but also ignores the BACKSPACE during output and, most importantly, stops all other processing until printing is complete. This will take some time if, for example, "DF+" were used. That would dump all displayable FLASH memory (which is nearly half of the total 32KBytes of FLASH memory available in an ATmega328P.)

To generate the same output as shown above in the FOREGROUND, enter the command using this syntax:

>D+ 0 256
SRAM contents:
0000:  00 00 0B 0A 94 09 28 FF-10 09 00 00 0C 00 7C 08  ......(.......|.
0010:  10 0E 01 82 00 00 00 2E-2D 00 FF 00 89 08 1F 00  ........-.......
0020:  01 B8 B8 81 A7 81 00 3F-00 8F 70 8C B8 B8 B8 B8  .......?..p.....
0030:  15 B8 B8 B8 B8 06 27 07-B8 B8 B8 00 00 00 02 00  ......'.........
0040:  FF 1A 00 00 03 03 3F 00-00 B8 46 80 00 00 00 B8  ......?...F.....
0050:  00 FF B8 00 00 02 35 00-B8 B8 B8 00 B8 78 08 83  ......5......x..
0060:  00 00 B8 35 00 B8 BE B8-00 00 B8 00 00 00 01 00  ...5............
0070:  00 B8 B8 15 B8 B8 B8 B8-77 01 87 00 40 B8 00 00  ........w...@...
0080:  01 03 00 B8 7E 00 EC 00-00 00 00 00 B8 B8 B8 B8  ....~...........
0090:  B8 B8 B8 15 B8 B8 35 B8-B8 B8 B8 B8 B8 B8 B8 B8  ......5.........
00A0:  15 B8 B8 B8 B8 B8 B8 B8-B8 B8 B8 B8 B8 B8 B8 B8  ................
00B0:  01 04 EE 00 00 B8 00 B8-00 F8 FE FF 00 00 B8 B8  ................
00C0:  42 B8 06 B8 10 00 36 B8-B8 B8 B8 B8 B8 B8 B8 B8  B.....6.........
00D0:  B8 B8 B8 01 B8 B8 35 B8-B8 B8 B8 B8 B8 B8 B8 B8  ......5.........
00E0:  B8 B8 B8 23 B8 B8 35 B8-B8 35 B8 B8 B8 B8 B8 B8  ...#..5..5......
00F0:  B8 B8 B8 15 B8 B8 35 B8-B8 15 B8 B8 B8 B8 B8 B8  ......5.........
>                                                                               
One might note that the output above happens to be all of the ATmega328P internal REGISTER memory.

To display the first 80 bytes of EEPROM, the "DES" command was used in the first example at the top of the page. A good idea is to save the System EEPROM configuration occasionally. Use a command such the one shown in the following example to do this.

>de+i 0 80
EEPROM contents:
:02000002E0001C
:1000000000200100010180FF0820FFFF283CFFFFC6
:10001000C0003FFFA00803FFFF25FFFFFFFFFFFF1A
:100020002805FFFF10FFFFFFFF14FF200030FF1027
:10003000FFFF0600FFFFFFFFFFFFFFFFFFFFFFFFC8
:10004000FFFFFFFFFFFFFFFF5000FFFF7003D00324
:00000001FF
>                                                                               
"DEI+ 0 - 0x4F" and "D+EH 0 0x50", for example, generate the very same output. Copy the output generated to a file to save the configuration. Refer to the iHex manual page to see how to restore the System EEPROM configuration from that file. To output the entire EEPROM contents in iHEX format, use "DEH+" or "DEH+-", for example.

The command below displays the contents of the present User Variable array.

>DV+
SRAM contents:
0280:  0C E2 1C 02 FF 40 00 20-A0 78 FF 01 20 00 FF FF  .....@. .x.. ...
0290:  ED 0F 59 3B 00 00 00 00-00 00 00 00 00 00 00 00  ..Y;............
02A0:  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
02B0:  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
>                                                                               
To display the contents of the nRF24L01 memory structure:
>DN+
SRAM contents:
0200:  0E 00 00 00 00 00 D1 00-D0 07 00 00 00 00 2A 00  ..............*.
0210:  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
0220:  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
>                                                                               
To display a portion of the contents of the FLASH memory, starting at sample Sequencing routines which originally came with the Operating System, beginning at address 0x0100 and continuing for the next 239 bytes:
>df+ 0x100 0xF0
FLASH (program memory) contents:
0100:  53 65 74 75 70 20 61 74-20 30 78 31 31 30 3A 00  Setup at 0x110:.
0110:  11 24 F0 90 1B 01 11 E1-1F 0D 81 17 10 F4 C8 0F  .$..............
0120:  D1 1D B9 80 CA 80 DB 80-EC 80 AD 81 BE 81 1F 81  ................
0130:  28 85 39 85 5B 2D 5F 70-6A 2F 6B 2B 65 9F 01 28  (.9.[-_pj/k+e..(
0140:  B9 F1 11 24 92 E0 80 EA-8F 0D 91 1D EE 85 FF 85  ...$............
0150:  F8 30 18 F4 E8 17 F9 07-08 F4 FC 01 B1 70 AD 01  .0...........p..
0160:  4A 0F 5B 1F 4A 0F 5B 1F-1F 01 41 93 51 93 08 95  J.[.J.[...A.Q...
0170:  4F 75 74 70 75 74 20 61-74 20 30 78 31 38 32 3A  Output at 0x182:
0180:  20 00 89 81 EA E3 3C DF-09 F4 88 E2 AC 01 F1 01   .....<.........
0190:  61 91 71 91 CF 01 E8 E7-33 CF 20 20 20 20 20 20  a.q.....3.
01A0:  45 78 69 74 20 61 74 20-30 78 31 42 30 3A 20 00  Exit at 0x1B0: .
01B0:  E1 E0 26 CF 20 20 45 78-61 6D 70 6C 65 20 61 74  ..&.  Example at
01C0:  20 30 78 31 43 38 3A 00-E0 E0 1A DF A1 DF EB E7   0x1C8:.........
01D0:  17 DF 7B 32 69 F7 EC E7-13 DF EA CF 00 00 00 00  ..{2i...........
01E0:  3D 3D 3D 3D 3D 3D 3D 3D-3D 3D 3D 3D 3D 3D 3D 3D  ================
>                                                                               
or, to capture it in iHEX, use this (or "dh+f- 0x100 - 0x1ef"):
>DH+F 0x100 0xf0
FLASH (program memory) contents:
:1001000053657475702061742030783131303A0055
:100110001124F0901B0111E11F0D811710F4C80F7D
:10012000D11DB980CA80DB80EC80AD81BE811F818A
:10013000288539855B2D5F706A2F6B2B659F0128A1
:10014000B9F1112492E080EA8F0D911DEE85FF85B3
:10015000F83018F4E817F90708F4FC01B170AD01A4
:100160004A0F5B1F4A0F5B1F1F0141935193089574
:100170004F75747075742061742030783138323A5C
:1001800020008981EAE33CDF09F488E2AC01F10157
:1001900061917191CF01E8E733CF2020202020200A
:1001A000457869742061742030783142303A2000FB
:1001B000E1E026CF20204578616D706C6520617488
:1001C0002030783143383A00E0E01ADFA1DFEBE776
:1001D00017DF7B3269F7ECE713DFEACF000000009E
:1001E0003D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3D3F
:00000001FF
>                                                                               
To generate the iHex output in the 8-data-byte-wide format instead of the default 16-byte wide format (as shown above), just place the "8" modifier somewhere before the first space. This format allows a complete line of iHex to be transmitted over the nRF24L01 radio, for example.
>D+F8 0x100 240
FLASH (program memory) contents:
:080100005365747570206174F1
:080108002030783131303A005B
:080110001124F0901B0111E124
:080118001F0D811710F4C80F40
:08012000D11DB980CA80DB800B
:08012800EC80AD81BE811F8156
:08013000288539855B2D5F7005
:080138006A2F6B2B659F012863
:08014000B9F1112492E080EAFC
:080148008F0D911DEE85FF856E
:08015000F83018F4E817F90774
:0801580008F4FC01B170AD01D7
:080160004A0F5B1F4A0F5B1FF1
:080168001F014193519308951A
:080170004F7574707574206175
:08017800742030783138323A6E
:0801800020008981EAE33CDF65
:0801880009F488E2AC01F10169
:0801900061917191CF01E8E7D4
:0801980033CF2020202020209D
:0801A0004578697420617420A8
:0801A80030783142303A2000AA
:0801B000E1E026CF2020457894
:0801B800616D706C652061743B
:0801C0002030783143383A0089
:0801C800E0E01ADFA1DFEBE724
:0801D00017DF7B3269F7ECE751
:0801D80013DFEACF0000000074
:0801E0003D3D3D3D3D3D3D3D2F
:0801E8003D3D3D3D3D3D3D3D27
:00000001FF
>                                                                               
To display the contents of the FLASH memory, starting at the System Text block (which begins at 0x3A00), as another example, use a command similar to the following:
>DF+ 0x3A00 80
FLASH (program memory) contents:
3A00:  4A 65 73 75 73 20 69 73-20 4C 4F 52 44 21 00 43  Jesus is LORD!.C
3A10:  61 75 73 65 20 6F 66 20-74 68 65 20 6C 61 73 74  ause of the last
3A20:  20 72 65 73 65 74 3A 20-00 69 6E 69 74 69 61 6C   reset: .initial
3A30:  20 70 6F 77 65 72 2D 75-70 00 65 78 74 65 72 6E   power-up.extern
3A40:  61 6C 20 52 45 53 45 54-20 70 69 6E 20 70 75 6C  al RESET pin pul
>                                                                               

There are so many more combinations to explore, that it seems better to simply get in and try some of them in order to know how to determine, and even save, the contents of any of the 3 types of memory.

Also note that all of the examples were generated using Preformatted TEXT HTML, which means that they (as well as the output) can each be copied and pasted into your command console. That explicitly means that the FLASH program iHEX example can be restored by using the output listed above.