I'm having a little issue to get my calc to talk to a Python program.
I'm using PyTICables, made by Kllrnohj, to get Python to use libticables and talk to the calc.
The Z80 program, compiled with SPASM and used ti83plus.inc with added "_SendAByte equ 4EE5h":
Code:
The Python program:
Code:
The magical error:
Code:
Screenshot: (click to enlarge)
Any idea how to fix this? I'm a noob at Z80 programming and TI calc communication, so please don't assume I know everything!
I'm using PyTICables, made by Kllrnohj, to get Python to use libticables and talk to the calc.
The Z80 program, compiled with SPASM and used ti83plus.inc with added "_SendAByte equ 4EE5h":
Code:
#include "ti83plus.inc"
#define B_CALL(xxxx) rst 28h \ .dw xxxx
#define B_JUMP(xxxx) call 50h \ .dw xxxx
.org 40339
.db t2ByteTok, tAsmCmp
main:
B_CALL(_ClrLCDFull)
res donePrgm,(iy+doneFlags); FDCB00AE
B_CALL(_ClrLCDFull) ;Clear the screen
B_CALL(_GrBufClr) ;Clear all values in the graph buffer
B_CALL(_ClrLCDFull) ;Clear the screen
;di
xor a
ld a,0000h
B_CALL(_SendAByte)
xor a
ld a,0000h
B_CALL(_SendAByte)
xor a
ld a,0000h
B_CALL(_SendAByte)
xor a
ld a,0000h
B_CALL(_SendAByte)
;ei
ld hl,0000h ;Load 0 to hl register
ld (PENCOL),hl ;Load hl value to Pencol
ld hl,0
ld (penRow),hl
ld hl,strdone
B_CALL(_VPutS) ;Put text on homescreen
B_CALL(_GetKey)
B_CALL(_ClrLCDFull) ; Clear screen
B_CALL(_HomeUp)
ret
strdone:
.db "Sent, press any key...",0
strsend:
.db 0000,0
The Python program:
Code:
import time
import ticables
c = ticables.Cable(ticables.CABLE_USB,1)
print "Opening connection..."
c.open()
testbuf = "#h\x00\x00"
print "Sending..."
err = c.send(testbuf)
# Check for success...
if err != 0:
print "Error sending"
c.show()
#print "Resetting cable..."
#c.reset()
print "Recieving..."
while 1==1:
data = c.recv(2)
if data[0] != 0:
print "ERROR: Recv failed with error code "+str(data[0])
print "Retry in 2 seconds"
time.sleep(2)
else:
print data
The magical error:
Code:
ticables-INFO: ticables library version 1.3.0
ticables-INFO: setlocale: en_US.utf8
ticables-INFO: bindtextdomain: /usr/share/locale
ticables-INFO: textdomain: libticables2
ticables-INFO: kernel: 2.6.32-23-generic
Opening connection...
ticables-INFO: Check for lib-usb support:
ticables-INFO: usb support: available.
ticables-INFO: Check for lib-usb usability:
ticables-INFO: usb filesystem (/dev/bus/usb/): mounted
ticables-INFO: found TI-84 Plus Silver Edition on #1, version <1.10>
Sending...
(ii)Len: 4
(ii)Data: 35 104 0 0
Recieving...
(process:20571): ticables-WARNING **: usb_bulk_read (No error).
ERROR: Recv failed with error code 4
Retry in 2 seconds
(process:20571): ticables-WARNING **: usb_bulk_read (No error).
ERROR: Recv failed with error code 4
Retry in 2 seconds
Screenshot: (click to enlarge)
Any idea how to fix this? I'm a noob at Z80 programming and TI calc communication, so please don't assume I know everything!