Author Topic: Need help Serial to Parallel conversion  (Read 4170 times)

0 Members and 1 Guest are viewing this topic.

Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Need help Serial to Parallel conversion
« on: December 26, 2009, 12:57:05 PM »
Hi, my laptop does not have any Serial/Parallel ports only USB. i want to create my project (e.g. a Computer controlled RC car) to start with i need to be able to control external relays etc from my laptop.
I have a USB to Serial converter now to control external relays i need to convert these serial signal to parallel.

Please suggest how to proceed.

-cheers
sid

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,943
  • Helpful? 98
Re: Need help Serial to Parallel conversion
« Reply #1 on: December 26, 2009, 03:00:39 PM »
One way is to connect the serial adapter to a micro-controller that contains a UART. A short piece of code would take the serial data and set/reset IO pins.

Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #2 on: December 27, 2009, 03:05:33 AM »
Thanks..
I was thinking to do some thing like this:
Use a usb to serial converter to send signals to. Then convert these using a MAX232 then pass this output to an Atmega168 the o/p of this micro is parallel out put.

Please suggest am i correct. if not then ho can i do this.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,943
  • Helpful? 98
Re: Need help Serial to Parallel conversion
« Reply #3 on: December 27, 2009, 10:18:23 AM »
Yep, that will work and will give versatility in your design.

Offline galannthegreat

  • Supreme Robot
  • *****
  • Posts: 615
  • Helpful? 4
  • Blue-Lensed Blue LEDs?! What?! Impossible!!
Re: Need help Serial to Parallel conversion
« Reply #4 on: December 27, 2009, 03:11:46 PM »
You could use a shift register here. The 74HC595 would work as the chip in this case.

Check out the datasheet: http://www.fairchildsemi.com/ds/MM/MM74HC595.pdf
Here is the part on Digikey: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=MM74HC595N-ND
« Last Edit: December 27, 2009, 03:13:17 PM by galannthegreat »
Kurt

Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #5 on: December 28, 2009, 10:50:54 AM »
thanks all,

i am really new to this world; can you please throw some more light about 74HC595.

1.How to use it exactly?
2.Can it directly interfaced to a Serial Port or does it needs a uC?

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,943
  • Helpful? 98
Re: Need help Serial to Parallel conversion
« Reply #6 on: December 28, 2009, 11:51:55 AM »
I would not recommend the 74HC595. Asynchronous data from RS232 does not have a clock which the 74HC595 requires. That means an additional clock circuit and also a Start bit detection circuit. I could design these but wouldn't since it is much cheaper and easier to use a micro-controller like a PIC or Atmega with a built in UART module and independent IO ports.

Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #7 on: December 28, 2009, 12:17:38 PM »
Thanks Waltr, so i will start with Atmega then.

