Arduino Explorer

by Mark Sproul
March 2010

Arduino Explorer is a program for the Arduino It allows you to examine memory, examine and toggle I/O pins, explore the mapping of Arduino pin numbers to AVR port names and bit numbers, Scan I2C bus. Look at interrupt vectors and much more.

This will allow you to debug hardware, both existing hardware that has problems and help with the development of new hardware. For example, I needed to update the core files for the Liquidware TouchShield-Slide. By using this program I was able to figure out the correct pin mappings for pins_arduino.c.

This program evolved as I was learning the AVR processor coming from the Arduino environment.

Click here to download ArduinoExplorer.zip
Unzip the file and put the folder in your sketches directory. Then restart the Arduino IDE.

To use the program, download it to your Arduino and then open an interactive terminal window to talk to the Arduino.

On the mac, the best way to do this is to open a terminal window and type

	screen /dev/tty.usbserial-A7005rvf 
where the tty.usbserial is what every your devices shows up as. Then you can type 1 letter commans as in the table below.

Operational notes:

I have tested this on the following boards. It should work on all Arduinos however the names for the interrupts may not be present on other versions of the cpu.
Arduino Duemilanove __AVR_ATmega168__
Arduino Duemilanove __AVR_ATmega328P__
Arduino Mega __AVR_ATmega1280__
Liquidware Illuminato __AVR_ATmega645__
Duino644 __AVR_ATmega644__
Sanguino __AVR_ATmega644P__
Teensy 2 __AVR_ATmega32U4__
Teensy++ 2 __AVR_AT90USB1286__
? Help Print help
B Blink LED Blink the LED pin (pin 13 on the Duemilanove and Mega)
D Disk Read Show the first sector of an SD card if attached, uses the standard SDuFat library
E Dump EEPROM Dump the contents of EEPROM in hex and ASCII
F Dump FLASH Dump the contents of FLASH in hex and ASCII
I I2C scan Scan the I2C bus and report whats there
M Map I/O pins this shows the mapping from Arduino pin numbers to AVR port name / bit number
P Show ONE pin Continusouly read one pin and report its state. hit any key to stop
R Dump RAM Dump the contents of RAM in hex and ASCII
S Show pins Show the state of all pins
T Play Tone Some boards such as the Duino644 have a buzzer, turn it on
V Show interrupt vectors This dumps the interrupt vector table
W Watch for input change Watch all input pins and report any changes
X Port ouput, blink all 8 bits in a port by port letter This is an AVR command, it turns on all the bits in the port letter specified
0 Zero address counters Zero the page counters for dumping Ram and flash
Arduino>?
0=Zero address counters
?=Help
B=Blink LED
E=Dump EEPROM
F=Dump FLASH
I=I2C scan
M=Map I/O pins
P=Show ONE pin
R=Dump RAM
S=Show pins
T=Play Tone
W=Watch for input
X=Port blink
Arduino>


Arduino>I
starting scanning of I2C bus from 1 to 127...
addr:1          addr:2          addr:3          addr:4       
addr:5          addr:6          addr:7          addr:8       
addr:9          addr:10         addr:11         addr:12       
addr:13         addr:14         addr:15         addr:16       
addr:17         addr:18         addr:19         addr:20       
addr:21         addr:22         addr:23         addr:24       
addr:25         addr:26         addr:27         addr:28       
addr:29         addr:30         addr:31         addr:32       
addr:33         addr:34         addr:35         addr:36       
addr:37         addr:38         addr:39         addr:40       
addr:41         addr:42         addr:43         addr:44       
addr:45         addr:46         addr:47         addr:48       
addr:49         addr:50         addr:51         addr:52       
addr:53         addr:54         addr:55         addr:56       
addr:57         addr:58         addr:59         addr:60       
addr:61         addr:62         addr:63         addr:64       
addr:65         addr:66         addr:67         addr:68       
addr:69         addr:70         addr:71         addr:72       
addr:73         addr:74         addr:75         addr:76       
addr:77 found!  addr:78         addr:79         addr:80       
addr:81         addr:82         addr:83         addr:84       
addr:85         addr:86         addr:87         addr:88       
addr:89         addr:90         addr:91         addr:92       
addr:93         addr:94         addr:95         addr:96       
addr:97         addr:98         addr:99         addr:100       
addr:101        addr:102        addr:103        addr:104       
addr:105        addr:106        addr:107        addr:108       
addr:109        addr:110        addr:111        addr:112       
addr:113        addr:114        addr:115        addr:116       
addr:117        addr:118        addr:119        addr:120       
addr:121        addr:122        addr:123        addr:124       
addr:125        addr:126        addr:127        
I2C device count = 1
Arduino>

