| View previous topic :: View next topic |
| Author |
Message |
Tom1234
Joined: 06 Jan 2013 Posts: 39
|
| USB to TTL converter |
Posted: Thu May 02, 2013 1:18 am |
|
|
asmboy, you mean that if i connect the USB to TTL converter and to use a simple printf ... (like an RS232 protocol) it will be ok ?
(I tried this and is not work ) |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20161
|
|
Posted: Thu May 02, 2013 3:26 am |
|
|
In which case you have something connected wrong....
Yes. This is the whole point. The modules you are talking about remove _any_ need to think about USB at all. They generate a TTL async serial connection which goes directly to the PIC UART. USB is not involved as far as the PIC is concerned.
Remember you need to connect the TX pin on the module to the RX pin on the PIC, and vice versa. Also the ground must also be connected.
Have you verified the PIC is actually running, and at the right speed?.
Best Wishes |
|
 |
Tom1234
Joined: 06 Jan 2013 Posts: 39
|
| USB to TTL converter |
Posted: Thu May 02, 2013 10:53 am |
|
|
Yes Ttelmah the Pic is running, (at the right speed). I succesfull implemented in the past the RS 232. I used the the same code and for the hardware i used the TX/RX pin of the PIC (which i used for the rs 232).
The only different was the RST (reset) pin of the converter which i tried to use it to PIC's pin and put the code (output_low(pin_A0);/output_high((pin_A0);)
or even i tried to connected to VDD/GND. |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9658 Location: Greensville,Ontario
|
|
Posted: Thu May 02, 2013 12:24 pm |
|
|
You should post a link to the datasheet for the USB-ttl module you're using to help us help you.
The ones I use do not have a reset pin on them.
Also are you powering the PIC from the 5V on the USB side or other source?
The more details you supply the better/quicker we can have you 'up and running'.
hth
jay |
|
 |
Tom1234
Joined: 06 Jan 2013 Posts: 39
|
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9658 Location: Greensville,Ontario
|
|
Posted: Thu May 02, 2013 7:05 pm |
|
|
Went to ebay link, tried to download the 'material_download' and it failed...but..
it seems to be a CP2102 type unit....
so the 'reset' pin isn't really reset, should be labelled *reset, meaning active low.
The cp2010 datasheet says to have a 4k7 pullup resistor on that pin.
Without knowing the real pinout I can't help further other than tying txd to rxd should allow 'loopback' testing as I've previously said.
hth
jay |
|
 |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Thu May 02, 2013 7:48 pm |
|
|
I don't own stock in FTDI
but i suggest their chips and appliance adapters that use them, because they work consistently well ( for me and my clients) on all sorts of host OS's
and have an excellent approach to recovery after USB line errors and other such faults.
I've tried other adapters, and not been happy.
4 me - time=$
so thats that from me on this subject.  |
|
 |
Gabriel
Joined: 03 Aug 2009 Posts: 1085 Location: Panama
|
|
Posted: Fri May 03, 2013 7:30 am |
|
|
I bet that 15$ sparkfun board is looking pretty good now, huh? _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
 |
Tom1234
Joined: 06 Jan 2013 Posts: 39
|
| USB to TTL converter |
Posted: Mon May 06, 2013 7:36 pm |
|
|
I used also the 4.7K resistor and also
output_low(pin_B5);
//output_high(pin_B5);
(i tried output_low and output_high) but in both case i see garbage at the screen
Can i try anything to work right this converter ????? |
|
 |
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Mon May 06, 2013 10:19 pm |
|
|
Hi,
The 'Reset' connection is *probably* an output that is used for 'flow control'.
I've seen several similar modules where Reset is derived from the 'DTR'
signal. My advice would be to leave this pin disconnected.
The module is probably powered by the USB bus, so it doesn't need to
receive any power to run.
I would make the following electrical connections:
USB Module GND connects to PIC GND
USB Module TxD connects to PIC RxD
USB Module Rxd connects to PIC Txd
Leave all other pins on the USB module disconnected.
I'm assuming you are running some version of Windows? Can you use the
'Device Manager' to verify that your USB module is actually found by the
OS, and that a (virtual) COM port number is assigned?
Program your PIC to repetitively send a simple text message at 9600
baud. Something like this:
| Code: |
While(1)
{
printf("Hello World!!\n\r");
delay_ms(500);
}
|
Run Hyperterminal, and select the appropriate COM port number. None
of the port properties are important for a virtual port with the possible
exception of 'flow control' which I always set to 'None'...... If everything
is working you should see:
| Quote: |
Hello World!!
Hello World!!
Hello World!!
Hello World!!
Hello World!!
Hello World!!
|
Good Luck!
John |
|
 |
|