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 to TTL converter
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Tom1234



Joined: 06 Jan 2013
Posts: 39

View user's profile Send private message

USB to TTL converter
PostPosted: Thu May 02, 2013 1:18 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu May 02, 2013 3:26 am     Reply with quote

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

View user's profile Send private message

USB to TTL converter
PostPosted: Thu May 02, 2013 10:53 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu May 02, 2013 12:24 pm     Reply with quote

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

View user's profile Send private message

USB to TTL converter
PostPosted: Thu May 02, 2013 3:09 pm     Reply with quote

I use something like this (I don't have the datasheet) :

http://www.ebay.com/itm/1pcs-USB-2-0-to-TTL-UART-6PIN-Module-Serial-Converter-CP2102-STC-new-/110954294607?pt=LH_DefaultDomain_0&hash=item19d5642d4f


I use 3.3V power supply (is the same power supply with the microcontroller)
temtronic



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

View user's profile Send private message

PostPosted: Thu May 02, 2013 7:05 pm     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Thu May 02, 2013 7:48 pm     Reply with quote

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. Very Happy
Gabriel



Joined: 03 Aug 2009
Posts: 1085
Location: Panama

View user's profile Send private message

PostPosted: Fri May 03, 2013 7:30 am     Reply with quote

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

View user's profile Send private message

USB to TTL converter
PostPosted: Mon May 06, 2013 7:36 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon May 06, 2013 10:19 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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