Rules | Recent posts | topic RSS | Search | Register  | Log in

Project to replace CY7C64613 in the ICD2
Goto page 1, 2, 3 ... 58, 59, 60  Next
Jump to page:

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers
Author Message
albert22



Joined: 20 Jul 2004
Posts: 94
Helped: 3


Post27 Mar 2006 0:22   Project to replace CY7C64613 in the ICD2
tags: icd2 cy7c64613 18f4550 icd2 usb firmware icd2 interface icd2 project.

I am evaluating the posibitity to replace the Cypress USB on the ICD2 with a PIC18f2550 or similar
Reasons for this are:
-CY7C64613 seems to be dificult to obtain.
-Lower price ($20 vs $10).
-SMD package requires a pcb and more or less skilled soldering. The pic is available in DIL.
-Solutions around FTDI alike ICs are just COM port emulations which seem to be limited to 57600 by MPLAB.
-PIC16fxx50 is cheaper, simple circuit and no need for the serial eeprom.
-I Just finished my RS232 ICD and like the idea of using it for developing this project.
-I Dont know when are going to be available the details for the new version of the ICD2 based on the PIC18F4550

As this is not a direct replacement. Emulation of the functions performed by the CY are needed.

On a first look I realized the following(w98):
-The driver supporting the ICD2 seems to be "ICD2w98.sys"
-The CY should be recognized as VID/PID 04d8/8001 (The CY takes this from its external eeprom)
-At startup, CY boots its firmware RAM from the PC. This should be bypassed. I didnt find which file contains this firmware. Ap. this download is handled by the 2nd driver "ICD2w98L.sys".
-The interface to the ICD2 cpu needs a full 8 bits port plus 4 lines.
-One more signal generates MCLR for a 2nd connector named PROG which ap is not used.
-The CY speaks, at least, with the BL on the ICD2 CPU which is small.
-It is not probable that the firmware of the CY might change very much with different versions of mplab.
-No patching of the win drivers should be needed.

The functions of the CY could be determined by a combination of:
-studying the CY firmware
-studying the BL or dexxxxxx.hex files
-studying the win driver
-analyzing the USB traffic
-LA on the ICD CPU interface

Any help or comments?
Back to top
Kripton2035



Joined: 19 Jul 2001
Posts: 424
Helped: 8
Location: Earth


Post27 Mar 2006 18:04   Project to replace CY7C64613 in the ICD2

is the bootloader we use for the 16f877(a) easyly portable to the 18fxx50 without any (minor) change(s) ?

Added after 12 minutes:

I would also add :
study the firmware source code from microchip regarding the usb protocol

http://ww1.microchip.com/downloads/en/DeviceDoc/usb122c.zip
Back to top
rkodaira



Joined: 08 Jun 2004
Posts: 332
Helped: 54
Location: Sao Paulo - Brasil


Post27 Mar 2006 18:11   Re: Project to replace CY7C64613 in the ICD2
tags: icd2 usb icd2 18f4550 877 icd2 interface icd2 clone 4550

For your information,

I bought an ICD2 clone made by a brazilian company. This ICD2 has the 18F4550 as the USB interface and a 16F877 as a main controller. It works great with MPLAB and is cheaper than the original (around USD 100). Of course I donīt have the code. But to encourage you, i say it is possible.
Back to top
albert22



Joined: 20 Jul 2004
Posts: 94
Helped: 3


Post27 Mar 2006 21:44   Re: Project to replace CY7C64613 in the ICD2
tags: icd2 icd2 interface

The Bootloaders should remain the same if the emulation is right.
I was thinking that there is a great chance that all the interface from the CY signals is done just in the Bootloader. Being the only file that changes to support the 877A . Implies that the different operating systems loaded by the MPLAB dont handle the writes to the program memory. There is a good chance that they only rely on the BL for IO to the RS232 and USB.
I have been trying to disassemble it with IDA, MPLAB and ICPROG with poor results.

I am on the CY side now. But I will take a look, thanks for the link Kripton2035.

