Welcome! Log In Create A New Profile

Advanced

CP210x-based USB-TTL converter for Gen7 electronics

Posted by dslc 
CP210x-based USB-TTL converter for Gen7 electronics
February 26, 2012 05:58PM
Hi all. I'm building a Reprap using Traumflug's Generation 7 electronics. I have programmed the Arduino bootloader to the ATMEGA successfully (following the instructions at [reprap.org] ). Uploading firmware is not working however. Let me explain.

The Gen7 requires a USB-to-TTL converter. I am using a CP2102-based converter to accomplish this, but it's not working so far.

I'm aware that the reset pin (required when uploading firmware within the Arduino IDE) doesn't work as expected when using this converter - so I have soldered the reset pin on the Gen7 board's serial connector to the DTR pin on the CP2102 board (as suggested at [blog.tarn-vedra.de] ). This doesn't fix the issue.

I'm running Linux/Debian 6, and using the cp210x drivers that come provided in the kernel.

Anyone have experience with this?

(I might just scrap the CP210x-based solution and buy one of the more expensive USB-to-TTL cables.)
Re: CP210x-based USB-TTL converter for Gen7 electronics
February 27, 2012 03:45AM
Can you upload firmware without this reset pin, by pressing the reset button at the right time? This sometimes needs a few tries and if you use the Arduino IDE, you can end up with multiple instances of avrdude running, so do a "killall avrdude" in between. Resetting the whole converter by unplugging it's USB side a few seconds is also known to fix driver confusions.

If you have that, you can try with this auto-reset solution.

If you have a programmer and everything but uploading firmware through the bootloader works, it's also fine to just upload the firmware with the programmer. The point of the bootloader is to avoid the need for a programmer, not more.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: CP210x-based USB-TTL converter for Gen7 electronics
February 27, 2012 01:49PM
Hi Markus,

Traumflug Wrote:
-------------------------------------------------------
> Can you upload firmware without this reset pin, by
> pressing the reset button at the right time?

I tried this a number of times - trying to guess how long to hold the reset button for, etc. - to no avail.

> If you have a programmer and everything but
> uploading firmware through the bootloader works,
> it's also fine to just upload the firmware with
> the programmer.

Thanks for clarifying this. This indeed works - and your test firmware uploaded fine. I can also confirm that - the auto-reset functionality aside - other aspects of the CP2102 solution at least seem to be working as expected. E.g. I can use the serial monitor as expected. I haven't actually tested this thoroughly yet though.

david

P.S. I'm using the USBASP programmer and one thing I overlooked when ordering this is that it uses a 10-pin ISP connector rather than the newer 6-pin type that is used on the Gen7 - but this is no big deal (either take the ATMEGA out of the socket or wire interconnects between the two headers.)

Edited 1 time(s). Last edit at 02/27/2012 01:50PM by dslc.
Re: CP210x-based USB-TTL converter for Gen7 electronics
February 27, 2012 07:05PM
Is it possible you initially grabbed the wrong bootloader .hex file? Serial speed depends on the CPU's clock speed, so you have to take another bootloader if you change the crystal.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: CP210x-based USB-TTL converter for Gen7 electronics
February 28, 2012 03:41PM
I am using the Gen7 component kit you provided - an ATMEGA644 20MHz with 20MHz crystal. I'm fairly certain (almost 100%) I chose the corresponding hex file when programming via the USBASP programmer as well.

However, because my programmer has the wrong ISP connector, I actually programmed the bootloader on a breadboard with an 8MHz crystal. Could this have caused the problem? [:blushes:]
Re: CP210x-based USB-TTL converter for Gen7 electronics
February 29, 2012 06:25AM
Quote

I actually programmed the bootloader on a breadboard with an 8MHz crystal. Could this have caused the problem?

Unlikely. However, the ATmegas I ship have a bootloader already programmed, so ... anyways, it works now. smiling smiley


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 02, 2012 03:04PM
Hi Markus,

Yeah, it seems to be working so far.

I plan to try the FiveD firmware over the next week or so. I'll try to document any significant findings - and relay them here if appropriate.
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 03, 2012 05:46AM
Quote

I plan to try the FiveD firmware

FiveD is pretty old and I'm not sure wether it's 20 MHz-compatible.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 05, 2012 04:15AM
Hi Markus/anyone,

Does activating the PSU (i.e. taking it out of standby) require the reset function on the serial connection?
The reason I ask is because the PSU is not coming out of standby. Nothing happens unless I physically short PD7 / D15 to ground.
I'm using the ATX power option (referred to as 'Option 1' in the wiki documentation), and have both disk power connectors as well as the ATX connector in place.

