Topics Topics Edit Profile Profile Help/Instructions Help Member List Member List  
Search Last 1|3|7 Days Search Search Tree View Tree View  

TK3 to USB

:: EPE Chat Zone ­:: ­Radio Bygones Message Board :: » EPE Forum Archives 2005-2006 » Archive through 03 March, 2006 » TK3 to USB « Previous Next »

  Thread Last Poster Posts Pages Last Post
  ClosedClosed: New threads not accepted on this page        

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Terrym
Frequent Contributor
Username: Terrym

Post Number: 159
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 19 February, 2006 - 03:22 am:   Edit Post Delete Post Print Post

In a previous post, the question was asked about converting TK3 to USB. As a suggestion, couldn't one of the range of USB PICs be used as a USB to pseudo parallel port interface?(specifically for TK3). And would that then only require the output routine of TK3 to be modified to use the USB port?
TM
Top of pagePrevious messageNext messageBottom of page Link to this message

Terrym
Frequent Contributor
Username: Terrym

Post Number: 160
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 19 February, 2006 - 07:47 am:   Edit Post Delete Post Print Post

A further bit of digging has produced this chip from FTDI - FT245BM. It is a USB to Parallel port chip.
There are also VCP (Virtual Com Port) drivers for this chip such that the USB port appears as a standard Com port. They also run under XP.

That should mean that there is no rewrite of TK3 necessary and no messy USB drivers/software to write.
TM
Top of pagePrevious messageNext messageBottom of page Link to this message

Joe
Frequent Contributor
Username: Joe

Post Number: 85
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 19 February, 2006 - 08:28 am:   Edit Post Delete Post Print Post

Terry,
I've not looked specifically at that Chip, but if it's using VCP drivers, doesn't that imply it's a serial device? The TK3 software was written for a Parallel device so some software mods would be requried.
I agree tho' that no USB drivers would need to be developed so it may be a good start.

I've played with a couple of the USB PIC's and they are soooo cool.
However, I think that as it stands, TK3 can't program that range of PICs (18F2550/4550) so it would either need updating, people would need to buy pre-programmed PIC's or a new programmer (defeats the point a bit I guess).


I've just ordered one of these:
http://www.ptronix.com/eshop/2480.htm

£12 including VAT & Postage to give it a try - and if it dosn't work it will come in handy for other things.

Whilst not as much fun, or technically interesting as designing/building a custom device it would probably be a lot cheaper.

I'll report back on how successful, or not it is.
Do one thing each day that scares you – work here !
Top of pagePrevious messageNext messageBottom of page Link to this message

Terrym
Frequent Contributor
Username: Terrym

Post Number: 161
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 19 February, 2006 - 09:28 am:   Edit Post Delete Post Print Post

Hi Joe. I haven't gone through all the documentation yet, so can't fully comment. There was some mention of an LPT2 port. There is also a DLL available for the chip with apparently many more features.

The main idea of the post is to throw up some ideas that may do away with the need to rewrite TK3 for USB. I'm just about to read an article in an American mag about a USB to parallel converter that uses an FTDI chip and a couple of discrete logic chips to implement it.

If the unit you have purchased does the job, so much the better.Will wait to hear how you get on.
TM
Top of pagePrevious messageNext messageBottom of page Link to this message

Joe
Frequent Contributor
Username: Joe

Post Number: 86
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 19 February, 2006 - 11:52 am:   Edit Post Delete Post Print Post

LPT2 Ooooh...
I like the sound of that.

Might have to see if I can get one of these FT chips from somewhere to have a play with.
Do one thing each day that scares you – work here !
Top of pagePrevious messageNext messageBottom of page Link to this message

Terrym
Frequent Contributor
Username: Terrym

Post Number: 162
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 20 February, 2006 - 07:30 am:   Edit Post Delete Post Print Post