At the datasheets I found that the firmware for the CY sould be embeded in the win driver that handles the load: "ICD2w98L.sys".

rkodaira. This are bad and good news. The bad news is that I didnt had an original idea. Smile The good ones is that it can be done (as you said)
Is your ICD2 configured really as USB or as a COM port on MPLAB.?
This is important because if they are doing a COM emulation there is no need to use a PIC , it is easier to use a USB/RS232 converter.
Back to top
Kripton2035



Joined: 19 Jul 2001
Posts: 424
Helped: 8
Location: Earth


Post27 Mar 2006 22:00   Project to replace CY7C64613 in the ICD2

can you give us the link to this brazilian company ?

albert, I think they really use the usb port because they wouldnt have used a 18fxx50... they would have used a cheaper pic.. but what warns me is why didnt they use a simple 18f2550 ? they dont need so many io ports the 18f4550 has ?!?!?
Back to top
Zedman



Joined: 13 Oct 2003
Posts: 281
Helped: 2


Post28 Mar 2006 12:55   Project to replace CY7C64613 in the ICD2
tags: icd2 icd2.dll usb icd2 18f4550 877

I've disassembled ICD2.dll, it searches for the file ICD2_4550_BOOT_*.BIN and ICD2_4550_OS_*.BIN in the ICD2 directory and depending on MPLABCommOpen function's return infos it calls CCommDriver::Send18F4550Image routine.

I think MPLAB uses USB just for speed, and uses it as a simple but faster com port.
Cypress has a parallel output to the 16F877(a) portD and portE both connected to it, and it even drives the MCLR of the 877 (but it can be only for reset purposes since the bootloader in 877 does the fw upgrade).

Unfortunatelly I don't have a Logic analyzer nor a storing scope (just a normal one), but it would help a lot to see what cypress is doing with 877.

Zed
Back to top
rkodaira



Joined: 08 Jun 2004
Posts: 332
Helped: 54
Location: Sao Paulo - Brasil


Post28 Mar 2006 13:19   Re: Project to replace CY7C64613 in the ICD2
tags: icd2

The link is:

http://www.labtools.com.br/index.asp?area=07&subarea=&idioma=por&script=produtos&prod=681

The ICD2 clone works with USB port and does not emulate teh COM port, so the speed is faster than the COM port.
[/img]
Back to top
albert22



Joined: 20 Jul 2004
Posts: 94
Helped: 3


Post28 Mar 2006 14:36   Re: Project to replace CY7C64613 in the ICD2
tags: icd2 icd2.dll icd2 interface

The files that Zedman found on the icd2.dll are indeed included with mplab 7.30 which I have just installed.
ICD2_4550_BOOT_0180.BIN
ICD2_4550_OS_0100.BIN
the later contains this text:
M.i.c.r.o.c.h.i.p. .T.e.c.h.n.o.l.o.g.y. .I.C.D.2. .U.S.B. .D.e.v.i.c.e...i.c.d.2. .u.s.b

Undoubtedly they are the firmware for the new 18f4550 based ICD2. We only need the new schematics and this project will have no sense.

The interface with the CY is based on the Parallel Slave port of the 877. The CY writes the latch using the WR CS and RD on port E and the PIC uses RB0 to signal PC2/INT0 and write into the CY. The PIC is using the PSPMODE.Described in the 877 datasheet.

One reason for using a 4550 instead of a 2550 could be the size of the internal RAM for buffering purposes. Other could be a Parallel Slave port. Although I didnt check the datasheet to see its differences.
Back to top
Kripton2035



Joined: 19 Jul 2001
Posts: 424
Helped: 8
Location: Earth


Post28 Mar 2006 17:32   Project to replace CY7C64613 in the ICD2
tags: icd2 usb icd2 18f4550 877

perhaps changing the 16f877(a) with a 18f4550, and connecting directly the usb pins to the 18f4550 should work ? Smile Smile Smile
but as with the 16f877, we have the bootloader bl010101.hex available, we NEED the 18f4550 bootloader too !! I dont think microchip will change the whole design os the icd2.. they only want to get rid of the cypress chip as they now have also an usb chip...they havnt at the time the icd2 went out ?
Back to top
Zedman



