go_away

Author Topic: Not sure about connecting UART/cp2103  (Read 734 times)

0 Members and 1 Guest are viewing this topic.

Offline rmoreTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
Not sure about connecting UART/cp2103
« on: July 22, 2012, 11:15:08 PM »
Hello all,

I recently bought the CP2103 breakout board so that I can add the UART feature to my electronics projects - to help me read out my sensor values.


(Dont know how to insert image that can be viewed here! So added an attachment showing my CP2103!)

Can someone please tell me how I should connect this to my circuit board?

I am using ATmega8. So RXI and TX0 will go to PD0 and PD1 respectively.
GND will go to Ground on my circuit board.
I am not sure about 3.3V. My circuit board has a regulated voltage input of 5V that goes to VCC on chip. Can I connect the 3.3V pin to this 5V on the board?

Or do I need to use the VDD pin on the CP2103 and connect it to 5V on the circuit board?

Please help me out.

Thanks.

Rmore

Offline Gertlex

  • Supreme Robot
  • *****
  • Posts: 742
  • Helpful? 23
  • Nuclear Engineer Roboticist
Re: Not sure about connecting UART/cp2103
« Reply #1 on: July 23, 2012, 10:59:09 AM »
I don't think you need to connect the 3.3V to anything.... at least it has been my experience that USB to UART adapters just need to connect TX, RX and GND.

To add images that are hosted elsewhere, click the button that looks like .  Doesn't look like you managed to attach your image successfully, either.
I

Offline rmoreTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
Re: Not sure about connecting UART/cp2103
« Reply #2 on: July 23, 2012, 11:12:07 AM »
Gertlex,

Thanks for your reply. So you mean I can do with just the TX,RX and GND connections? Not even VDD is needed?
The $50 robot tutorial says I will need to make four connections -

+5V
GND
TX
RX.

So what works for you, and what is mentioned in the $50 robot project does not seem to be consistent.
How will the CP2103 be powered?

Thanks for advising me over the 'add image' issue. I did use that button you suggested. And what came up was:

'img' in square brackets followed by ['\img']
I then pasted the path to my image between the two and thats how I got that silly icon in my post. Is that the right way to post images?

Thanks

Offline ErikY

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Not sure about connecting UART/cp2103
« Reply #3 on: July 23, 2012, 11:19:03 AM »
I think the difference is the cp2103 is USB which is self powered, the $50 robot tutorial is using a serial port which is not self powered.

That is the conclusion I came to with the same questions.

Offline Gertlex

  • Supreme Robot
  • *****
  • Posts: 742
  • Helpful? 23
  • Nuclear Engineer Roboticist
Re: Not sure about connecting UART/cp2103
« Reply #4 on: July 23, 2012, 11:30:47 AM »
ErikY is right. I forgot that distinction. Indeed, the first UART-Serial adapter I used required supplying 5V.

Using the img tags is for stuff that's already online.
I

Offline rmoreTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
Re: Not sure about connecting UART/cp2103
« Reply #5 on: July 23, 2012, 09:41:14 PM »
Guys,

I connected the CP2103 as per your suggestions and the LED on it glows a constant red. So it should be powered fine.

I tried to follow the steps in the UART tutorial of the $50 robot but I cannot see any thing on the Hyperterminal - although it says I am connected and the clock at the bottom is ticking.

Can you tell me what I am doing wrong? I have a simple circuit connected. ADC pin has a photoresistor attached and if I vary the light incident on it, I see the voltage at the pin varying when I use a multimeter.

So the board is working fine. There is probably some transmission problem....I used the same files as the Photovore ($50 robot) project. I just changed the main code to suit my simple photoresistor board.

Can somebody please help me trouble shoot this? I would really like to see what my sensor readings are...
Please let me know if you need any more details.

Please!

Thanks.

Rmore

Offline ErikY

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Not sure about connecting UART/cp2103
« Reply #6 on: July 24, 2012, 11:14:08 AM »
I am still getting funky characters with this exact same board, so I am able to connect, but not transfer properly.

The one thing I am noticing based on your post is it looks to me like you are connecting Rx to Rx and Tx to Tx.