Joe, I had a read through the documentation and either I'm having hallucinations or I've missed it, but I can't find the reference to LPT2 again. I'll send an email to FTDI re this and let you know the answer as soon as I get it.
TM
Top of pagePrevious messageNext messageBottom of page Link to this message

Joe
Frequent Contributor
Username: Joe

Post Number: 88
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, 24 February, 2006 - 02:26 pm:   Edit Post Delete Post Print Post

Perhaps wishfull thinking, tho' thinking about it, it's only a matter of them writing a driver so they may have one available.

As for the USB to Parallel converter - it works a dream.... just not with TK3.

I can run one of my old parallel printers off it ok BUT it dosen't install itself as an LPT port, but as some weird USB thing that appears in the Windows list of availabel printer ports.
Since TK3 talkes to the actual I/O ports used by LPT1 it ain't going to work.

So, for this idea to be a runner, TK3 would need modifying to be able to select the required LPT port (1,2,3 etc) AND you would need a USB/Parallel port gizmo that actually presented itself to the operating system as a true LPT port.

The TK3 bit is easy....

Time to have another think...

Joe
Do one thing each day that scares you – work here !
Top of pagePrevious messageNext messageBottom of page Link to this message

Terrym
Frequent Contributor
Username: Terrym

Post Number: 165
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, 25 February, 2006 - 12:57 am:   Edit Post Delete Post Print Post

I got a reply from FTDI last night. The answer, as we have found out, is that there is currently no lpt driver for the FT245. I did come across a site where a Gameboy has been interfaced to the USB bus using a 16F877.

http://www.robmeerman.co.uk/project

Not quite what we are looking for but it may contain useful info. The other thought I had(dangerous I know, this thinking business), was that if TK3 could be rewritten to provide serial port output, maybe the FTDI chip would be usable then? Would that not be an easier rewrite as opposed to a complete USB rewrite?

Must go and wash the thinking cap, hopefully something new will pop up.
TM
Top of pagePrevious messageNext messageBottom of page Link to this message

Joe
Frequent Contributor
Username: Joe

Post Number: 89
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, 25 February, 2006 - 07:28 am:   Edit Post Delete Post Print Post

Terry,
real shame about the LPT driver for the FT chips.
Would have solved some problems.

The TK3 software uses a DLL and In/Out statements to Read/Write to specific ports.

In theory, you could change that to Read/Write a serial port.... in theory.
One drawback is that I think it would be slower than the Parallel interface but we would have to see.
With a bit of carfull hacking, TK3 could be modified so that it's still LPT compatable but have the option of working over a serial interface as well (it would also be nice if TK3 supported the ability to select which LPT port to use).

Ok, so now TK3 supports LPT and say COM1 to COMn

You could probably employ one of those USB to serial gizmos if required to give you a serial port from a USB port BUT that's not compatable with the current TK3 hardware. No help there.

Using one of your FT chips would solve that problem as it does present a type of parallel port interface.
OR, you could use one of the newish 18F PIC parts that have a USB interface on-board and some I/O pins.

I guess the way you jump is probably down to cost. The price of an FTDI or a 18F2550 PIC (which is around £5 I think.)

In theory, you don't need any expensive hardware thinking about it.
Once you've change TK3 to talk serial you just need a couple of parallel to serial and serial to parallel shift registers at the TK3 end... in theory.
Those people who have serial ports use them, those people of have USB ports need a USB to Serial converter and both use a small TK3 bolt on with either a couple of shift registers or a PIC/FT device...

All jumbled musings right now.

Time for food and another think.

Joe
Do one thing each day that scares you – work here !
Top of pagePrevious messageNext messageBottom of page Link to this message

John_becker
:::: Super User ::::
Username: John_becker

Post Number: 128
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, 25 February, 2006 - 11:00 am:   Edit Post Delete Post Print Post

Folks, if someone comes up with hardware & software interfaces for TK3 I will add the software to TK3's suite of progs, and I feel sure that circuits for the hardware can also be made available through TK3's folder on our downloads site.

