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

Rs232 -> USB with pic16f628a

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



Joined: 17 Jun 2013
Posts: 9

View user's profile Send private message

Rs232 -> USB with pic16f628a
PostPosted: Wed Jul 03, 2013 3:52 am     Reply with quote

hello people Smile
i have the converter rs232 to usb (5v) , and when i send a character from pic to the cable i got it wrong , do i have to use level shifter or what because i thought pic have 5v and the cable as well
thnx Smile
temtronic



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

View user's profile Send private message

PostPosted: Wed Jul 03, 2013 5:12 am     Reply with quote

Yes , you will need a level converter( like a MAX232 chip) between the PIC and the RS232<>USB module.

The PIC is a 'TTL' type device,so you can use a 'TTL<>USB' module and NOT require the MAX232 device. I use this configuration all the time as the TTL<>USB modules are now only $2.50 each.The ones I use also have 3volts available allowing LF series PIC to be simply powered from the USB connection.

hth
jay
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Jul 03, 2013 11:45 am     Reply with quote

Quote:

the converter rs232 to usb (5v)


THE converter you want w/o RS-232 conversion needed is the
FTDI FT232 ( and other related parts from FTDI)
- which will TTL interface to the pic very nicely.

have used if for years now - no problems
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Wed Jul 03, 2013 11:51 am     Reply with quote

Hi,

Because you didn't tell us specifically which 'converter' you have (is it an IC?, is it a cable?, etc.), we have to make a number of assumptions in
order to answer your question! Whenever you have a hardware interface question, always post a link to the hardware you are dealing with so that
we can better assist you!

In your first ever post on the forum, you did the same thing. You asked for help with a '9g Servomotor' Shocked ...... Nobody know what that is unless
you tell us!!

We should not have to speculate about hardware issues - we won't have to if you just post the link!!

John
wiss1990



Joined: 17 Jun 2013
Posts: 9

View user's profile Send private message

PostPosted: Thu Jul 04, 2013 2:59 am     Reply with quote

sorry for the luck of information, i use cable like this :


https://www.google.tn/search?q=rs232+to+usb&source=lnms&tbm=isch&sa=X&ei=-TjVUYToFcyFhQfN6oCgAw&ved=0CAcQ_AUoAQ&biw=1600&bih=807#facrc=_&imgdii=P4ag7R5P5U9laM%3A%3BeRN3l3cpdrEOHM%3BP4ag7R5P5U9laM%3A&imgrc=P4ag7R5P5U9laM%3A%3BGgMzk537C0K-KM%3Bhttp%253A%252F%252Fwww.codeproject.com%252FKB%252Fdotnet%252FWMICodeCreator_Demo%252Fusb-serial-adapter.jpg%3Bhttp%253A%252F%252Fwww.codeproject.com%252FArticles%252F32330%252FA-Useful-WMI-Tool-How-To-Find-USB-to-Serial-Adapto%3B800%3B561

so what is the solution if i use a cable ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Thu Jul 04, 2013 3:02 am     Reply with quote

You add a MAX232.
wiss1990



Joined: 17 Jun 2013
Posts: 9

View user's profile Send private message

PostPosted: Thu Jul 04, 2013 3:04 am     Reply with quote

but max232 is not for +/-12v level ? here i need 5v level
temtronic



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

View user's profile Send private message

PostPosted: Thu Jul 04, 2013 5:29 am     Reply with quote

The MAX232 actually does TWO operations for you...and you need them both!

The 'MAX232' type devices convert TTL logic levels(0, +5) to RS232 logic levels(+12,-12) AND at the same time inverts the data(0>1,1>0).That means that when the PIC sends a logic '0' out serially, the MAX232 will invert it to a logic '1'. This is why your data appears as 'garbage'.When the PIC sends out for example the letter 'A'( 0x41), it sends out in binary 01000001. When is passes through the MAX232, it is inverted to 10111110.The receiving device's MAX232 inverts this back to 01000001 and the letter 'A' appears on the PC screen.

Your USB adapter requires 'RS232', and not 'TTL', so you will need a MAX232 between yout PIC and the adapter.

hth
jay
wiss1990



Joined: 17 Jun 2013
Posts: 9

View user's profile Send private message

PostPosted: Thu Jul 04, 2013 6:53 am     Reply with quote

thank you very much Smile do you have a schematic with exact values of the capacitors for the max232 ?
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Thu Jul 04, 2013 7:14 am     Reply with quote

read the datasheet...
_________________
CCS PCM 5.078 & CCS PCH 5.093
temtronic



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

View user's profile Send private message

PostPosted: Thu Jul 04, 2013 11:56 am     Reply with quote

I've used 1uf, 10 uf and 22uf whatever's in the junk box.....
You should read the datasheet though, as value depends upon your use.

hth
jay
wiss1990



Joined: 17 Jun 2013
Posts: 9

View user's profile Send private message

PostPosted: Thu Jul 04, 2013 2:24 pm     Reply with quote

okay thank you all Smile
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