Handheld Debugger User Manual
Handheld Debugger User Manual
1
Handheld debugger V1.0
1. Introduction
This handheld debugger that currently does not have its name is
designed to make first steps of debugging digital circuits
easier. It allows the user to send and receive data bit-by-bit
without going through breadboard hell and debouncing issues. It
also supports more complex operations like byte increment /
decrement, clock pulse generation, SPI, I2C, etc. Doing that
stuff with bare hands will no longer be necessary.
2. Device operation
After power-on, all ports and pins are configured as inputs.
Their state is indicated by LEDs next to them. Each port and
pin can be configured by sending configuration commands to it.
Command destination can be selected with PORT CHG & PIN CHG
buttons. Green LEDs indicate which port and pin is selected.
Ports and pins form two separate groups that can either work
independently or be joined for more complex tasks.
Configured ports and pins, from now on called I/Os, can perform
different tasks based on their configuration. Tasks are
initiated by PORT EXEC button for ports and by PIN EXEC button
for pins. Each task can fetch input data from the CMD input
switch. This switch is also used as data input for
configuration. To configure an I/O, EXEC button has to be pushed
while holding a CHG button. This will send the configuration
command to the selected I/O. Some commands require additional
data input.
2
Handheld debugger V1.0
3. Port configuration commands
Command is sent by holding PORT CHG & pushing PORT EXEC. Command
word and additional data (if required) is entered on a CMD switch.
The list below describes available port commands.
• INPUT
Command word: 00000000 (0x00)
Additional data: none
• SIMPLE_OUT
Command word: ss000001 (0x01)
Additional data: none
ss bits have effect only when PORT3 is selected. They specify special
function activated for this port. See the table below.
ss Special function
00 none (basic output port)
01 show memory read address for selected port upon task execution
10 SPI CS, DI & DO lines / I2C SDA lines
11 reserved
• INC_OUT
Command word: 00000010 (0x02)
Additional data: none
• MEMORY
Command word: 00000011 (0x03)
Additional data: memory contents
After sending MEMORY command, port selection LED will turn off indicating
memory data prompt. Loaded values are set on the CMD switch, address is
selected by PORT CHG (address increment) and PIN OUT (address decrement).
Except PORT3, current address is displayed on PORT3 indication LEDs
(rightmost port). Data is loaded after pushing PORT EXEC. Port being
configured displays the data currently loaded to a selected address. PIN CHG
terminates data loading and resumes normal operation. Memory contents are
preserved between commands, MEMORY command can be used at any time to edit
them. All ports share the same memory, so data entered once can be available
on all 3 ports.
3
Handheld debugger V1.0
4. Port tasks
After initiating a port task, ports will behave differently based on
their configuration. Task is initiated with PORT EXEC, data is
entered on a CMD switch. List below describes the relation between
configuration and performed task.
• INPUT
Input data format: xxxxxxxp
• SIMPLE_OUT
Input data format: [straight binary value]
If none of the pins is configured for SPI nor I2C, data from the
CMD switch is written into selected port. If SPI or I2C is in
use, but selected port is either PORT1 or PORT2, same thing
happens.
Only when PORT3 is selected and SPI or I2C is used, CS line will deselect
the SPI device or I2C STOP condition will be sent, depending on what protocol
is assigned to selected pin. PORT3 serves additional lines for SPI and I2C
and is fixed in SIMPLE_OUT mode with special function 2 as long as protocols
are in use.
• INC_OUT
Input data format: [sign-module value]
• MEMORY
Input data format: [address]
4
Handheld debugger V1.0
5. Pin configuration commands
Command is sent by holding PIN CHG & pushing PIN EXEC. Command word
and additional data (if required) is entered on a CMD switch. The
list below describes available pin commands.
• GENERAL
Command word: 00000000 (0x00)
Additional data: none
• CLOCK
Command word: 00000001 (0x01)
Additional data: clock configuration
mm multiplier
00 x10µs
01 x100µs
10 x1ms
11 x10ms
• SPI_8
Command word: 00000010 (0x02)
Additional data: none
5
Handheld debugger V1.0
• SPI_LONG
Command word: 00000011 (0x03)
Additional data: none
PORT3 must be in SIMPLE_OUT mode with special function 2. See SPI_8 for
details.
• I2C_TR
Command word: 00000100 (0x04)
Additional data: none
PORT3 must be in SIMPLE_OUT mode with special function 2. See SPI_8 for
details.
• I2C_RC
Command word: 00000101 (0x05)
Additional data: none
PORT3 must be in SIMPLE_OUT mode with special function 2. See SPI_8 for
details.
6
Handheld debugger V1.0
6. Pin tasks
After initiating a pin task, pins will behave differently based on
their configuration. Task is initiated with PIN EXEC, data is entered
on a CMD switch. List below describes the relation between
configuration and performed task.
• GENERAL
Input data format: dcptttfs
• CLOCK
Input data format: [clock ticks]
• SPI_8
Input data format: [transmitted data]
Sends input data over SPI while receiving at the same time. Sets
CS low first.
Received byte is stored at the middle address of the memory. For 32 byte
memory it will be address 16. PORT3 serves all the additional lines required
for communication. See the table below for details.
7
Handheld debugger V1.0
• SPI_LONG
Input data format: aaaannnn
Sends multiple bytes over SPI while receiving at the same time.
Sets CS low first.
aaaa – first sent byte memory address. Subsequent bytes will be fetched from
subsequent addresses. Memory data can be loaded when configuring a port into
MEMORY mode.
• I2C_TR
Input data format: [transmitted data]
PORT3 serves additional lines including ACK / NACK indication. See SPI_8 for
details.
• I2C_RC
Input data format: xxxxxxxa
8
Handheld debugger V1.0