If anyone wants to follow this up contact me via

john.becker@wimborne.co.uk or

techdept@epemag.wimborne.co.uk

and those messages will be passed on to me via EPE HQ. I cannot publicise my personal address here. Alternatively, put a message up here and make your email available in your profile and I'll get back to you.

I do not have enough knowledge of serial or USB to attempt to an interface myself. The serial interface I always use with VB6 designs was designed by Joe (Farr) (to whom I'm eternally grateful :-) Maybe someone could modify that's facilities to talk to a USB interface??

I feel sure this problem can be cracked.

John
Top of pagePrevious messageNext messageBottom of page Link to this message

Terrym
Frequent Contributor
Username: Terrym

Post Number: 168
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, 25 February, 2006 - 02:35 pm:   Edit Post Delete Post Print Post

Thanks John. There has to be a simple answer to this somewhere. Unfortunately I'm not a skilled enough programmer either (still learning), so will keep tossing around ideas until an answer is found. I know it's out there somewhere.
TM
Top of pagePrevious messageNext messageBottom of page Link to this message

Istedman
Regular Contributor
Username: Istedman

Post Number: 43
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, 25 February, 2006 - 10:25 pm:   Edit Post Delete Post Print Post

There is a way of doing this using the FTDI FT245 devices and minimal additional hardware.

The idea is this.
Use the FTDI FT245BM/BL in the virtual com port mode, this allows a virtual serial port upto 300,000 BPS!

The output is an 8 bit FIFO interface. If you used 5 bits of this interface + a small bit of logic, you could replicate the existing TK3 interface, namely the Data, Clock, Prog V CTL, Read Verify and Reset lines used on the parallel port. By sending the correct hexadecimal codes you control the right control lines. This would need some logic (or a PIC) to control the read/write lines of the FT245. The advantage to this is that it looks like a COM-port to the PC.

The other option with the FT245 is to use the bit-bang mode of the FTDI device. This uses specific USB control software, which is not as bad as it looks, at first.

Using another PIC on an adaptor board, be it a 18F device or a FTDI + 877 (on my proto board) makes the interfacing easier but poses an issue for newcomers. You can not use this board unless you program a PIC but how do you program it without a PIC programmer.

Just my idle thoughts.

Ian

(Message edited by istedman on 25 February, 2006)
Top of pagePrevious messageNext messageBottom of page Link to this message

Andrew
Member
Username: Andrew

Post Number: 9
Registered: 04-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, 25 February, 2006 - 10:45 pm:   Edit Post Delete Post Print Post

I'm not so sure TK3->USB is possible without massive changes to the software, and as Ian says - something else (PIC) on the PCB.

TK3 currently writes to LPTn directly and relies on *very* accurately timed transmissions and responses from the board which I don't think are achievable with so many levels of indirection and over serial.

TK3 has to be changed to instead send requests for programming activity via serial/usb to the board, which are then cached and delivered by the controlling firmware (for me this would be a USB PIC)

- Andrew.
Top of pagePrevious messageNext messageBottom of page Link to this message

John_becker
:::: Super User ::::
Username: John_becker

Post Number: 129
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 26 February, 2006 - 01:05 am:   Edit Post Delete Post Print Post

I dont mind at all if the TK3 software ends up changed. What we cant do though is to modify the TK3 board in any way. Any hardware change has to be via an add-on board which anyone else would need to copy, i.e. any add-on really needs to be Vero.

This limitation is imposed as I have now semi-retired, and also EPE are no longer taking constructionals from external contributors. So we have to accept the original TK3 board as it is now.

Additional software should be in form of extra sub-routine(s) specific to USB, determined either by PIC type number or via a click-button named as USB in some way.

Thanks to all of you joining in this discusssion :-)

John
Top of pagePrevious messageNext messageBottom of page Link to this message

Joe
Frequent Contributor
Username: Joe