When I do short this pin to ground (i.e. manually activate the PSU) I get mixed results. The hotend heater and temperature sensor are working, but there is absolutely no movement in the motors.

Quote
Traumflug
FiveD is pretty old and I'm not sure wether it's 20 MHz-compatible.

Well, it wasn't working for whatever reason - so I have actually started using the Teacup firmware instead (and the above comments apply to that firmware). And yes, I'm using the Gen7 branch of the Teacup firwmare - and have tried various settings in the config.h file to get the motors working.

I've tried various hosts - pronsole/printerface, replicatorg, as well as the original Reprap software.

Edited 1 time(s). Last edit at 03/05/2012 04:27AM by dslc.
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 05, 2012 10:14AM
Quote

The reason I ask is because the PSU is not coming out of standby.

What makes you expect the PSU should turn on? Simply flipping the switch on the back of the PSU isn't. Teacup turns on power when juice is actually needed. Due to a heater turned on, due to a movement commanded. Not earlier and it'll turn off automatically again.

Regarding Teacup - today's Gen7 branch has a big fix which needs further review. Please try the master branch, you can use the same config.h. I'll notify in the Teacup thread when this branch is fit again.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 05, 2012 01:49PM
Quote
Traumflug
What makes you expect the PSU should turn on?

Precisely what you described - turning on the heater or issuing a move command. I would expect it to turn on when I do this - but it doesn't.
E.g. I type:
settemp pla
or
move x 100
in pronsole and nothing happens (unless I physically short the necessary pin - in which case the heater but not the motors turn on).

Anyway, thanks for the advice. I'll try the master branch as soon as I have time.
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 05, 2012 07:40PM
settemp pla
move x 100
Is this a Pronterface special? I'm not aware of such commands. About all RepRap firmwares, including Teacup, speak G-code: [reprap.org]

So, to move the carriage to 100 you'd send
G1 X100 F200

To set a temperature:
M104 S150


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Hey there,

I never imagined owning a reprap 6 months ago when I first started to check it out - now I have the whole thing put together and have just finished my Gen7 v1.3 yesterday and given it's my first ever - made from scratch - TIV, it's a beauty, if I may say tongue sticking out smiley
After giving it a go, with what later turned out to be a faulty ATX, I finally connected everything, gave it some sugar, and I can confirm a heartbeat! grinning smiley BUT, me being a noob at electronics, now I have a basic problem. I have no idea how (what pins) to connect my USB-TTL programer to the Gen7 board. I googled and searched, but I still have no idea what those programer pins on the Gen 7 board are named and therefore don't know how to conect the converter. I use the same CP2102-based converter as the one presented in the first post: blog.tarn-vedra.de

Maybe to someone it's obvious, but to me it's not smiling smiley so any hint would be greatly appreciated.


Greetings, Aly
EDIT:

"TIV" is "PCB" I just realised it's not english but my native language smiling smiley - sorry

Just to mention, it's a problem I have had for some time now with some other PCB.
I have done a fair amount of searching from than to present and still i have no idea how this should be put together, so it's not a problem that appeared last night smiling smiley I guess I'm a poor searcher..


Greets, Aly
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 14, 2012 07:20PM
I have a CP2102 converter working with my Gen7 and freeduino, with auto reset.

The reason auto reset does not work for you is that it requires a low value capacitor (<1uf) between the DTR pin and the reset pin on the Gen7, so that it pulls down the value properly.

Here is the section of the wiki with the converter to Gen7 pinout.
[reprap.org]

And if you choose to add the capacitor to the DTR "pin" then that goes to pin 6 on the Gen7 board.
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 15, 2012 01:12PM
Hi Aly. Good to know your Gen7 Reprap is almost up and running. As Legot mentioned, the pin descriptions for the serial connection on the Gen7 board are on the wiki. From left-to-right (looking down upon the board with the ATX connector on the right and serial connector below the ATMEGA chip), they are:
    1. GND
    2. -
    3. 5V
    4. RX
    5. TX
    6. RESET.
(Please correct me - anyone - if I have that wrong.)

Quote
Legot
I have a CP2102 converter working with my Gen7 and freeduino, with auto reset.

The reason auto reset does not work for you is that it requires a low value capacitor (<1uf) between the DTR pin and the reset pin on the Gen7, so that it pulls down the value properly.

I'm relieved to hear this! smiling smiley (I was worried that I might have to change the flow control settings for the Linux CP2102 driver - or something esoteric like that.) I'll get back to you as soon as I try this.

P.S. @Traumflug: sorry for not replying till now. Those commands are for pronsole/pronterface - yes.

