XGecu Protocol: Difference between revisions

From Proghq
Jump to navigation Jump to search
mNo edit summary
(Adding some documentation for for t48 commands 2e, 2f, 30 , 31, 32, 33, 35 and 36.)
Line 308: Line 308:
|
|
|}
|}
====== 0x2E  SET_VCC_PIN (and voltage) (t48) ======
send 2e 00 00 00  00 00 00 00  aa bb cc dd  ee ff gg 00  xx 00 00 00  yy 00 zz 00
Set which pins are VCC in aa bb cc dd ee ff gg according to vcc pin map.
<br/>
xx is 00 or 01 where 01 enables VCC on ISP-connector
<br/>
yy is written straight to DAC hold register R32_DAC_R12BDHR2. Some code writes it to 0x96,
writing 0x01 e.g. breaks reading voltages with cmd 0x33 but with 0x00 it still works.
<br/>
xx is 00 or 01 where 01 enables VCC on ISP-connector.
<br/>
zz is VCC voltage 01 to 3F. 00 means don't set VCC.
====== 0x2F  SET_VPP_PIN (and vpp and vccio voltage) (t48) ======
send 2f 00 00 00  00 00 00 00  aa bb cc dd  xx 00 00 00
Set which pins are VPP in aa bb cc dd according to vpp pin map.
<br/>
xx is 00 or 01 where 01 enables VPP on ISP-connector.
<br/>
send 2f 01 00 00  00 00 00 00  xx 00 00 00
Sets vpp voltage xx 00 to 3f from 9.31 to 25.16 volts, ca 0.25V per step.
<br/>
send 2f 02 00 00  00 00 00 00  xx 00 00 00
Sets vccio voltage 00 to 04. 0=2.35, 1=2.47, 2=2.93, 3=3.23, 4=3.45
====== 0x30  SET_GND_PIN (t48) ======
send 30 00 00 00 00 00 00 00 aa bb cc dd ee ff gg 00 xx 00 00 00
Set which pins are gnd in aa bb cc dd ee ff gg according to gnd pin map.
<br/>
xx is 00 or 01 where 01 enables EGND on J6/J8/J16 on ISP-connector.
====== 0x31  SET_PULLUPS (t48) ======
send 31 00 00 00 00 00 00 00
Enable pull up for all pins and set all pins to input.
====== 0x32  SET_PULLDOWNS (t48) ======
send 32 00 00 00 00 00 00 00
Enable pull down for all pins and set all pins to input.
====== 0x33  MEASURE_VOLTAGES (t48) ======
send 33 00 00 00 00 00 00 00
recv 33 00 00 00  00 00 00 00  pp pp pp pp  uu uu uu uu  vv vv vv vv  ii ii ii ii
Measures voltages.
<br/>
pp is vpp voltage.vpp = (pp*0xf78/0x1000)/100.0
<br/>
uu is usb voltage. vusb = (uu*0xccf6/0x27000)/100.0
<br/>
vv is vcc voltage. vcc = ((vv*0xb32e/0x27000)-0x14)/100.0
<br/>
ii is vccio voltage. vccio = (ii*0x294/0x1000)/100.0
====== 0x35  READ_PINS (t48) ======
send 35 00 00 00 00 00 00 00
recv 35 00 00 00 00 00 00 00 aa bb cc dd ee ff gg 00
Reads pins and returns bits for all 56 pins on aa bb cc dd ee ff gg
<br/>
first pin is lsb of aa.
====== 0x36  SET_OUT (t48) ======
send 36 xx 00 00 ii 00 00 00
Sets pin ii to value xx (00 or 01) AND sets the pin to output push-pull 50 MHz.


====== 0x3E  PIN_DETECT ======
====== 0x3E  PIN_DETECT ======

Revision as of 23:37, 26 May 2024

based on minipro, list of commands:

