Author Topic: FTDI FT232 and PIC16f628a  (Read 17559 times)

0 Members and 1 Guest are viewing this topic.

Offline thakingTopic starter

  • Contributor
  • Posts: 18
FTDI FT232 and PIC16f628a
« on: October 02, 2010, 08:41:48 pm »
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?

 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11671
  • Country: my
  • reassessing directives...
Re: FTDI FT232 and PIC16f628a
« Reply #1 on: October 03, 2010, 12:13:03 am »
no need to make the driver. just choose your OS and download the D2XX Driver from here http://www.ftdichip.com/Drivers/D2XX.htm
you can as well download the VCP Driver for the programming, but that is an older mechanism.
« Last Edit: October 03, 2010, 12:15:34 am by shafri »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline TheDirty

  • Frequent Contributor
  • **
  • Posts: 440
  • Country: ca
Re: FTDI FT232 and PIC16f628a
« Reply #2 on: October 03, 2010, 01:29:42 am »
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.
Mark Higgins
 

Offline thakingTopic starter

  • Contributor
  • Posts: 18
Re: FTDI FT232 and PIC16f628a
« Reply #3 on: October 03, 2010, 09:41:52 am »
No,I have:
- win7 x64
-Usb->Serial (FTDI) (ft232rl) link1, Link2
I have connected on PC, all drivers are OK, win7 recognised ftdi as COM4.....
-PIC16f628a
-temperature sensor ds18b20

For 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 Schematci
 

Is anyone make this, any useful link?
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11671
  • Country: my
  • reassessing directives...
Re: FTDI FT232 and PIC16f628a
« Reply #4 on: October 03, 2010, 02:49:28 pm »
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 :(
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline semaphore

  • Contributor
  • Posts: 29
  • KISS principle ... RTFM
Re: FTDI FT232 and PIC16f628a
« Reply #5 on: October 03, 2010, 06:02:10 pm »
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 <=> PIC

Here is my suggestion
To 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
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: FTDI FT232 and PIC16f628a
« Reply #6 on: October 04, 2010, 11:26:34 am »
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#.
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline gonnafail

  • Contributor
  • Posts: 18
Re: FTDI FT232 and PIC16f628a
« Reply #7 on: October 04, 2010, 02:09:06 pm »
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
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: FTDI FT232 and PIC16f628a
« Reply #8 on: October 04, 2010, 02:46:18 pm »
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).
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline PeterG

  • Frequent Contributor
  • **
  • Posts: 831
  • Country: au
Re: FTDI FT232 and PIC16f628a
« Reply #9 on: October 04, 2010, 02:49:32 pm »
Thanking,
    have a look here for plenty of examples of how to do this.
http://www.codeproject.com/

Regards
Testing one two three...
 

Offline TheDirty

  • Frequent Contributor
  • **
  • Posts: 440
  • Country: ca
Re: FTDI FT232 and PIC16f628a
« Reply #10 on: October 04, 2010, 02:59:56 pm »
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.
« Last Edit: October 04, 2010, 03:02:43 pm by TheDirty »
Mark Higgins
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11671
  • Country: my
  • reassessing directives...
Re: FTDI FT232 and PIC16f628a
« Reply #11 on: October 04, 2010, 03:19:49 pm »
if the OP is talking about pic's USB, not the FTDI USB then this thread might do some help https://www.eevblog.com/forum/index.php?topic=1263.0
look at migsantiago's reply #2 = http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en547784
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11671
  • Country: my
  • reassessing directives...
Re: FTDI FT232 and PIC16f628a
« Reply #12 on: October 04, 2010, 03:26:32 pm »
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 here http://www.ftdichip.com/Support/Documents/ProgramGuides.htm
« Last Edit: October 04, 2010, 03:32:48 pm by shafri »
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline giorgos3924

  • Newbie
  • Posts: 7
Re: FTDI FT232 and PIC16f628a
« Reply #13 on: August 11, 2011, 06:31:05 pm »
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 <=[UART]=> AVR - ATmega8535
i 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

 

Offline DavidDLC

  • Frequent Contributor
  • **
  • Posts: 755
  • Country: us
Re: FTDI FT232 and PIC16f628a
« Reply #14 on: August 12, 2011, 04:11:35 am »
There is application notes on the FTDI page that will have examples
For example see the attached file
 

Offline giorgos3924

  • Newbie
  • Posts: 7
Re: FTDI FT232 and PIC16f628a
« Reply #15 on: August 12, 2011, 08:40:22 am »
this is a console application?
i search some example with AVR.
« Last Edit: August 12, 2011, 08:43:06 am by giorgos3924 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf