FTDI FT232 and PIC16f628a - Page 1
Forum section: electronics / beginners

author: thaking
author_rank: Contributor
timestamp: October 02, 2010, 08:41:48 pm
content: I make USB to serial "module"(it's worked OK, I try to conect on terminal with putty, and connect together TX and RX, all work FINE), and now I want for beginning, turn LED on my circuit with PIC(I made this standalone, without PC)...I use MPLAB and CSS for programming in c.Now I need "help" to programme in visual c or anything else to make "driver" for ft232?Any example, links?

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 03, 2010, 12:13:03 am
content: no need to make the driver. just choose your OS and download the D2XX Driver from herehttp://www.ftdichip.com/Drivers/D2XX.htmyou can as well download the VCP Driver for the programming, but that is an older mechanism.

author: TheDirty
author_rank: Frequent Contributor
timestamp: October 03, 2010, 01:29:42 am
content: I assume he's talking about programming the PIC side. I don't use PIC's, but there are plenty of serial libraries out there for them.

author: thaking
author_rank: Contributor
timestamp: October 03, 2010, 09:41:52 am
content: No,I have:- win7 x64-Usb->Serial (FTDI) (ft232rl)link1,Link2I have connected on PC, all drivers are OK, win7 recognised ftdi as COM4.....-PIC16f628a-temperature sensor ds18b20For beginning I want to make programme(application) in Microsoft Visual Studio(Visual C++) that can read values from PIC via SERIAL->USB(RX,TX). I don't know how to started but I want to learn it. I'm also beginner in programming PIC's, I programming them in MPLAB and CSS!Schematic is:http://www.bloggang.com/data/uten-microcontroller/picture/1241095854.jpg]LINK to SchematciIs anyone make this, any useful link?

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 03, 2010, 02:49:28 pm
content: have u connect the usb->serial to pic? any picture? whats your progress so far on programming side. Now TheDirty confused me already, i'm not sure i understand anymore

author: semaphore
author_rank: Contributor
timestamp: October 03, 2010, 06:02:10 pm
content: I think I understand what he is trying to do. He wants to write a GUI in Visual Studio (C++) to interface with his PIC using FTDI chip as a bridge.COM <=> FTDI <=> PICHere is my suggestionTo write a nice GUI in C/C++ is not an easy task. I would suggest you go with C# or Basic or even Process. However, the first thing I would do is one way communication. Which mean writing a program in PIC to send serial data to the computer via FTDI. You should be able to do this very easily. Then use the terminal program like Hyperterminal to look at the output from PIC. Once all this done perfectly then you can start writing PIC code to accept input. The input can be simple as ASCII character coming from Hyperterminal. Use those input to make decision.After that is it time to spice up the GUI. You can then use VB, VC# or VC++ (VB is the easiest) to make a nice GUI. Here is the list of SerialPort Class with some example.http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx

author: scrat
author_rank: Frequent Contributor
timestamp: October 04, 2010, 11:26:34 am
content: The Microchip's USB framework can help you, I think, since there is an example which manages a USB serial emulation interface made directly by the PIC, with program examples also for the PC side in Visual C++.In this case it shouldn't change too much on the PC side, since you still see a serial COM port, and all you have to do is exchange data on that.Try installing Visual Studio Express 2005 (it's free), perhaps it needs some patches to run on Win 7, it should be documented on Microsoft site. The help on Visual C++ there is quite good, and helps you making modifies to the example software.Of course, some knowledge on C++ is needed, but I think the same would be for C#.

author: gonnafail
author_rank: Contributor
timestamp: October 04, 2010, 02:09:06 pm
content: Do you happen to have a link to the microchip example? I have been searching through their site for exactly that with out much luck. I want to connect a USB enabled pic through USB and have it show up as a com port. All of the examples I have found go into the USB protocol which is more than I want to deal with right now.Thanks

author: scrat
author_rank: Frequent Contributor
timestamp: October 04, 2010, 02:46:18 pm
content: Well, I have tried the various drivers supplied by Microchip, and worked a little with the WinUSB example. It's quite simple to manage, if you know a bit of C++. For example, I developed a simple window for setting PWM, and reading voltage and waveform from the PIC.However, just looking at the CDC - Basic Demo inside the Microchip USB Framework (which uses emulation of the serial port), it should not be too different: the example is a hyperterminal-like window, where you can communicate with the PIC. Upon the communication "engine" which is already done there, you can develop almost every display and measure you'd like, just using the graphic editor and writing few lines of code for the object's callback. In practice you need to find the available COM ports, open them as an object, and then use that object as a gateway to communicate to the USB device. Typically the PIC will receive a byte at a time or an array of bytes (I think that for serial emulation it will be a byte at a time), and then you will write the code on the PIC which reacts to the received data.The basics should be the same both for an USB enabled PIC and a FTDI+PIC UART, since on the PC side you see a serial port, while on the PIC side you see an incoming data (examples show how to catch them and how to transit back an answer).

author: PeterG
author_rank: Frequent Contributor
timestamp: October 04, 2010, 02:49:32 pm
content: Thanking,have a look here for plenty of examples of how to do this.http://www.codeproject.com/Regards

author: TheDirty
author_rank: Frequent Contributor
timestamp: October 04, 2010, 02:59:56 pm
content: Not directly related, but I recently found a serial class for PHP which allows me to communicate over the web to my little RF server. Right now I can open and close my garage anywhere in the world that there's an internet connection. My Wife found this hilarious. The FTDI comm drivers are built into most linux distro's and I can just talk directly to ttyUSB0.For a beginner with no specific language preference, I think C# would be the easiest to get started with. There are a million beginner tutorials from the ground up.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 04, 2010, 03:19:49 pm
content: if the OP is talking about pic's USB, not the FTDI USB then this thread might do some helphttps://www.eevblog.com/forum/index.php?topic=1263.0look at migsantiago's reply #2 =http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en547784

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 04, 2010, 03:26:32 pm
content: if the OP is talking about FTDI's USB, not the pic USB, then just include the ftd2xx.h and ftd2xx.lib in your VC++ and start reading "D2XX Programmer's Guide" .pdf and how to call the API which available herehttp://www.ftdichip.com/Support/Documents/ProgramGuides.htm

author: giorgos3924
author_rank: Newbie
timestamp: August 11, 2011, 06:31:05 pm
content: Hi,I want to make a software with Visual C++ and hardware to communicate with pc.I use FT232RL and i search some full example to do this.I want to transfer just some bytes to and from pc with USB.in hardware i use FT232RL and someone AVR, i select ATMega8535.PC <=> FT232RL <==> AVR - ATmega8535i want to just send some bytes in my AVR, and there i choice the function to do.depending the data avr/pc do some function

author: DavidDLC
author_rank: Frequent Contributor
timestamp: August 12, 2011, 04:11:35 am
content: There is application notes on the FTDI page that will have examplesFor example see the attached file

author: giorgos3924
author_rank: Newbie
timestamp: August 12, 2011, 08:40:22 am
content: this is a console application?i search some example with AVR.