Already tryed several settings (like various deleays in IC-Prog). I don't know what should be fixed in board and wheather it's possible to make it work properly (maybe some problems with my COM port), but anyway I'm sure I could write chip with different software. I need programmer that would retry to write a word after failed attempt. Every programmer I've tryed failed to proceed after first failed attempt to write. I find it really stupid, when OS fails to write data to FDD of HDD it tryes again several times and then asks something like "Retry, Abort, Ignore?", don't know why all those programmers don't use this approach.
As it seems that there's no open source programmer available, I need to write one by myself, and I decided to use pySerial. But I have problems with understanding how JDM works.
Programmer:
I know it sets Vss to -5V but still it's hard for me to understand other details.
I need to control levels of Vpp, Vdd, write to Data and Clock pins. I see that with TxD and RTS I can control levels of Vpp and Vdd, CTS is to be used to read Data and DTR to write, but I don't see how to control Clock while holding Vpp and Vdd high.
From Microchip's specification:
By the way, whatever programmer I use yellow diode doesn't shine, don't know why.
Please tell any suggestions what should I do, I think that I must first set TxD and RTS to 1 (so Vpp is high and Vdd is low), then after pause set RTS to 0 (so Vdd is high) and then start to send data, but how to control Clock?
Here's what I've written with Python:
- Code: Select all
#this is intended to read word from memory but all I get are zeros
import serial, time
ser = serial.Serial(0)
def clock_low(): #??? drops Vpp and Vdd
ser.setBreak(0)
ser.setRTS(1)
def clock_high(): #???
ser.setBreak(0)
ser.setRTS(0)
def output_data(data):
for i in xrange(len(data)):
clock_high()
if data[i] == 0: ser.setDTR(0)
else: ser.setDTR(1)
time.sleep(100e-9)
clock_low()
time.sleep(100e-9)
def input_data():
data = []
time.sleep(1e-6)
for i in xrange(16):
clock_high()
time.sleep(100e-9)
data.append(int(ser.getCTS()))
clock_low()
time.sleep(100e-9)
return data
ser.setBreak(0)
ser.setRTS(0)
time.sleep(0.1)
ser.setBreak(1)
ser.setRTS(1)
time.sleep(5e-9)
ser.setRTS(0)
time.sleep(5e-9)
output_data([0,0,1,0, 0,0])# this is READ instrucion
data = input_data()
print data# get zeros
ser.close()