Joined: 13 Oct 2003
Posts: 281
Helped: 2


Post28 Mar 2006 18:29   Re: Project to replace CY7C64613 in the ICD2
tags: icd2

Remember guys, they wont change the 877 i think, because they wont recode all the included fw for the separate chips to 4550...

Good news Smile
I managed to extract 2 HEX files from icd2w2kl.sys I think these files gets downloaded to the cypress as Albert mentoined.

But help me to decode them to assembly, Cypress has a 8051 core, but i have only rather old 8051 disassembler and we need the register names too.

Keep up the good work! Smile)



Sorry, but you need login in to view this attachment

Back to top
wizpic



Joined: 23 May 2004
Posts: 332
Helped: 23


Post28 Mar 2006 19:14   Project to replace CY7C64613 in the ICD2
tags: icd2

Guys
I'd just like to say thanks for putting your efforts into making a newer vesrion of ICD2 clone for all of

Keep up the good work and hopefuly you will fix it

I would not know where to start at all

best wishes

wizpic
Back to top
Zedman



Joined: 13 Oct 2003
Posts: 281
Helped: 2


Post28 Mar 2006 20:53   Re: Project to replace CY7C64613 in the ICD2
tags: icd2 icd2.dll

Something is wrong with those .bin files.
I tried to convert them to HEX and load it to MPLAB's sim, it loads OK but seems not really a working program...
Maybe it's scrambled to protect it from hackers like us...
I think I have to take a closer look to ICD2.dll where it loads these files...
Back to top
Kripton2035



Joined: 19 Jul 2001
Posts: 424
Helped: 8
Location: Earth


Post28 Mar 2006 21:17   Re: Project to replace CY7C64613 in the ICD2
tags: icd2 usb icd2 18f4550 877 18f4550 icd2 usb firmware icd2 clone 4550 clone icd2 cypress

Zedman wrote:
Remember guys, they wont change the 877 i think, because they wont recode all the included fw for the separate chips to 4550...


that would say that the brazilian icd2 clone *IS* the new microchip icd2 ? with a 18f4550 replacing the cypress chip, and still the 877 with all the firmwares to program the pics ? and debug them ?
that would explain the use of the 18f4550 because of the need of a parallel slave port, not available on the 18f2550. the cypress chip is at the end "only" a usb-parallel bridge ?

is there a way to understand globally what the founded firmware for the 18f4550 does ? is it only a usb bridge - or a full icd2 chip ?
Back to top
albert22



Joined: 20 Jul 2004
Posts: 94
Helped: 3


Post29 Mar 2006 4:12   Re: Project to replace CY7C64613 in the ICD2
tags: icd2 icd2 interface

The bootloader just choices between the data comming from the USART or from the PSP. Once the byte is received by either, the same routines are used to process the data.
That is, once the active interface is detected. the data coming from RDREG is threated in exactly the same way as data read from the PORTD.
This means that a RS232 monitor will reveal the protocol of both USB and RS232, at least with the bootloader.
I have tryied to see whats happening at the operating system that is loaded by the MPLAB to the ICD2. Which I thought were in the dexxxxxx.hex files. But DE16f77.hex and DE16f88.hex does not make sense yet.

Zedman, take care with the mplab disassembler function. When I loaded the BL into it, the jumps were incorrectly reported. However a stepping into worked well.
Example. at the first instructions
goto 0x561 really jumps to 0x1d61 (due to the remaing bits of the PCLAT)

I dint find the way to extract the CY code from the .sys file as you did Zedman, congratulations. I did found the .c source code for the cypress counterpart and the utilities to pack it to the sys driver. I was still trying to figure out.

If the new ICD2 retains the 877 and the old routines it would be easy to figure out how to connect the PSP and handshake signals.

I will not be at my home for some days. And will not have my PC with me. But Ill keep following the thread until my return.
Back to top
ArmDong



Joined: 24 Dec 2005
Posts: 17