I am pretty sure you connect the breakout board's tx to the mcu rx and vice versa.

Maybe I am interpreting it incorrectly, but that is how I read your post.

I know Admin mentions in his tutorial that this could fry your UART by doing this.


Offline rmoreTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
Re: Not sure about connecting UART/cp2103
« Reply #7 on: July 24, 2012, 03:12:04 PM »
ErikY,

I have ensured that I connect Rx of board to Tx of chip and Tx of board to Rx of chip. Thanks for your suggestion.

I am putting together a detailed report of what all I have done so far with the CP2103 so that it becomes easier to troubleshoot when you and other people on this forum see it.

Thanks

Offline rmoreTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
Re: Not sure about connecting UART/cp2103
« Reply #8 on: July 24, 2012, 08:21:22 PM »
ErikY,

I read in one of your posts that you did get something on your PC screen using the CP2103 uart board. Well now I can get some unintelligible stuff on my Hyperterminal as well!  ;D

Turns out I did not have a pin D0 specified as my Receiver pin in my code. I did not know I had to do that. I went thru the tutorial once again and came across the line:

                 #use rs232(baud=115200, parity=N, bits=8, xmit=PIN_C6, rcv=PIN_C7)

in the Hyperterminal tutorial.

So I just added
#define UDR    PIND0 ... in my code.

So now I see gibberish on my screen. Some progress. I tried to change Baud rate using all possible values in the Hyperterminal...But the gibberish does not turn into intelligent text. All that changes is the rate at which gibberish is printed on the screen...and the form of gibberish!

Do you know what could be going wrong?

FYI: my Baud rate on the chip is set to 57600.

Anybody know what could be going wrong?

Thank you.

Rmore

Offline ErikY

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Not sure about connecting UART/cp2103
« Reply #9 on: July 24, 2012, 08:27:14 PM »
Well, you and I are at the same point!

I am at a loss.

The board seems to work based on a hyper terminal loop test, if anyone has any ideas I would love to hear them as well.

Offline ErikY

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Not sure about connecting UART/cp2103
« Reply #10 on: July 25, 2012, 04:32:05 AM »
Rmore,

I got everything working this morning.

I had been trying to do everything using Webbot library, and that was where I was getting the funky characters.

This am I went back to my 328P project that I did for the photovore.

Basically I took the original project downloaded from Admin's $50 tutorial, and modified it to work with my upgraded ATmega328P.

So that is the project I was able to get it working with.

I suspect that I am doing something wrong with Webbot's project, because I went back to that project and I still cannot get it to work, but I don't even know where to look.

Anyway, I went through the UART tutorial and very carefully did everything in the tutorial and now it is working properly.

So at least I know the breakout board is good for sure.

If there are any parts of the code you want, let me know and I will give them to you.


Offline rmoreTopic starter

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
Re: Not sure about connecting UART/cp2103
« Reply #11 on: July 25, 2012, 07:20:16 AM »
ErikY,

Glad to hear that you were able to get it going. I am using the same Photovore code that I downloaded from the website. I made minor changes to the code - as in I deleted all the motor,LED related stuff since my circuit board is a very simple one now and I am not using the board that I made for the robot.

Anyways, I will try doing this thing again today in the pm and then let you know what I get.

I do have a few points that I was a bit concerned about yesterday when I followed the steps in the tutorial....perhaps thats where I might be going wrong.

Rmore

Offline ErikY

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 0
Re: Not sure about connecting UART/cp2103
« Reply #12 on: July 25, 2012, 07:21:46 AM »
ErikY,

Glad to hear that you were able to get it going. I am using the same Photovore code that I downloaded from the website. I made minor changes to the code - as in I deleted all the motor,LED related stuff since my circuit board is a very simple one now and I am not using the board that I made for the robot.

Anyways, I will try doing this thing again today in the pm and then let you know what I get.

I do have a few points that I was a bit concerned about yesterday when I followed the steps in the tutorial....perhaps thats where I might be going wrong.

Rmore

I will help out however I can, let me know if you have any ?'s

I understand the frustration when things don't work, and appreciate the help when available.

 


Get Your Ad Here

data_list