View previous topic :: View next topic |
Author |
Message |
robo4
Joined: 20 Jun 2007 Posts: 3
|
How to communicate between PIC18F4550 and USB Barcode Scaner |
Posted: Mon Aug 13, 2007 2:59 am |
|
|
Hi Everyone,I'm Mark.
I'm doing my project to connect USB Barcode Scaner(USB Low Speed of Metrologic,5145) with PIC18F4550.
And then I will show Barcode on LCD.
But Now,I can't to communicate between Barcode Scanner and PIC.
1. I want to know PIC can communicate with USB Device(such as Barcode Scanner,USB Keyboard,Flash Drive etc.)
or It can communicate with only computer.
2.Please tell me about How to communicate between PIC18F4550 and USB Barcode Scanerand How to set Register of USB Module.
Thank very much for your answers |
|
![](templates/subSilver/images/spacer.gif) |
Pret
Joined: 18 Jul 2006 Posts: 92 Location: Iasi, Romania
|
|
Posted: Mon Aug 13, 2007 4:31 am |
|
|
For this... you should read the related datasheet. First you must find out that the barcode scaner is not USB client also. If it is... you cannot link it to the PIC.
Usb is not as simple as UART or SPI. You need some experience with it. There are some examples in CCS compiler, you might find them useful.
Read the barcode scaner datasheet and find how to configure (interfaces, endpoints) the USB from PIC. If you do not have experience at all in USB related projects, you might find it quite complex. |
|
![](templates/subSilver/images/spacer.gif) |
kevcon
Joined: 21 Feb 2007 Posts: 142 Location: Michigan, USA
|
|
![](templates/subSilver/images/spacer.gif) |
robo4
Joined: 20 Jun 2007 Posts: 3
|
|
Posted: Tue Aug 14, 2007 8:43 am |
|
|
Acording to above, How can I use USB Barcode Scanner with Microcontroller? and What type of Microcontroller will I use?
Thank very much for your answers |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Tue Aug 14, 2007 8:58 am |
|
|
With the PIC, once it is programmed to RS232.
To run it using USB, you _might_ be able to use the FTDI Vinculum.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Aug 14, 2007 10:06 am |
|
|
Additional short info on USB:
In USB you have one host and many possible slave devices. Because the barcode reader acts like a slave this has the result that your microcontroller must act like the host. A host is difficult to implement as it has to support plug&play, device descriptors, etc. You don't want to write this yourself, so this leaves open only operating systems that implement this for you like, Windows, Linux, etc. These large operating systems don't run on a PIC processor, you will have to look for something like an ARM or MIPS processor.
From asking the question my guess is you don't have a lot of experience, then don't try this and forget about USB.
From the other posts I understand the barcode reader can also be configured for RS232. This is a completely different story. Much, much, easier than USB and can be handled by a PIC processor. |
|
![](templates/subSilver/images/spacer.gif) |
robo4
Joined: 20 Jun 2007 Posts: 3
|
|
Posted: Fri Aug 24, 2007 11:52 am |
|
|
Um.... Somebody told me that I can use MAX3421E to be USB HOST.
And I try to study its datasheet.It's might be possible
What is your opinion?
Thank You For Your Advices?
datasheet of MAX3421E : http://www.alldatasheet.com/view.jsp?Searchword=MAX3421E |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Fri Aug 24, 2007 12:23 pm |
|
|
Seriously, anyone who 'knows' Maxim chips, will suggest the Vinculum instead. This does the same job, and the availabilty of Maxim chips, when they are not already in huge stocks with suppliers, makes these a poor choice for many projects....
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
kevcon
Joined: 21 Feb 2007 Posts: 142 Location: Michigan, USA
|
|
Posted: Fri Aug 24, 2007 1:02 pm |
|
|
An even easier solution would be to get the RS232 cable for your gun from Metrologic or make you own and communicate with it serially.
If I remember right the gun puts out TTL levels and there is a driver chip embedded in the cable to make the signals RS232 levels. So if you made your own cable you might not need any interface chips, but you would have to verify this with a scope. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Sat Aug 25, 2007 7:26 am |
|
|
It is worth saying that with the serial cable, you could have this working in a couple of days. Implementing a USB host, for the device, even if you know the coding needed by the chip involved, is likely to be a few weeks work, and starting from scratch, is likely to take longer. Unless you absolutely 'must' have the USB solution, the serial solution is dozens of times easier...
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
|