Post29 Mar 2006 5:57   Project to replace CY7C64613 in the ICD2
tags: icd2

The new ICD2 4550 is support PIC24F, PIC33F.
But this link.
http://www.labtools.com.br/index.asp?area=07&subarea=&idioma=por&script=produtos&prod=681

See in device support list is not show.
Back to top
Zedman



Joined: 13 Oct 2003
Posts: 281
Helped: 2


Post29 Mar 2006 12:44   Project to replace CY7C64613 in the ICD2
tags: icd2 icd2.dll usb icd2 18f4550 877

I'am embarassed Sad,

hacked out the hexs from the .sys while the source was available... where did you found them?

Took a look on the .bin files and the loader routines, I think it's not get decrypted or descrambled while/after loaded into ICD2.dll. Just loaded and passed to the device. And the strings in it can be read too. But they look strange in mplab.

I wonder why do they gave the bootloader of 4550? (I know, they gave the BL of 877 too). It's preprogrammed with it in the factory. It cannot be loaded through USB to an empty chip.

Going to buy a 4550 and let the fun begin... Smile

Added after 41 minutes:

rkodaira,

what speed the 4550 on your ICD2br running at?

Added after 50 minutes:

I found this according to bin files on Microchip forum:

"I don't know about these files, but when I connect an 18F4550 as a device, the MPLAB downloads a new OS into the ICD2, reverts back to some other OS when other 18F are connected."

I think they are not used to be a fw for ICD2's new USB adapter. We have to write our own.
Back to top
rkodaira



Joined: 08 Jun 2004
Posts: 332
Helped: 54
Location: Sao Paulo - Brasil


Post29 Mar 2006 12:54   Re: Project to replace CY7C64613 in the ICD2

Answering to Zedman:

There is no speed meter to know the speed, but i think that it works at USB 2.0 speed. In fact when transfering hex files to the board, it is very fast. I have not used the board as debugger yet, so i do not have any experience in this. And there is no specifications on the user manual informing the speed or any other valuable information (the manual is available for download at the same site, but it is written in portuguese - any doubt ask me to translate some parts)

I can check another details for you guys, as for example: the crystals frequencies for each PIC. I agree that the 18F4550 is just replacing the cypress chip. In advance I inform that there is no serial interface in the board and it does not need external supply for working (supplied by the USB port).
Back to top
Zedman



Joined: 13 Oct 2003
Posts: 281
Helped: 2


Post29 Mar 2006 13:03   Project to replace CY7C64613 in the ICD2

Sorry, i mean the crystal freq.

Added after 3 minutes:

Also can you please check which 4550 pins are connected to the 877?
Back to top
mk



Joined: 16 Aug 2001
Posts: 55


Post29 Mar 2006 13:28   Re: Project to replace CY7C64613 in the ICD2

is possible send large foto of this clone ??
Back to top
Zedman



Joined: 13 Oct 2003
Posts: 281
Helped: 2


Post29 Mar 2006 13:34   Project to replace CY7C64613 in the ICD2

hehe, I tought I'll ask rkodaira to extract the code from the 4550 but I was too shy Smile
Back to top
predrage



Joined: 23 Jul 2005
Posts: 132
Helped: 5


Post29 Mar 2006 14:42   Re: Project to replace CY7C64613 in the ICD2

I think that 4550 is locked. Maybe not? It would be too easy if isn't.
Back to top
rkodaira



Joined: 08 Jun 2004
Posts: 332
Helped: 54
Location: Sao Paulo - Brasil


Post29 Mar 2006 15:11   Re: Project to replace CY7C64613 in the ICD2
tags: icd2

he he he

Donīt be shy to ask me anything. Iīll try to help you as possible.

