0% found this document useful (0 votes)
21 views8 pages

Handheld Debugger User Manual

The Handheld Debugger V1.0 is designed to simplify debugging of digital circuits by allowing bit-by-bit data transmission and supporting complex operations like SPI and I2C. It features various inputs and outputs, configurable ports and pins, and supports multiple command configurations for different tasks. The manual details the operation, configuration commands, and tasks for both ports and pins, enabling users to effectively utilize the device for debugging purposes.

Uploaded by

lechurz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views8 pages

Handheld Debugger User Manual

The Handheld Debugger V1.0 is designed to simplify debugging of digital circuits by allowing bit-by-bit data transmission and supporting complex operations like SPI and I2C. It features various inputs and outputs, configurable ports and pins, and supports multiple command configurations for different tasks. The manual details the operation, configuration commands, and tasks for both ports and pins, enabling users to effectively utilize the device for debugging purposes.

Uploaded by

lechurz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Handheld debugger user manual

Hardware, software & this document created by


Majsterkowanie i nie tylko (MINT) (c) 2024 – 2025

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.

Debugger input voltage range is 7-12V, it is regulated down to


either 5V or 3.3V (selectable with a jumper). Device has various
inputs & outputs including power outputs, pull-up & pull-down
resistors, input-only rail with LED state indicators, 3 I/O
ports 8 bits each, 2 multi-function I/O pins, control buttons
and command word input switch. All of its onboard elements are
well described with labels.

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

Sets selected port as an input.

• SIMPLE_OUT
Command word: ss000001 (0x01)
Additional data: none

Sets selected port as an output. Its value can be assigned


directly.

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

Sets selected port as an output. Its value can be easily


incremented and decremented.

• MEMORY
Command word: 00000011 (0x03)
Additional data: memory contents

Sets selected port as an output. Its value can be loaded from


memory which is easily editable.

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

No action for PORT 1 & 2. PORT3 can enable (p=1) or disable


(p=0) its pullup resistors.

• 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]

Data from the CMD switch is added to selected port current


value. Most significant bit is the sign bit.

• MEMORY
Input data format: [address]

Data from the selected memory address is written into the


selected port.
If PORT3 has special function 1 activated, it will show the currently
selected address. When both PORT1 and PORT2 are in the MEMORY mode, switching
between them will update address value on PORT3 depending on which address
is selected for each port.

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

Pin in this configuration can be either input or output. Check


pin task description for details.

• CLOCK
Command word: 00000001 (0x01)
Additional data: clock configuration

Sets selected pin as a clock output. Prompts for single byte of


additional data in the following format: pmmsssss

p – polarity bit. 0 means clock low when idle, 1 means high.


mm – multiplier bits. See the table below.

mm multiplier
00 x10µs
01 x100µs
10 x1ms
11 x10ms

sssss – speed bits. Time between clock edges can be calculated as


speed_bits * multiplier. Clock period is twice that value.

• SPI_8
Command word: 00000010 (0x02)
Additional data: none

Configures selected pin as SPI clock.

PORT3 must be in SIMPLE_OUT mode with special function 2 in order to enter


SPI_8 mode on a pin. Otherwise, PORT3 selection LED will blink showing an
error. If SPI_8 mode was entered successfully, PORT3 will serve as CS, DI &
DO lines which will be initialized with idle state logic levels. From now
on, PORT3 configuration can be changed only after disabling SPI. Attempt to
switch its mode when SPI is active results in an error.

5
Handheld debugger V1.0
• SPI_LONG
Command word: 00000011 (0x03)
Additional data: none

Configuration goes the same way as for SPI_8 mode.

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

Configures selected pin as I2C clock and sends START condition.

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

Configures selected pin as I2C clock and prepares for data


reception.

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

Different tasks can be performed based on input data.

d – direction bit. 1 means output, 0 means input.


c – clock function. Activated when c = 1.
p – clock polarity. 1 means high when idle, 0 means low.
t – clock ticks. Number of ticks will be ttt + 1.
f – flip bit. When set to 1, pin value will be inverted
s – state bit. If both c and f are 0, pin value will be set to s.

If d = 0, other bits are ignored. When c = 1, f and s are ignored.


When f = 1, s is ignored.

• CLOCK
Input data format: [clock ticks]

Outputs desired number of clock cycles (from 0 to 255).

• 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.

PORT3 line SPI / I2C line


Q0 master data out 1 (debugger is the master) / SDA1
Q1 slave data in 1 (data coming from slave) / -
Q2 CS1 / ACK out 1
Q3 -
Q4 master data out 2 / SDA2
Q5 slave data in 2 / -
Q6 CS2 / ACK out 2
Q7 -
Q0 – Q2 serve additional lines for pin 1. Q4-Q6 serve lines for pin 2. It
is not recommended to perform any port write operations when SPI transaction
is in progress (CS is low). Writing the ports overwrites PORT3 for a short
amount of time. Changes of CS line may abort the transaction.

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.

nnnn – number of bytes to send. Received bytes will be stored in memory


starting from the middle address.

PORT3 serves additional lines. See SPI_8 for details.

• I2C_TR
Input data format: [transmitted data]

Sends input data over I2C. START condition is generated when


configuring the pin.

PORT3 serves additional lines including ACK / NACK indication. See SPI_8 for
details.

• I2C_RC
Input data format: xxxxxxxa

Receives byte over I2C and stores it at the middle memory


address.

a – ack bit. Acknowledge for the slave is generated when a=1.

PORT3 serves additional lines. See SPI_8 for details.

8
Handheld debugger V1.0

You might also like