Skip to content

GreenPAK Universal Dev Board 1

whitequark edited this page Jul 4, 2016 · 33 revisions

This page describes the USB protocol used by the GreenPAK Universal Dev Board 1, as shipped in the GreenPAK 4 Development Kit and probably others as well. Protocol RE is done by @whitequark with board revision v1.3.1 and firmware v2.4.

Protocol

The protocol is based on USBHID. It uses interrupt URBs, always with a 63 byte payload. All numbers below are in hexadecimal.

Overall URB payload format:

Offset Length Meaning
00 01 HID report number, always 01
01 02 Packet type
03 01 Padding, always zero

Packets

WRITE 2104

This packet turns the STATUS LED on and off.

Offset Length Meaning
04 01 STATUS LED enabled

READ 213f

Read back for WRITE 2104.

WRITE 0439

This packet configures the I/O buffers, LEDs, and the expansion connector.

Format (everything not specified here was always observed as zeroed):

Offset Length Meaning
04 02 TP2 output configuration
06 02 TP3 output configuration
08 02 TP4 output configuration
0a 02 TP5 output configuration
0c 02 TP6 output configuration
0e 02 TP7 output configuration
10 02 TP8 output configuration
12 02 TP9 output configuration
14 02 TP10 output configuration
16 02 TP12 output configuration
18 02 TP13 output configuration
1a 02 TP14 output configuration
1c 02 TP15 output configuration
1e 02 TP16 output configuration
20 02 TP17 output configuration
22 02 TP18 output configuration
24 02 TP19 output configuration
26 02 TP20 output configuration
2f 03 Expansion connector configuration
32 01 TP3..TP6 LED configuration
33 01 TP7..TP10 LED configuration
34 01 TP12..TP15 LED configuration
35 02 TP16..TP20 LED configuration
37 01 "POWER" LED status? Always 01

TPx output configuration:

Value Meaning
0200 N/C
0c01 VDD
0c00 GND
0e01 Pull-up
0e00 Pull-down
0c03 Logic generator, push-pull
0403 Logic generator, open-drain + pull-up
0603 Logic generator, open-drain + pull-down
0a03 Logic generator, open-drain, drives HI
0803 Logic generator, open-drain, drives LO
0e03 Logic generator, open-drain, pull-up/down

TP3..TP6, TP7..TP10 and TP12..TP15 LED configuration (a bit mask):

Value Meaning
01 TP(n+0) LED enabled
02 TP(n+1) LED enabled
04 TP(n+2) LED enabled
08 TP(n+3) LED enabled
10 TP(n+0) LED inverted
20 TP(n+1) LED inverted
40 TP(n+2) LED inverted
80 TP(n+3) LED inverted

TP16..TP20 LED configuration (a bit mask):

Value Meaning
0100 TP(n+0) LED enabled
0200 TP(n+1) LED enabled
0400 TP(n+2) LED enabled
0800 TP(n+3) LED enabled
1000 TP(n+4) LED enabled
0001 TP(n+0) LED inverted
0002 TP(n+1) LED inverted
0004 TP(n+2) LED inverted
0008 TP(n+3) LED inverted
0010 TP(n+4) LED inverted

Expansion connector configuration (a bit mask):

Value Meaning
000100 VDD
000004 TP2
000001 TP3
000010 TP4
000040 TP5
010000 TP6
040000 TP7
100000 TP8
400000 TP9
800000 TP10
200000 TP12
000008 TP13
000002 TP14
008000 TP15
000020 TP16
020000 TP17
002000 TP18
000800 TP19
080000 TP20