About the hex loaded in the 18F4550, i think it is protected, but i am not sure because the only programmer that I have and can read its content is the ICD2 itself, so i cannot read the chip content without it working in the programmer Surprised(

I see that the picture of the site is not good and small. I saw an advertisement in a magazine and i will scan it. Maybe it is more useful for you. Be patience for a while.
Back to top
petertang



Joined: 26 Oct 2003
Posts: 10


Post29 Mar 2006 17:04   Re: Project to replace CY7C64613 in the ICD2
tags: icd2

I may provide you a RS232 ICD2 if you want.
Back to top
Kripton2035



Joined: 19 Jul 2001
Posts: 424
Helped: 8
Location: Earth


Post29 Mar 2006 17:40   Project to replace CY7C64613 in the ICD2

or build a simple jdm programmer... less than 5 euros components...
Back to top
Jay.slovak



Joined: 23 Mar 2006
Posts: 11


Post29 Mar 2006 19:18   Re: Project to replace CY7C64613 in the ICD2
tags: icd2 icd2 clone 4550

I am also interested in new revision of ICD2, RS232 clone is just too slow to be usefull as a debugger. I read somewhere, that MPLAB 7.40 (due in April) will include official support for this revision. I am pretty excited Very Happy (I have both 16F877A and 18F4550 TQFP ready).

Jay
Back to top
rkodaira



Joined: 08 Jun 2004
Posts: 332
Helped: 54
Location: Sao Paulo - Brasil


Post30 Mar 2006 0:28   Re: Project to replace CY7C64613 in the ICD2

List of the main components on the board:

18F4550-I/P @ 20MHz
16F877-20/P @ 20MHz
74HC04
74HC126
DG411DJ
MIC2172BN

Regarding the PSPx ports, each PSP port from 877 is connected to the correspondent PSP port in the 4550.

[/img]



Sorry, but you need login in to view this attachment

Back to top
Kripton2035



Joined: 19 Jul 2001
Posts: 424
Helped: 8
Location: Earth


Post30 Mar 2006 7:09   Project to replace CY7C64613 in the ICD2

why is this brazilian board "licenced" by microchip ??? what inside this can be licenced by microchip ? why icd cloners take care of writing such terms on their board ?
Back to top
Zedman



Joined: 13 Oct 2003
Posts: 281
Helped: 2


Post30 Mar 2006 11:45   Project to replace CY7C64613 in the ICD2
tags: icd2 icd2 interface

Albert said he has the sources for the cypress chip in .c format, I hope he'll be back soon, because it would be good to know that ICD2 is a:

- Human Interface Device (HID) 64kbyte/sec
(no driver required)
- Communication Device Class (CDC) 1Mbit/s
(will create a COMx port when connected)
- maybe a Mass Storage device (i don't think it uses this)
- or a Custom one (?)

Maybe the cypress fw will explain this, altough I have the 2 hex files, If I will have a good disassembler which knows the cypress chip I'll start to check it.

Please suggest a good disassembler.

Added after 1 hours 44 minutes:

rkodaira,

if you have time, would you dump some usb communication for us? I attached a link to an usb monitor software. It would help a lot.
thanks

h**p://www.hhdsoftware.com/Download/usbmon.exe

Added after 38 minutes:

Just downloaded Keil uVision demo. It does know CY7C64xxx chips. But I can't find how to load a hex file. Anybody can help with this?
Back to top
predrage



Joined: 23 Jul 2005
Posts: 132
Helped: 5


Post30 Mar 2006 19:30   Re: Project to replace CY7C64613 in the ICD2
tags: icd2

rkodaira how yours icd2 generates 12V for mclr? I suppose that there is no need for additional power supply.
Back to top
rkodaira



Joined: 08 Jun 2004
Posts: 332
Helped: 54
Location: Sao Paulo - Brasil


Post30 Mar 2006 20:15   Re: Project to replace CY7C64613 in the ICD2
tags: icd2

It is like the old ICD (the first one that Microchip doesnīt provide anymore). There is a dc-dc converter (boost) to generate the 13V necessary to Vpp. It can be easily realized because in the ICD2 clone there are the inductor (above the right crystal), a switching transistor, the fast diode (the large diode in the picture), some capacitors to filter it.
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers
Page 1 of 60 All times are GMT + 1 Hour
Goto page 1, 2, 3 ... 58, 59, 60  Next
Jump to page:


Abuse
Administrator
Moderators
topic RSS 
sitemap