Post Number: 90
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 26 February, 2006 - 08:06 am:   Edit Post Delete Post Print Post

Andrew,
I'm not that ok with the hardware programming of PICs, and whilst I accept that timing is going to be an issue, I do wonder just "how" accurate this has to be.
TK3 seems to run on any machine from the slowest of old rust buckets to my P4 2.4GHz laptop.
Theres no real timing control in TK3 so unless the operating system throttles the data transfer to the physical parallel interface, timing might not be too big of a hurdle. Also, USB is many times faster than the LPT port which could work in our favor, as it's simpler to slow things down than speed them up.

I've just had a very breif romp through the TK3 software however, and have to agree that a software re-write would probably be in order.
There are for example over 200 Inp/Out statments in the code (I stopped looking at 200). These would all need to be changed in one way or another.
Making massive code changes would be a nightmare to be honest.

If we look at what we do have, then the hardware is the real asset and the one thing we don't want to change. Software is vapor-ware and can be replaced reasonably simply (and with no hassle to the end user) - Sorry John....
Perhaps it's time to consider a re-write of the front end.

A small bolt-on board could be constructed that plugs into TK3's parallel socket and into that could plug a Serial/USB cable.
You have the choice of an FT chip or a PIC.
Crownhill do an FT232 for around £3 which seems good value, tho' it looks SMT...

"IF" for example Magenta would sell pre-programmed PIC's, then that might help as a 18F2550 PIC could be used. These are around £5 from Farnell and use nice DIL sockets.
Add an Xtal, couple of caps, USB socket, Centronics connector - you could probably build a board for less around £20.

Is it worth it ?
With EPE no longer trail-blazing, the TK3 user market will probably start to shrink. People are going to want new PIC's and features...
Also, I'm not sure but I think that for some of the new 18F PIC's, you have to fiddle with the 5v rail during the programming cycle. I know that when using these PIC's, you have to inset a diode in the power rail so that the programmer can power the PIC directly without attempting to power the rest of the circuit. TK3 may not be able to do this (I don't have the circuit handy) which, without hardware/board changes precludes this range of PICs and possibly future ones as well. Also, the +12v is too high for some parts so some control over this would be needed as well.

There are USB programmers out there that are cheap, feature rich and support a wide range of PICs. Magenta have one for £40 that seems like it programs just about anything.

Well that's my 0.02p worth....

What do the masses think ?

Joe

(Message edited by joe on 26 February, 2006)
Do one thing each day that scares you – work here !
Top of pagePrevious messageNext messageBottom of page Link to this message

Terrym
Frequent Contributor
Username: Terrym

Post Number: 169
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 26 February, 2006 - 09:54 am:   Edit Post Delete Post Print Post

Joe, please correct me if i'm wrong. Don't all the "IN" "OUT" commands get funnelled through the inpout32.dll? If so, would this not be the point at which to redirect them to the serial port? As I said before, my programming ability is somewhat limited so just trying to understand this bit.

By the way, has anybody else had a look at the USB interface in the October 2005 issue as a possible starting point? If TK3 could be given a serial output option, a small adapter board shouldn't create too many drama's (keeping in mind the timing comment above).

While I agree with your comments about the downturn in things etc, should we perhaps consider that things might change when the error of these decisions are realised? Look closely, the cracks are already there.
TM
Top of pagePrevious messageNext messageBottom of page Link to this message

Joe
Frequent Contributor
Username: Joe

Post Number: 91
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 26 February, 2006 - 11:22 am:   Edit Post Delete Post Print Post

Terry,
Your right, all I/O calls are affectivly routed via the INPOUT32 DLL, but you can't intercept them like that, well, not simply.

