CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

USB advice

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
diode_blade



Joined: 18 Aug 2014
Posts: 55
Location: Sheffield, South Yorkshire

View user's profile Send private message Send e-mail

USB advice
PostPosted: Wed Aug 10, 2016 3:28 am     Reply with quote

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: 19518

View user's profile Send private message

PostPosted: Wed Aug 10, 2016 4:17 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 10, 2016 4:44 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Aug 10, 2016 5:00 am     Reply with quote

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

View user's profile Send private message Visit poster's website

Re: USB advice
PostPosted: Fri Aug 12, 2016 8:41 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Aug 13, 2016 4:50 am     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Sat Aug 13, 2016 11:04 am     Reply with quote

http://www.ftdichip.com/Support/Documents/DataSheets/Modules/DS_UM232R.pdf

is what you want - for TTL level connection
In The USA
Future
Mouser
and Digikey have it .
-------------------------
in a finished design :

http://www.mouser.com/ds/2/163/DS_FT232R-11534.pdf
$2.65 each by the reel
no crystal needed - 5v and 3,3v operation
driver for every OS - maps as if it was
a UART under windows.

very robust chip with good driver support
-------------------
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Aug 13, 2016 2:06 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Aug 17, 2016 12:39 am     Reply with quote

Thank you all for the reply's, given me plenty of food for thought.
cheers all
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group