but to start with i need some more help, as i dont have any exposure can you please suggest from where to start with. where to find basic tutorial on atmega where i can understand what it does, what are pins specification and related terminologies i tried searching but cant find any basic, all are very high level for me :( .

As i understand uC's are blank, how to program Atmega168 for serial2parallel conversion, are there already libraries defines for this or do i need to write some and burn it in this chip.

-cheers
sid



Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,943
  • Helpful? 98
Re: Need help Serial to Parallel conversion
« Reply #8 on: December 28, 2009, 01:11:23 PM »
SoR has a number of good tutorials. Start here:
http://www.societyofrobots.com/microcontroller_tutorial.shtml

Since you have never worked with a micro-controller there will be a bit of a learning curve.
A number of people here are using the Atmega so you will also find lots of info in these forum threads, do some more searching.

Yes, you will need to write a program and 'burn' it to the chip. There are libraries to handle the UART (a serial to parallel hardware module) and SoR tutorials explaining how to use it. The libraries just make the programming easier by providing a block of code to do a higher level task. you still need to write to code that use the library functions.

There are several development boards that use the Atmega chip. The AVR and the Axon are popular and will meet your requirements. Both are talked about in the SoR tutorials.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,943
  • Helpful? 98
Re: Need help Serial to Parallel conversion
« Reply #9 on: December 29, 2009, 02:51:49 AM »
« Last Edit: December 29, 2009, 09:33:46 AM by waltr »

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
« Last Edit: December 29, 2009, 03:51:35 PM by GearMotion »

Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #11 on: December 30, 2009, 02:12:32 PM »
Thanks, but unfortunately i wont get these circuits in my country :(.

this does gave me idea that external device can be directly controlled from USB rather than my original idea of multiple conversions USB-> Serial -> Parallel, its clumsy and high risk of data loss.

when i dug a bit more found v-usb whose components are also available in my country see below:
http://www.obdev.at/products/vusb/powerswitch.html


this looks pretty simple so thinking of starting with this, have tons of doubts though.......  please suggest as a starter should i start with this.

thanks again :)

cheers,
-sid

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
Re: Need help Serial to Parallel conversion
« Reply #12 on: December 30, 2009, 03:26:21 PM »
Thanks, but unfortunately i wont get these circuits in my country :(.

What country?

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: Need help Serial to Parallel conversion
« Reply #13 on: December 30, 2009, 05:18:35 PM »
I'm gonna take a stab and say austria?
Howdy

Offline GearMotion

  • Supreme Robot
  • *****
  • Posts: 489
  • Helpful? 24
  • Two decades+ of Embedded Design
Re: Need help Serial to Parallel conversion
« Reply #14 on: December 30, 2009, 05:37:13 PM »
I'm gonna take a stab and say austria?

Then is sidz's reluctance the act of ordering off of the internet?

Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #15 on: January 01, 2010, 10:51:20 AM »
India..... i thought of ordering through online shops but shipping charges from US/UK are too much..

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Howdy

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Need help Serial to Parallel conversion
« Reply #17 on: January 02, 2010, 02:36:35 AM »
hi Sid,
V-USB uses a microcontroller to emulate a USB device in firmware. it's implementation is more complicated than most beginners projects.
since you have no microcontroller experience you would have a lot to learn before you got it working.

connecting a microcontroller to a USB to Serial dongle would be far easier.
as already mentioned, some of the tutorials on this site will guide you through beginning with microcontrollers, (look for the "$50 robot" project.)


if you want I/O over USB but want to avoid using a microcontroller altogether have a look at this device:
http://www.ftdichip.com/Products/FT245R.htm


dunk.

Offline HyperNerd

  • Robot Overlord
  • ****
  • Posts: 139
  • Helpful? 5
  • N3rd1n80r
Re: Need help Serial to Parallel conversion
« Reply #18 on: January 02, 2010, 05:44:22 AM »
If you used a PIC or Arduino I could help out with the code ;)

I think the best method here would be to use a microcontroller ie. a PIC or AT Mega, then write a simple program so it acts like a shift register, but without the need for the synchronous clock line.

Here is an idea of how to do this:

The uC receives 8 bits of serial data through UART from PC.
Each bit of the 8 bits corresponds to an output pin.
For example the 8 bits, '00000101', would switch ON outputs 0 and 2, and switch 1,3,4,5,6 and 7 off.
The microcontroller only needs to update the pins when it receives new data, so there is no need for it to remember what the last piece of data received was.

 -HyperNerd
There are 10 types of people in the world - those who understand binary, and those who don't.

Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #19 on: January 05, 2010, 10:34:59 AM »
Thanks All...

Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #20 on: January 05, 2010, 10:47:57 AM »
Thanks HyperNerd, dunk

first of all i really appreciate all of your's feedback to help me.

my original idea was to use a USB to Serial converter and write data to the serial port using communication API of java then using some hardware converrt the Serial signal to Parallel, but unfortunately as i was very new and did't had any experience so thought using an easier circuit like v-usb, where there is no coding required will be easier but my luck can get all the components in my country.

Finally had to drop the idea of using V-USB now i am back to the original  idea suggest by waltr and you all of using mc (Atmega/PIC).

As suggest and as i read using an Atmega will be lot more easier, but i am open to both, i am still looking for a proper hardware as well as software using either an PIC/Atmega to achieve this.

thanks again to all.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,943
  • Helpful? 98
Re: Need help Serial to Parallel conversion
« Reply #21 on: January 05, 2010, 12:40:41 PM »
Well you will learn doing it with a Atmega/PIC. Then you can improve the design.

Good luck and keep us posted with your progress.

Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #22 on: January 23, 2010, 06:03:37 AM »
hey, i finally decided to start using a PIC, designed the circuit as well as software to be burnt and bought all the components...!!!

well was thinking to start with but before starting was going through the data sheets of MAX232 and PIC and here got a set back :-[
as in max232 can recognize only voltage level between -3 to -15 and +3 to  +15..... as i am using a USB2serial converter when i checked the voltage levels at the Tx pin ... it hardly shows 0.3 volt when its is transmitting....

Can anyone suggest a way to overcome this what i think, i need to place some sort of voltage amplifier between my USB2Serial converter output and MAX232 in..... but dosent have any clue what to do...

cheers,
 sid

Offline Pratheek

  • Contest Winner
  • Robot Overlord
  • ****
  • Posts: 125
  • Helpful? 3
Re: Need help Serial to Parallel conversion
« Reply #23 on: January 23, 2010, 07:31:00 AM »
I think you do not need a MAX 232 IC between the USB to serial converter you are using and your microcontroller. I guess the USB to serial converter itself gives you +0 and +5 V outputs.

Could you post a picture of the converter you are using.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,943
  • Helpful? 98
Re: Need help Serial to Parallel conversion
« Reply #24 on: January 23, 2010, 09:47:59 AM »
There are two sides on the MAX232, the TTL side and the RS232 side. The RS232 side (a comm port on a PC) is +15 to -15 volt. The TTL side is 0 to 5V. The TTL side connects to the PIC (the UART pins) the RS232 side goes to the 9-pin D connector on you PC. The MAX232 inverts and level shifts the PIC TTL signals to RS232 level signals in one direction and the reverse in the other direction.
There is a ton of info on using a MAX232 and a PIC. Do a little googling to find examples (SoR even has a tutorial on using the MAX232).

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Need help Serial to Parallel conversion
« Reply #25 on: January 23, 2010, 06:37:51 PM »
Hi,

[...] when i checked the voltage levels at the Tx pin ... it hardly shows 0.3 volt when its is transmitting....
How did you check that?

If you use a voltmeter while transmitting, you would see a somewhat integrated signal and since it shifts between positive and negative signals, they'll sum up to something relatively close to 0V (assuming everything works).

What do you measure on TX and RX (relative to ground/0V) when NOT transmitting?
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #26 on: January 24, 2010, 04:14:58 AM »
Hey Soeren thanks i understand what you try to say. now to answers the question

How did you check that?
What do you measure on TX and RX (relative to ground/0V) when NOT transmitting?

I used a voltage meter to measure the voltage levels.
While not transmitting on Tx & Rx it shows something approx 0.02V

cheers,

Offline scadabg

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #27 on: January 24, 2010, 06:25:08 AM »
Hi, my laptop does not have any Serial/Parallel ports only USB. i want to create my project (e.g. a Computer controlled RC car) to start with i need to be able to control external relays etc from my laptop.
I have a USB to Serial converter now to control external relays i need to convert these serial signal to parallel.

Please suggest how to proceed.

-cheers
sid

I would suggest you using this board :

-It has 6 relays
-bluetooth uart adapter
-power supply
You then can use your pc bluetooth to connect to this board and control the relays (no cabling needed)


« Last Edit: January 24, 2010, 06:26:26 AM by scadabg »

Offline scadabg

  • Jr. Member
  • **
  • Posts: 16
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #28 on: January 24, 2010, 06:28:16 AM »
Hi, my laptop does not have any Serial/Parallel ports only USB. i want to create my project (e.g. a Computer controlled RC car) to start with i need to be able to control external relays etc from my laptop.
I have a USB to Serial converter now to control external relays i need to convert these serial signal to parallel.

Please suggest how to proceed.

-cheers
sid

I would suggest you using this board :

-It has 6 relays
-bluetooth uart adapter
-power supply
You then can use your pc bluetooth to connect to this board and control the relays (no cabling needed)





And using this board you can also control the relays from your mobile phone see below


Offline sidzTopic starter

  • Jr. Member
  • **
  • Posts: 20
  • Helpful? 0
Re: Need help Serial to Parallel conversion
« Reply #29 on: January 24, 2010, 10:08:02 AM »
Thanks Scadabg but from where do i get it.

cheers

 


Get Your Ad Here