Arduino>F
0000 - 0C 94 63 00 0C 94 8B 00 0C 94 8B 00 0C 94 8B 00 ..c.............
0010 - 0C 94 8B 00 0C 94 8B 00 0C 94 8B 00 0C 94 8B 00 ................
0020 - 0C 94 8B 00 0C 94 8B 00 0C 94 8B 00 0C 94 8B 00 ................
0030 - 0C 94 8B 00 0C 94 8B 00 0C 94 8B 00 0C 94 8B 00 ................
0040 - 0C 94 15 0D 0C 94 8B 00 0C 94 BB 09 0C 94 8B 00 ................
0050 - 0C 94 8B 00 0C 94 8B 00 0C 94 8B 00 0C 94 8B 00 ................
0060 - 0C 94 BF 04 0C 94 8B 00 00 00 00 00 24 00 27 00 ............$.'.
0070 - 2A 00 00 00 00 00 25 00 28 00 2B 00 00 00 00 00 *.....%.(.+.....
0080 - 23 00 26 00 29 00 04 04 04 04 04 04 04 04 02 02 #.&.)...........
0090 - 02 02 02 02 03 03 03 03 03 03 01 02 04 08 10 20 ............... 
00A0 - 40 80 01 02 04 08 10 20 01 02 04 08 10 20 00 00 @...... ..... ..
00B0 - 00 07 00 02 01 00 00 03 04 06 00 00 00 00 00 00 ................
00C0 - 00 00 5A 04 40 0B 11 24 1F BE CF EF D8 E0 DE BF ..Z.@..$........
00D0 - CD BF 12 E0 A0 E0 B1 E0 E2 EB FC E1 02 C0 05 90 ................
00E0 - 0D 92 A8 30 B1 07 D9 F7 13 E0 A8 E0 B2 E0 01 C0 ...0............
00F0 - 1D 92 A0 3D B1 07 E1 F7 10 E0 C6 EC D0 E0 04 C0 ...=............
Arduino>

Arduino>R
0000 - C6 00 BC 08 00 00 00 00 08 00 00 00 00 00 0E 00 ................
0010 - 00 00 05 00 30 08 00 08 E8 00 CC 02 BB 08 1E 00 ....0...........
0020 - 60 60 60 00 00 00 30 00 30 01 00 01 00 00 00 60 ```...0.0......`
0030 - 60 60 60 60 60 06 07 07 60 60 60 00 00 00 00 00 `````...```.....
0040 - FF FF 01 00 03 03 B2 00 00 00 00 00 00 00 00 60 ...............`
0050 - 30 FF 60 00 00 00 60 00 60 60 60 00 60 BB 08 82 0.`...`.```.`...
0060 - 00 00 60 60 00 60 AC 60 00 00 60 00 00 00 01 00 ..``.`.`..`.....
0070 - 00 60 60 60 60 60 60 60 00 00 87 00 00 60 00 00 .```````.....`..
0080 - 01 03 00 60 B8 00 00 00 00 00 00 00 60 60 60 60 ...`........````
0090 - 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 ````````````````
00A0 - 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 ````````````````
00B0 - 01 04 74 00 00 60 00 60 48 F8 FE FE 45 00 60 60 ..t..`.`H...E.``
00C0 - 40 98 06 60 67 00 66 60 60 60 60 60 60 60 60 60 @..`g.f`````````
00D0 - 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 ````````````````
00E0 - 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 ````````````````
00F0 - 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 ````````````````
Arduino>

Arduino>M
CPU Type         = ATmega328P
Digital pin  0 = D  0  RX Data
Digital pin  1 = D  1  TX Data
Digital pin  2 = D  2
Digital pin  3 = D  3  Timer 7
Digital pin  4 = D  4
Digital pin  5 = D  5  Timer 2
Digital pin  6 = D  6  Timer 1
Digital pin  7 = D  7
Digital pin  8 = B  0
Digital pin  9 = B  1  Timer 3
Digital pin 10 = B  2  Timer 4
Digital pin 11 = B  3  Timer 6
Digital pin 12 = B  4
Digital pin 13 = B  5
Digital pin 14 = C  0  Analog Input 0
Digital pin 15 = C  1  Analog Input 1
Digital pin 16 = C  2  Analog Input 2
Digital pin 17 = C  3  Analog Input 3
Digital pin 18 = C  4  Analog Input 4
Digital pin 19 = C  5  Analog Input 5



Arduino>S
Pin # 2 0
Pin # 3 0
Pin # 4 0
Pin # 5 0
Pin # 6 0
Pin # 7 0
Pin # 8 0
Pin # 9 0
Pin # 10 0
Pin # 11 0
Pin # 12 0
Pin # 13 0

Analog Pin # 0 511
Analog Pin # 1 423
Analog Pin # 2 417
Analog Pin # 3 416
Analog Pin # 4 999
Analog Pin # 5 1001

Arduino>V
V#   ADDR   Vector      inst        Interrupt
 1 - 0000 = C2 B8 00 00 rjmp 02B8   RESET
 2 - 0002 = C2 DE 00 00 rjmp 02DE   INT0
 3 - 0004 = C2 DC 00 00 rjmp 02DC   INT1
 4 - 0006 = C2 DA 00 00 rjmp 02DA   PCINT0
 5 - 0008 = C2 D8 00 00 rjmp 02D8   PCINT1
 6 - 000A = C2 D6 00 00 rjmp 02D6   PCINT2
 7 - 000C = C2 D4 00 00 rjmp 02D4   WDT
 8 - 000E = C2 D2 00 00 rjmp 02D2   TIMER2 COMPA
 9 - 0010 = C2 D0 00 00 rjmp 02D0   TIMER2 COMPB
10 - 0012 = C2 CE 00 00 rjmp 02CE   TIMER2 OVF 
11 - 0014 = C2 CC 00 00 rjmp 02CC   TIMER1 CAPT
12 - 0016 = C2 CA 00 00 rjmp 02CA   TIMER1 COMPA
13 - 0018 = C2 C8 00 00 rjmp 02C8   TIMER1 COMPB 
14 - 001A = C2 C6 00 00 rjmp 02C6   TIMER1 OVF
15 - 001C = C2 C4 00 00 rjmp 02C4   TIMER0 COMPA
16 - 001E = C2 C2 00 00 rjmp 02C2   TIMER0 COMPB
17 - 0020 = 94 0C 15 5D jmp  00155D TIMER0 OVF 
18 - 0022 = C2 BE 00 00 rjmp 02BE   SPI, STC
19 - 0024 = 94 0C 17 3A jmp  00173A USART0, RX
20 - 0026 = C2 BA 00 00 rjmp 02BA   USART0, UDRE
21 - 0028 = C2 B8 00 00 rjmp 02B8   USART0, TX
22 - 002A = C2 B6 00 00 rjmp 02B6   ADC
23 - 002C = C2 B4 00 00 rjmp 02B4   EE READY
24 - 002E = C2 B2 00 00 rjmp 02B2   ANALOG COMP
25 - 0030 = C7 13 00 00 rjmp 0713   TWI
26 - 0032 = C2 AE 00 00 rjmp 02AE   SPM READY
Arduino>