Edited 2 time(s). Last edit at 03/15/2012 01:24PM by dslc.
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 15, 2012 04:52PM
I seem to have the same problems here I can connect in the arduino software to upload the firmware but I'm not having anyluck getting pronterface or matter of fact any of the softwares to connect at all. both on mac and windows this issue is persistant tried everyspeed I could think of but no luck getting it to connect, now I'm just thinking it was not my compiled firmware, because I tried several different ones it's the way the softwares handle the serial port which is causing the problems. I'm missing something if some one has gotten it to work
terramir
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 15, 2012 08:11PM
Quote
dslc
I'll get back to you as soon as I try this.
It worked - firmware uploading at least. Being able to at least upload firmware without having to use the programmer is a big improvement. I still haven't got the motors operating with any of the firmwares, but that's a separate issue.

david
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 15, 2012 08:43PM
David I think we are aving the same issue here because you could upload the firmware and now your stuck can you verify that you can actually connect to the host program your using because I cannot at this time sad smiley
terramir
Hey all, thanks for answers!

I know serial pins are on the wiki, I saw that xy times searching for clues grinning smiley, but I have a problem with bootloader / ICSP pins.
I tought I found my answer in Gen7 Board Schematic I found (pin1: MISO, pin2: Vcc, Pin3: SCK, pin4: MOSI, pin5: reset, pin6: GND), but when connected accordingly and than trying to bootload I'm stuck with this:

Using Port : \\.\COM4
Using Programmer : stk500v2
Overriding Baud Rate : 115200
avrdude: ser_open(): setting dtr
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500_2_ReceiveMessage(): timeout

I soldered DTR pin on USB-TTL converter as explained in the first post (I have that same USB-TTL), tried that - i still have the same problem. I than found this scheme saying SCK is RTS on my USB-TTL, soldered and tried it - same thing. Last i saw that RST could be CTS on the USB-TTL, also tried that and i'm stuck with the same error. I did try to bootload with reset pin on reset and manually reset the board but it's all the same.

I visually inspected my board and everything seems to be fine, I even tried to resolder the connections just in case, but nothing seems to be of any help. :/

Now I have no idea what else to do..


Greetings, Aly
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 16, 2012 11:42AM
Hi Aly,

You seem to be dealing with two separate issues.

Firstly - regarding programming a bootloader and the programming pins on the Gen7 board (labelled 'CONN6' in this picture). You're not trying to program the ATMEGA with the CP2102, are you? That won't work.

If you need to program the bootloader you will need an actual AVR programmer. The CP2102 is just a USB-TTL converter - not a programmer!

Where did you get the components for your board? If you ordered them from Traumflug the ATMEGA is probably already programmed with a bootloader. In this case, you can upload firmware via the serial connection - i.e. using the USB-TTL converter. Otherwise you will have to get your hands on an AVR programmer.

I am using an USBASP programmer. You can get them on ebay for a few euro - but bear in mind that they come with a 10-pin rather than 6-pin ISP connector. I just use jumper wires with SIL sockets on the end to route the wires correctly - but you can probably find a 6-pin<->10-pin ISP adaptor quite easily.

Secondly - regarding the serial connection ...
Did you solder a capacitor (of approx. 100 nF) between the DTR pin on the CP2102 breakout board and the reset pin on the Gen7 board (i.e. the rightmost pin on the connector labelled 'SERIAL' in the above picture)? This is what Legot suggested above - and things did not work correctly for me until I did this.

Would be interested to know how you get on.

P.S. I welcome correction on any of the above. E.g. maybe the CP2102 breakout board can be used for programming? Am I missing something?

Edited 3 time(s). Last edit at 03/16/2012 11:48AM by dslc.
Hey dslc.

You're probably right. I was trying to program the bootloader as described on wiki, becouse I have a blank factory atmega. I'm gonna have to check ebay for some programer I suppose and 10-6 pin won't be a problem since I have jumper wires from USB-TTL, if they wont come with the programer or I'll just improvise winking smiley
This "dead-end" really got my nerves ticking, I must admit grinning smiley

