rkodaira said:Hi guys !
Bad news. I could not install the USB monitor in my PC with Windows98SE, because it doesn´t accept to be installed. I think it (if installed) wouldn´t make any damage to my ICD2, but i could not test it.
Zedman may be you can open the log files that had been posted here and export them to html. No need to have the USB ICD2.It can be exported from USBMon to HTML format, but I have only serial ICD2.
I used the information from this thread to connect my existing program with the real ICD USB Driver. I got so far that I receive the GETFIRMWAREVERSION command, but my response seems not to be understood. It sends the same command again and then hangs (?) .
procedure TForm1.Button1Click(Sender: TObject);
var hnd: cardinal;
InBuffer: array[0..3] of byte;
OutBuffer: array[0..17] of byte;
bytesReturned: cardinal;
a: integer;
begin
hnd:=CreateFile('\\.\i3kmc-0', $C0000000, 2, 0, 3, 0, 0);
if hnd <> INVALID_HANDLE_VALUE then
begin
// get usb descriptor
for a:=0 to 3 do InBuffer[a]:=0; for a:=0 to 17 do OutBuffer[a]:=0; bytesReturned:=0;
if (DeviceIoControl(hnd, $0A4122404, @InBuffer, 4, @OutBuffer, $12, bytesReturned, nil)) then
begin
Memo1.Lines.Add('1 OK');
end;
// write command
for a:=0 to 3 do InBuffer[a]:=0; for a:=0 to 17 do OutBuffer[a]:=0; bytesReturned:=0;
OutBuffer[0]:=3;
if (DeviceIoControl(hnd, $0A4122451, @InBuffer, 4, @OutBuffer, $12, bytesReturned, nil)) then
begin
Memo1.Lines.Add('2 OK');
end;
// get status
for a:=0 to 3 do InBuffer[a]:=0; for a:=0 to 17 do OutBuffer[a]:=0; bytesReturned:=0;
InBuffer[0]:=7;
if (DeviceIoControl(hnd, $0A412244E, @InBuffer, 4, @OutBuffer, 0, bytesReturned, nil)) then
begin
Memo1.Lines.Add('3 OK');
end;
Memo1.Lines.Add('- done.');
end;
end;
HOST->DEV: 02 C1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
I reply with 8 x 0
DEV->HOST: 00 00 00 00 00 00 00 00 00
MPLAB ICD 2 Ready
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to MPLAB ICD 2
ICDWarn0020: Invalid target device id (expected=0x93, read=0x58)
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready
Isn't it waiting for data on EP2? You should be able to see that on a USB monitor?, MPLAB wont send me ANY more data,
for (a=0; a<64; a++) { icd2_data_tx[a]=0xFF; }
ICD2_DATA_BD_IN.Cnt = 64;
mUSBBufferReady(ICD2_DATA_BD_IN);
LED=1; while(mDataTXBusy() == 1); LED=0;
This suggests you are almost there! As far as I know you only need to send >64 bytes when the ICD is reading or verifying data/program memory on the target device....if I have to transfer more than 64 bytes why it hangs ...
ICDWarn0059: About to re-program ICD2 USB Boot firmware code. Please do NOT disconnect the ICD2 or interrupt this operation!
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?