USB interface

From DIY contraptions to sophisticated FreeEMS-specific designs! Plus general hardware development!
Post Reply
User avatar
sry_not4sale
LQFP144 - On Top Of The Game
Posts: 568
Joined: Mon Mar 31, 2008 12:47 am
Location: New Zealand, land of the long white burnout
Contact:

USB interface

Post by sry_not4sale »

My first goal as a contributor will be to make usb work!! Or at least try!!!


Admin wrote:Another alternative for usb <> uart interface doing away with the rs232 physical transfer layer :

Image

http://www.ftdichip.com/Products/Evalua ... MM232R.htm
http://apple.clickandbuild.com/cnb/shop ... tle=MM232R

...and EVEN smaller :

Image

http://www.ftdichip.com/Products/Evalua ... UB232R.htm
http://apple.clickandbuild.com/cnb/shop ... tle=UB232R

On another note, this board has a usb host controller with transparent fat support on it! that means super easy datalogging to a usb hard drive (flash or full on big disk) :

Image

http://www.vinculum.com/prd_vnc1l.html
http://www.saelig.com/miva/merchant.mvc ... Code=UI1E3

It's cheap enough, and should be dead simple to write an interface for. It should also leave you with virtually unlimited datalogging for continuous runs on track, or long drives etc etc etc.

Pretty cool little device really.

Admin.
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
User avatar
sry_not4sale
LQFP144 - On Top Of The Game
Posts: 568
Joined: Mon Mar 31, 2008 12:47 am
Location: New Zealand, land of the long white burnout
Contact:

Re: USB interface

Post by sry_not4sale »

What do we wish to achieve?

- Real time communication with a pc or other display to show engine information ?
- Connection with PC for downloading of firmware ?
- Allow plugging in of usb stick for logging ?


The last chip above with the ability to interface as a fat file system, does it also allow real time traditional style usb communication?


Todo for me:
- Research usb spec
- Get to terms with our hardware
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: USB interface

Post by Fred »

ok, we'll be using the standard rs232 serial software layer protocol (if such a thing exists, i'm lacking nomenclature here), which will then allow either rs232 physical, or uart > usb rs232-free use. the software on both sides remains the same.

If you checked the developer task assignment sticky you would see that Cam is on the job on this. Go hard though, but keep in touch with him as he may have started already.

Share what you have with me/him/everyone whenever you feel it's useful. either as a diff on a particular version, or a complete release.

The way I would like it done is to set a flag in the serial ISR which you may need to set in the vector table. The check that flag in the main loop and run a function from there to do the transmit or receive. I'm not sure how practical this is though. It should be ok for sending out to the PC, but may not be/probably won't be ok for receiving back instructions etc. What we should do receiving wise though is just buffer the data and set a flag to do something with it. I'm not sure how that will work either.

The GEL library has some serial printf stuff in it, it's GPL so we can use it, BUT, it's supposed to be dog slow, so we probably won't want to medium/long term. It will be a good way to get started though.

There is a serial protocol thread here that you should read and comment on if you have any. Keep that stuff in mind while you dev, and, GOOD LUCK :-)

I'll link Cam to this thread.

Admin.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Tony
QFP80 - Contributor
Posts: 50
Joined: Mon Mar 31, 2008 11:47 pm

Re: USB interface

Post by Tony »

Parallax has some great products they have a USD datalogger that might fit the bill also, have a look and see i have no idea whats needed for the USB so this may not work but here it is .



http://parallax.com/Store/Accessories/C ... roductName

And the PDF http://parallax.com/Portals/0/Downloads ... erV1.0.pdf



They also have some example codes to look at but they would only be good for the parallax processors not the free scale.
User avatar
sry_not4sale
LQFP144 - On Top Of The Game
Posts: 568
Joined: Mon Mar 31, 2008 12:47 am
Location: New Zealand, land of the long white burnout
Contact:

Re: USB interface

Post by sry_not4sale »

I am placing links I am finding here:

http://del.icio.us/sry_not4sale/ems





So UART simply lets you use the RS-232 protocol over a USB connection? Sounds good to me.

Do you still set up USB pipes and a class?
Owner / Builder: 1983 Mazda Cosmo 12at (1200cc 2-rotor turbo) coupe [SPASTK]
165hp @ 6psi standard - fastest production car in japan Oct 82
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: USB interface

Post by Fred »

UART is the lower level short distance physical protocol used to get the data off the CPU and into the max232 for rs232 or a usb>uart chip for usb instead of serial. This is native to the CPU and therefore fast. The pipes and class are handled by the embedded uart>usb device and the drive for that. To PC software it just looks like COM1 or /dev/ttyUSB0 etc. You can't distinguish the difference between serial and this. That is what makes it attractive. It eliminates the errors that usb>serial converters often cause and provides potentially higher speeds too if selected. Both the CPU and PC see it this way, we are just optionally ditching the physical RS232 layer for speed and accuracy.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Post Reply