For example, if we go USB, we would probably have a new DLL with USBIN and USBOUT functions.
All the IN's would need to be replaced with USBIN's and likewise for all the OUT's (a fairly simple text search and replace).
However, the parameters would probably be totally different. Instead of just supplying an I/O port address and value, you will need to supply USB type parameters.
The LPT port (if it exists) is just there.
You don't Open/Close it or really configure it.
You just send/read data to/from it.
With a serial port, it gets a bit more complex as you need to specify the Port to use, speed, parity, word length. You then need to open and close it.
With USB, well.... you need more.
For example, this is a list of the DLL calls that are needed when I talk between VB and 18F2550/4550 PICs.

' HID interface API declarations...
Declare Function hidConnect Lib "mcHID.dll" Alias "Connect" (ByVal pHostWin As Long) As Boolean
Declare Function hidDisconnect Lib "mcHID.dll" Alias "Disconnect" () As Boolean
Declare Function hidGetItem Lib "mcHID.dll" Alias "GetItem" (ByVal pIndex As Long) As Long
Declare Function hidGetItemCount Lib "mcHID.dll" Alias "GetItemCount" () As Long
Declare Function hidRead Lib "mcHID.dll" Alias "Read" (ByVal pHandle As Long, ByRef pData As Byte) As Boolean
Declare Function hidWrite Lib "mcHID.dll" Alias "Write" (ByVal pHandle As Long, ByRef pData As Byte) As Boolean
Declare Function hidReadEx Lib "mcHID.dll" Alias "ReadEx" (ByVal pVendorID As Long, ByVal pProductID As Long, ByRef pData As Byte) As Boolean
Declare Function hidWriteEx Lib "mcHID.dll" Alias "WriteEx" (ByVal pVendorID As Long, ByVal pProductID As Long, ByRef pData As Byte) As Boolean
Declare Function hidGetHandle Lib "mcHID.dll" Alias "GetHandle" (ByVal pVendoID As Long, ByVal pProductID As Long) As Long
Declare Function hidGetVendorID Lib "mcHID.dll" Alias "GetVendorID" (ByVal pHandle As Long) As Long
Declare Function hidGetProductID Lib "mcHID.dll" Alias "GetProductID" (ByVal pHandle As Long) As Long
Declare Function hidGetVersion Lib "mcHID.dll" Alias "GetVersion" (ByVal pHandle As Long) As Long
Declare Function hidGetVendorName Lib "mcHID.dll" Alias "GetVendorName" (ByVal pHandle As Long, ByVal pText As String, ByVal pLen As Long) As Long
Declare Function hidGetProductName Lib "mcHID.dll" Alias "GetProductName" (ByVal pHandle As Long, ByVal pText As String, ByVal pLen As Long) As Long
Declare Function hidGetSerialNumber Lib "mcHID.dll" Alias "GetSerialNumber" (ByVal pHandle As Long, ByVal pText As String, ByVal pLen As Long) As Long
Declare Function hidGetInputReportLength Lib "mcHID.dll" Alias "GetInputReportLength" (ByVal pHandle As Long) As Long
Declare Function hidGetOutputReportLength Lib "mcHID.dll" Alias "GetOutputReportLength" (ByVal pHandle As Long) As Long
Declare Sub hidSetReadNotify Lib "mcHID.dll" Alias "SetReadNotify" (ByVal pHandle As Long, ByVal pValue As Boolean)
Declare Function hidIsReadNotifyEnabled Lib "mcHID.dll" Alias "IsReadNotifyEnabled" (ByVal pHandle As Long) As Boolean
Declare Function hidIsAvailable Lib "mcHID.dll" Alias "IsAvailable" (ByVal pVendorID As Long, ByVal pProductID As Long) As Boolean

You don't need them all of course, but USB is a totally different animal.
Also, you need to Sub Class the WinProc for the application. At this point, things are getting serious. If you don't shut things down correctly, Windows becomes unstable... Quite often when your debugging the VB app, everything just crashes.
The problem is that USB needs a poll every 10ms or so to keep the connection alive and it's all event driven and this dosn't work always as expected in the VB debugger.

