View previous topic :: View next topic |
Author |
Message |
diode_blade
Joined: 18 Aug 2014 Posts: 55 Location: Sheffield, South Yorkshire
|
USB advice |
Posted: Wed Aug 10, 2016 3:28 am |
|
|
Hi Guys just after a bit of advice.
If I wanted to get a pic (non usb PIC) to communicate over a USB link to a PC.
I presume i can do that by using an FTDI interface board to handle serial data from the PIC to send to the PC over USB.
From those in the know what are the difficulties with writing a Windows program to read and display this data and can anyone point me in the right direction of where to look.
Regards Dave |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Wed Aug 10, 2016 4:17 am |
|
|
Get a module that gives TTL out.
So (assuming you are using a 5v PIC), something like the
FTDI: TTL-232R-5V-PCB (or the 3.3v version for a 3.3v PIC)
Alternatively they do the whole thing built into a cable as the TTL-232R-5V
Problem is that most of the common USB to serial converters give something approximating RS232 signalling voltages. To talk to these the PIC then needs an interface (typically a MAX232). The TTL modules avoid this extra complexity/cost. The signals from this will connect directly to the UART pins on a PIC.
At the PC end, it just appears as a UART, so any code that talks to standard serials can talk directly to this (and therefore to the PIC). |
|
|
diode_blade
Joined: 18 Aug 2014 Posts: 55 Location: Sheffield, South Yorkshire
|
|
Posted: Wed Aug 10, 2016 4:44 am |
|
|
Ttelmah wrote: | Get a module that gives TTL out.
So (assuming you are using a 5v PIC), something like the
FTDI: TTL-232R-5V-PCB (or the 3.3v version for a 3.3v PIC)
Alternatively they do the whole thing built into a cable as the TTL-232R-5V
Problem is that most of the common USB to serial converters give something approximating RS232 signalling voltages. To talk to these the PIC then needs an interface (typically a MAX232). The TTL modules avoid this extra complexity/cost. The signals from this will connect directly to the UART pins on a PIC.
At the PC end, it just appears as a UART, so any code that talks to standard serials can talk directly to this (and therefore to the PIC). |
Thanks Ttelmah, I can buy a board that will communicate directly with the PIC either via SPI/IC2/or the onboard Uart then handles all the uSB stuff to talk to the PC over USB. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Wed Aug 10, 2016 5:00 am |
|
|
I've been buying/using 'off shore' TTL<>USB modules for years, 100% of them work fine. They all have both 5v0 and 3v3 power on them as well as 2 LEDs (data and power). I remove the power LED as it's way too bright for my eyes and gives me another 10ma for 'project power'.
Currently they're only $2 CDN a board.
Jay |
|
|
w2drz
Joined: 27 Dec 2006 Posts: 55 Location: Western New York - USA
|
Re: USB advice |
Posted: Fri Aug 12, 2016 8:41 pm |
|
|
diode_blade wrote: | Hi Guys just after a bit of advice.
If I wanted to get a pic (non usb PIC) to communicate over a USB link to a PC.
I presume i can do that by using an FTDI interface board to handle serial data from the PIC to send to the PC over USB.
From those in the know what are the difficulties with writing a Windows program to read and display this data and can anyone point me in the right direction of where to look.
Regards Dave |
USB to PIC part
use this DB9-USB-D5-F Digi-Key # 768-1108-ND
"NO RS232 chip" as will destroy the DB9, data go to rx & tx pins of pic.
same as normal db 9 I/O |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Sat Aug 13, 2016 4:50 am |
|
|
WRT a Windows program to read/display data from the PIC, it depends upon what version of Windows you're using.
With win3.1, win98 you could use QB45(BTDT !), with XPh, XPp and newer Delphi work fine. VBasic may be OK though I've never used it. I use Delphi as it creates a 100% stand alone program NOT requiring any DLLs from Windows. What this means is a Delphi program that works on say XP will work on ANY PC using any version of Windows,so it's transportable. It also produces very tight(small) code.
Being 'old school', I've stuck with QB45 and Delphi, getting too old to learn yet another language.....
Jay |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Sat Aug 13, 2016 2:06 pm |
|
|
yeesh, $2.65 for just the chip ! I'm buying complete TTL<>USB modules for just $2 CDN. They have the USB connector, 2 LEDS, Rs,Cs,xtal and 5 pins to I/F with PIC.
Jay |
|
|
diode_blade
Joined: 18 Aug 2014 Posts: 55 Location: Sheffield, South Yorkshire
|
|
Posted: Wed Aug 17, 2016 12:39 am |
|
|
Thank you all for the reply's, given me plenty of food for thought.
cheers all |
|
|
|