Thank you for help. At least now I know I wasn't doing anything wrong, I just didn't have the right tool to do it in my hand (well, we'll see about that when I get the programer tongue sticking out smiley).

About serial connection: I haven't soldered the capacitor yet since I didn't get that far, but now I know when I do smiling smiley

I guess I'll report about what happenes when I get that programer and try it out, I just hope the board works since that was on the back of my mind all along, hopeing that it is not the problem smiling smiley


Thanks again, off to ebay I guess^^


Greetings Aly
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 17, 2012 07:13PM
Hi Aly,

The USBasp is an open-source design: [www.fischl.de] . So you might be able to build it yourself if you have the time, energy, and patience (there are through-hole versions of the design for example). On the other hand ... seeing as the programmer is available at such reasonable prices, it's probably more appropriate to simply buy it in some cases.

Anyway - about the CP2102 breakout-board again ...
Here are some images of my wiring: [indigo.uk.to] .
(They were taken with a very low-resolution phone camera - so the quality is poor.)

Two important things to note:
    1. the blue component in the brown wire is the afore-mentioned capacitor (I used a 100 nF ceramic capacitor, crimped it using bootlace ferrules and insulated it using heatshrink)
    2. the Rx pin on the CP2102 breakout board goes to the Tx pin on the Gen7 serial connector, and the Tx pin on the breakout board goes to the Rx pin on the Gen7 board.
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 17, 2012 07:35PM
Hi terramir

Quote
terramir
David I think we are aving the same issue here because you could upload the firmware and now your stuck can you verify that you can actually connect to the host program your using because I cannot at this time

Yes, I can communicate with the board using certain host-firmware combinations - but only one or two, and with only limited functionality.

For example, using the Teacup firmware with pronsole, I can: 1. connect, 2. set the hot-end temperature, and 3. read the temperature. However, none of the stepper commands work - i.e. there is no movement at all in the motors. This is the case both using Gcode commands or the pronsole-specific commands.

I get the same results using the serial monitor in Arduino and the Teacup firmware - i.e. some of the Gcode commands work, but others don't. (I get an 'OK' response - but the motors don't move.)

I am away from my reprap at the moment, but one of the first things I plan to do is test whether or not the motors or being enabled properly whenever they are needed. I only realised yesterday that the enable pin on the Pololus/stepsticks is active low - so it seems that (contrary to my initial expectation) the stepper enable pin on the ATMEGA (pin 33) should actually be low whenever the motors are needed.

Have you tried to use the serial monitor in Arduino (Tools menu -> Serial monitor) to communicate with the board? This enables you to enter Gcode commands directly - once you select the correct baud rate.

Like yourself, I have tried a variety of host-firmware combinations over the past 10 days - but am away at the moment and can't remember the detailed outcomes in each case. I will try to notify you if I make any progress you though.

P.S. Are you using a CP2102 breakout-board as well?
Hey dslc.

I ordered some chinese programer on ebay last night, cost me 3,05€ grinning smiley so I'll just wait to get it and than see what happens when I try to program the board smiling smiley


Thanks for help again, I'll report on my findings winking smiley


Best regards, Aly
Re: CP210x-based USB-TTL converter for Gen7 electronics
March 19, 2012 10:52AM
I got mine to work there was actually a short (solder bridge) between motor enable and R10 you might want to check your board because I can move my motors now.
terramir
CP2102 problem
April 05, 2012 09:04PM
Hi guys,

I a using a tarang f4 series 2 zigbee module for my project. This is a USB module and uses cp2102..I have used x-ctu for connections and a cp2102 virtual com port..While the computer detects the com port, the problem is after clicking the connect command, the device goes into suspend state and it stays there..the suspend led never goes off till you disconnect..Can anyone tell how to correct this?
Hey all, I finally got the usb avr programer and it would seem that programing the bootloader worked fine since it completed without an error smiling smiley

Now when I try to upload the "SetupText.pde", I think I might have the same problem as you dslc ... I tried to add that capacitor no reset pin, but it has no effect (reset pin is wired to DTR on usb), I always get this error:

Binary sketch size: 2358 bytes (of a 63488 byte maximum)
java.lang.NullPointerException
at processing.app.debug.AvrdudeUploader.getProgrammerCommands(AvrdudeUploader.java:106)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:68)
at processing.app.Sketch.upload(Sketch.java:1603)
at processing.app.Sketch.exportApplet(Sketch.java:1568)
at processing.app.Sketch.exportApplet(Sketch.java:1524)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2293)
at java.lang.Thread.run(Thread.java:619)

I also tried the "finger-reset" technique, but it also has no effect.
(I'm using serial port with CP2102 not the ICSP and the programer, just tought i'd clarify that winking smiley )

Well, that's it for now..

Greetings, Aly
Re: CP2102 problem
April 09, 2012 12:59AM
hi serek..
i am also using tarang f4 to communicate wireless ...here i am using tarang+arduino board (micro controller) for operations at one side and the other side only tarang f4..
i am not getting to find how to configure this tarang f4 and details about this... if you have please forward me...
thanks...... my mail id s_vkrishnareddy@yahoo.co.in
Sorry, only registered users may post in this forum.

Click here to login