command TL866a/cs TL866II+ T48 T56
GET_SYSTEM_INFO 0x00 0x00 0x00 0x00
NAND_INIT - 0x02 0x02 0x02
START_TRANSACTION 0x03 0x03 0x03 0x03
END_TRANSACTION 0x04 0x04 0x04 0x04
GET_CHIP_ID 0x05 0x05 0x05 0x05
READ_USER 0x10 0x06 0x06 0x06
WRITE_USER 0x11 0x07 0x07 0x07
READ_CFG 0x12 0x08 0x08 0x08
WRITE_CFG 0x13 0x09 0x09 0x09
WRITE_USER_DATA 0x14 0x0a 0x0a 0x0a
READ_USER_DATA 0x15 0x0b 0x0b 0x0b
WRITE_CODE 0x20 0x0c 0x0c 0x0c
READ_CODE 0x21 0x0d 0x0d 0x0d
ERASE 0x22 0x0e 0x0e 0x0e
READ_DATA 0x30 0x10 0x10 0x10
WRITE_DATA 0x31 0x11 0x11 0x11
WRITE_LOCK 0x40 0x14 0x14 0x14
READ_LOCK 0x41 0x15 0x15 0x15
READ_CALIBRATION 0x42 0x16 0x16 0x16
PROTECT_OFF 0x44 0x18 0x18 0x18
PROTECT_ON 0x45 0x19 0x19 0x19
AUTODETECT 0xfc 0x37 0x37 0x37
BOOTLOADER_WRITE 0xaa 0x3b 0x3b 0x3b
BOOTLOADER_ERASE 0xcc 0x3c 0x3c 0x3c
UNLOCK_TSOP48 0xfd 0x38
GET_STATUS 0xfe 0x39 0x39 0x39
READ_JEDEC - 0x1d 0x1d 0x1d
WRITE_JEDEC - 0x1e 0x1e 0x1e
WRITE_BITSTREAM - - - 0x26
LOGIC_IC_TEST_VECTOR 0x28 0x28 0x28
WRITE_BITSTREAM2 - - - 0x2a
SWITCH - 0x3d 0x3d 0x3d
SET_LATCH 0xd1 - - -
RESET_PIN_DRIVERS 0xd0 0x2d 0x2d 0x2d
READ_ZIF_PINS 0xd2 0x35 0x35
SET_DIR 0xd4 0x34
SET_OUT 0xd5 0x36 0x36
SET_VCC_VOLTAGE 0x1b 0x1b
SET_VCC_PIN 0x2e 0x2e 0x2e
SET_VPP_VOLTAGE 0x1c 0x1c
SET_VPP_PIN 0x2f 0x2f 0x2f 0x2f
SET_GND_PIN 0x30 0x30 0x30
SET_PULLDOWNS 0x31 0x31
SET_PULLUPS 0x32 0x32
RESET 0xff 0x3f 0x3f 0x3f
? pin detect 0x3e 0x3e
?? autofind ?? 0x29
detect_drm_adapter 0x24 -
??? set / read / pin (imax?) 0x33
??? after read cfg 0x22
0x2E SET_VCC_PIN (and voltage) (t48)
send 2e 00 00 00  00 00 00 00  aa bb cc dd  ee ff gg 00  xx 00 00 00  yy 00 zz 00 

Set which pins are VCC in aa bb cc dd ee ff gg according to vcc pin map.
xx is 00 or 01 where 01 enables VCC on ISP-connector
yy is written straight to DAC hold register R32_DAC_R12BDHR2. Some code writes it to 0x96, writing 0x01 e.g. breaks reading voltages with cmd 0x33 but with 0x00 it still works.
xx is 00 or 01 where 01 enables VCC on ISP-connector.
zz is VCC voltage 01 to 3F. 00 means don't set VCC.

0x2F SET_VPP_PIN (and vpp and vccio voltage) (t48)
send 2f 00 00 00  00 00 00 00  aa bb cc dd  xx 00 00 00

Set which pins are VPP in aa bb cc dd according to vpp pin map.
xx is 00 or 01 where 01 enables VPP on ISP-connector.

send 2f 01 00 00  00 00 00 00  xx 00 00 00 

Sets vpp voltage xx 00 to 3f from 9.31 to 25.16 volts, ca 0.25V per step.

send 2f 02 00 00  00 00 00 00  xx 00 00 00

Sets vccio voltage 00 to 04. 0=2.35, 1=2.47, 2=2.93, 3=3.23, 4=3.45

0x30 SET_GND_PIN (t48)
send 30 00 00 00 00 00 00 00 aa bb cc dd ee ff gg 00 xx 00 00 00

Set which pins are gnd in aa bb cc dd ee ff gg according to gnd pin map.
xx is 00 or 01 where 01 enables EGND on J6/J8/J16 on ISP-connector.

0x31 SET_PULLUPS (t48)
send 31 00 00 00 00 00 00 00 

Enable pull up for all pins and set all pins to input.

0x32 SET_PULLDOWNS (t48)
send 32 00 00 00 00 00 00 00 

Enable pull down for all pins and set all pins to input.

0x33 MEASURE_VOLTAGES (t48)
send 33 00 00 00 00 00 00 00
recv 33 00 00 00  00 00 00 00  pp pp pp pp  uu uu uu uu  vv vv vv vv  ii ii ii ii

Measures voltages.
pp is vpp voltage.vpp = (pp*0xf78/0x1000)/100.0
uu is usb voltage. vusb = (uu*0xccf6/0x27000)/100.0
vv is vcc voltage. vcc = ((vv*0xb32e/0x27000)-0x14)/100.0
ii is vccio voltage. vccio = (ii*0x294/0x1000)/100.0

0x35 READ_PINS (t48)
send 35 00 00 00 00 00 00 00
recv 35 00 00 00 00 00 00 00 aa bb cc dd ee ff gg 00

Reads pins and returns bits for all 56 pins on aa bb cc dd ee ff gg
first pin is lsb of aa.

0x36 SET_OUT (t48)
send 36 xx 00 00 ii 00 00 00

Sets pin ii to value xx (00 or 01) AND sets the pin to output push-pull 50 MHz.

0x3E PIN_DETECT
send 3E 00 aa bb 00 00 00 00
recv  3E 00 aa bb 00 00 00 00 b0 b1 b2 b3 b4 b5 b6 00


aa bb : chip ID
b0 : ZIF8-ZIF1
b1 : ZIF16-ZIF9
b2 : ZIF24-ZIF17
b3 : ZIF32-ZIF25
b4 : ZIF40-ZIF33
b5 : ISP8-ISP1
b6: ISP16-SIP9