It's certainly do-able don't misunderstand me, but it's a job, and will take time.
The actualy building of a USB interface is quite simple, as is the software so that's not really a big problem. I've created VB USB applications that talk to PIC's in only a couple of hours.

I also own a block of USB device ID's so could donate one of those to this project if necessary.
You need a unique device ID so you don't step on other device's toes, and you have to buy them. (They don't call in Window$ for nothing).

The problem will be retro-fitting this back into TK3, and I'm not convinced that this will be a simple, or cost affective (time) job.

It might be possible to "wrap" all the USB functionality into a couple of callable routines that might simplify things... but without a serious think, I'm not sure, but right now, I doubt it.

If I were going to undertake this, I'd be looking at replacing the TK3 software.

I'd start by building a new cut down version.
Just the basics to program the existing list of supported PIC's. I'd incorporate a simple COM interface that allows people to build their own plug-ins and leave it like that.

I hate to say this, I'd probably not write it in VB as it's no longer supported (that should please Boris :-). That said, why not.
VB is still a popular programming language and a lot of people have/use it.

I agree that the cracks are showing - this topic is a case in point. By rights, we should be talking about all the new cool features that we want to see in TK4. However, IMHO, I don't think that things will change - but don't get me started on that soap box...
Do one thing each day that scares you – work here !
Top of pagePrevious messageNext messageBottom of page Link to this message

John_becker
:::: Super User ::::
Username: John_becker

Post Number: 131
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 26 February, 2006 - 11:36 am:   Edit Post Delete Post Print Post

Only a very few of the timing factors are critical, as set down in the data sheet for 16F & 18F PICs. Those stipulated for the 18F I found are particularly critical, as I discovered when modifying TK3 to handle that family.

A suitable substitute for the INPOUT32.DLL, plus a hardware extension, would seem the best solution. The high speed nature of USB would appear to be suitable for still achieving the same timing as set into TK3.

I too had wondered if that EPE design in Oct would be suitable for TK3's use.

TerryM - what "cracks" do you think are appearing in EPE? My impression is that most people are very content with the new style, judging by what has been said here on CZ and in the correspondence coming into HQ. Most of the usual columns are still there, all that's changed is that major constructionals are sourced through SC, plus the addition of colour and better paper, both of which I like.

Joe - I agree in principle with the "vapor-ware" concept (ignoring the many man-days I've taken writing the code!). We must retain, though, TK3's ability to communicate through the parallel port, whilst providing USB communication as an option, but allowing selection of either parallel or USB.

I'm sure Magenta would be able to program any PICs needed for the interface - I'll talk with them when things on the USB interface have moved on a bit. But why couldn't TK3 program the needed
PICs from a parallel post? I'm not familiar with device TerryM mentions, is it that different to those TK3 does handle?

J
Top of pagePrevious messageNext messageBottom of page Link to this message

Joe
Frequent Contributor
Username: Joe

Post Number: 92
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Sunday, 26 February, 2006 - 11:48 am:   Edit Post Delete Post Print Post

Hi John,

I agree that the Parallel port functionality should be kept, for one thing, Win 95 users won't appreciate a total USB solution.

If a pure "bolt on" board approch can be found then that solves all problems. With it USB, without it Parallel.

If software changes are needed, it gets more tricky and you 'may' end up with two versions of TK3 - but all this depends on which USB hardware is used I guess.

The 18F2550/4550 PIC's have built in USB support. Just a cap, 2 resistors and a connector and your there.
The problem is the programming. You have to 'fiddle' with the +5v during the programming cycle and I don't think that TK3 can do that.

The FT devices don't need any programming at all. You just plug and play.

Joe
Do one thing each day that scares you – work here !
Top of pagePrevious messageNext messageBottom of page Link to this message

John_becker
:::: Super User ::::
Username: John_becker

Post Number: 133
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 27 February, 2006 - 07:43 pm:   Edit Post Delete Post Print Post

Things move on a bit on TK3/USB - reader John Hudson (with whom I've chatted previously) has emailed me privately to say he's happy to do such an interface. Two question now arise - are there any of you who would be happy to test the interface? (totally unpaid and you'd need to built it with your own comps! But PIC code supplied). Secondly, is there anyone who can write DLLs in VB6 should need the arise. For now just reply here if you can help on either. John H will then put up a web site through which comms can first be made on this.

Any help would be appreciated ---

John
Top of pagePrevious messageNext messageBottom of page Link to this message

Magnum4
Frequent Contributor
Username: Magnum4

Post Number: 166
Registered: 04-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 27 February, 2006 - 09:26 pm:   Edit Post Delete Post Print Post

Yes John. Id be happy to test. Im useing the original EPE pic tut board and the Magneta pic toolkit board wired together. Dont know if this matters or not.
Cant help with the Vb :-(
Regards,
Jim
Top of pagePrevious messageNext messageBottom of page Link to this message

John_becker
:::: Super User ::::
Username: John_becker

Post Number: 134
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Monday, 27 February, 2006 - 10:30 pm:   Edit Post Delete Post Print Post

That's great Jim, thank you. I'll draw John H's attention to your reply.

J
Top of pagePrevious messageNext messageBottom of page Link to this message

Terrym
Frequent Contributor
Username: Terrym

Post Number: 170
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 28 February, 2006 - 12:40 am:   Edit Post Delete Post Print Post

I'll happily build and test an interface also. I'm using a homebuilt programmer based on the TK3 design, but willing to build an original TK3 for testing. Not able to help with software, not enough experience in that area.
TM
Top of pagePrevious messageNext messageBottom of page Link to this message

Johnh
Valued Member
Username: Johnh

Post Number: 12
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 28 February, 2006 - 01:57 am:   Edit Post Delete Post Print Post

Hi all

Just a quick response to the post by JB.

I have agreed with John that I will attempt to provide a USB interface to TK3 BUT I make no guarantee that I will get the interface to work nor will I indicate how long this development may take.

Having got that out of the way I have informed John that I hope to have proven the concept of the interface by the weekend but even if that is successful there will still be lots to do so please be patient.

As has been discussed already there are two ways (at least) to approach this interface, one using an 18F2550 (or similar) and the other by using a FTDI FT245 chip but as that chip is surface mount only (and that would put many prospective users off) I would use a ready built UM245R module. This module plugs into a 24 pin 0.6” socket so is ideal for using on vero / strip board and cost £11.00 +vat & p&p (equates to £18.92).

The simplest interface (and therefore the one I will adopt (at least initially) is 18F2550 based as all that is required is the 18F2550, a small piece of Vero, 1 resistor, 4 capacitors a 20Mhz xtal, a USB PCB mounted socket and a 36 pin Centronics / IEEE488 Plug. ( I cannot find a supplier of a PCB mounted plug – does anybody know of a source in the UK?). If a PCB mounted plug cannot be sourced then I guess that all users are capable of wiring and securing a plug to the interface such that it can plug into the TK3 socket. Total cost should be less than £10.00

The FTDI approach would require the same discrete components with an 18F252 ('cos I have some available but in essence a much smaller chip could be used including the 16F series). The USB socket would not be required as the module already has one. The cost of those items together with UM245R module total would cost in the order of £25 -£30.

The software will be totally free. I will supply a modified version of TK3 source and exe together with hex code for the PIC and Windows based drivers.

I am not sure of the value of the source code for the PIC side of the design as it will be designed around the Forest Electronics USB library in conjunction with their C compiler. If for any reason I decide to move to the FTDI solution then it will will be coded in Forest's C but NO USB code will be required and I will make the source available. (The only likely reason for moving to the FTDI approach is if I hit code problems with the USB library).

I already have LCDs being driven from a USB interface using both approaches and, in essence, the TK3 code is not much different. The LCDs have a 7 pin port that can be both written to and read from; TK3 requires a 6 pin interface handling both reading and writing.

By the weekend I should have the hardware built and the interim version of the code available to test the viability of the approach.

Currently I am modifying the TK3 code by placing a USB button on the 'front panel' and placing lots of' if....else' statements around the existing Out and Inp 'calls'. This approach requires a lot of changes and a much better way would be to use a dll that could overwrite the existing inpout32.dll as this could result in no changes being made to TK3 code at all. As I have never written a dll I am unhappy about attempting this and certainly in the short term will not even think about it, later who knows?

If any one out there feels like assisting and is prepared to create a dll please say so and I will get back to you to discuss the exact requirements. Not very demanding really, to pass via a standard COM interface details such as Input or Output Cmds (could be just 0 or 1) followed by port number (the parallel port numbers not the COM port) and the data. Sounds simple to me but then I can say that as I have no idea of what would really be involved.

Finally, when (if) I get the whole thing working I will require volunteers to do beta type testing before releasing the project as a finished product. Such volunteers would be expected to construct their own interface hardware at their own cost (no money is being made out of this exercise by any one at all). If such people cannot program the 18F2550s (TK3 cannot currently do so) I would be prepared to offer a service in which an 18F2550 could be sent to me and I would program it for you BUT only if a pre-paid return Jiffy bag (or similar) is sent along with the chip.

Finally can I appeal for patience I will provide regular updates and it will be ready 'when it is ready!'

Needless to say JohnB is an essential member of this development team (currently just me and him) but I do expect it to grow.

Sorry about the long(ish) post but I thought it right to let all readers of CZ know all of the facts so that they can set their expectations accordingly.

Now for some sleep.

JohnH
Top of pagePrevious messageNext messageBottom of page Link to this message

Terrym
Frequent Contributor
Username: Terrym

Post Number: 171
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 28 February, 2006 - 03:03 am:   Edit Post Delete Post Print Post

JohnH, have you checked out Microchips application note AN956. It provides details on using a 18f2550 as a Serial/USB interface and they provide all the code for the Windows side of things. It uses drivers that are already inbuilt to Windows.
TM

Re the plug. Would it not possibly be better to use a DB25 pcb socket? That way, users current parallel cable would plug straight into it

(Message edited by terrym on 28 February, 2006)
Top of pagePrevious messageNext messageBottom of page Link to this message

Terrym
Frequent Contributor
Username: Terrym

Post Number: 172
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 28 February, 2006 - 03:44 am:   Edit Post Delete Post Print Post

Found Centronics male pcb connector here:-

http://www.westfield.co.uk/hc/5745.htm
TM
Top of pagePrevious messageNext messageBottom of page Link to this message

John_becker
:::: Super User ::::
Username: John_becker

Post Number: 137
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Tuesday, 28 February, 2006 - 08:05 am:   Edit Post Delete Post Print Post

Thank you TerryM as well. I'll leave it to John H to contact you & Jim directly, it seems like your emails are active via here, looking at your profiles.

John
Top of pagePrevious messageNext messageBottom of page Link to this message

Johnh
Valued Member
Username: Johnh

Post Number: 13
Registered: 05-2005

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 01 March, 2006 - 02:15 am:   Edit Post Delete Post Print Post

Terrym

Thanks for the info about the Centronics plug. As I was thinking of plugging the adapter directly into the TK3 I had not given any thought to the use of a DB25 socket, but it is a good idea. When I write up the constuctional guide I will include that method as an alternative approach.

Reference the M'Chip data, yes I think that I have all that they have provided, but some of it is not exactly 'light' reading. However, as I use a USB C library which is basically a modified version of their CDC software, I do not need to fully understand all of their code. I already have one fully working application using the modified CDC code and much of that code can also be used for the TK3 interface.

John H

(Message edited by johnh on 01 March, 2006)

Administration Administration Log Out Log Out   Previous Page Previous Page Next Page Next Page