PDA

View Full Version : Unsolved Computer won't read Prop



SwimDude0614
10-18-2011, 06:48 PM
Hello,

I recently bought my first Prop chip and tried to connect it to my computer via the RS232-USB cable I had laying around. I followed the schematic for the Alternative Serial Port Connection at the bottom of page 5 in the datasheet and checked over the schematic multiple times with a friend.

We also used said friend's oscilloscope to get a bunch of readings as the Prop Tool tries to find the chip. I've uploaded all the screenshots to my server (http://www.stlswedespeed.com/david.zemon/downloads/prop/scope.zip).

If anyone has any clues as to why the computer is not seeing the chip, I'm open to ideas.

Thanks,
David

prof_braino
10-18-2011, 07:27 PM
I haven't scoped it out myself, but it looks like the chip is doing something, so I would guess its doing what it usually does. If your sure you have the circuit correct, I would look at the PC side.

In the past, I have experienced the PC not finding the prop due to windows install problems.
At least one time was something with .Net 1.1, I think. Another time was due to an old version of one driver, and new version of another driver. In these cases, a clean install of windows took significantly less time than troubleshooting the root cause, since there's nothing we to be done about windows

Mike Green
10-18-2011, 07:43 PM
Also, your USB to RS232 adapter may not work properly. Specifically, some adapters don't implement DTR and that will prevent the Propeller from resetting which it has to do to be "identified".

I've looked at your scope tracings. It looks like the Propeller is getting a good reset pulse. The RS232 adapter schematic is correct and it does work with a known good USB to RS232 adapter. The Prop really doesn't need anything to work other than a 3.3V power source and a 3.3V logic Tx, Rx, and Reset signal from a PC running the Propeller Tool (or BST). Not having a crystal or an EEPROM limits what you can do, but you can do a lot of programming without them.

SwimDude0614
10-18-2011, 07:46 PM
You can see from the scope, the reset is definitely getting brought to 0V for a time, and then the capacitor recharges it. I don't know if it's normal for that to only happen once, or multiple times, but it did happen *once* (per attempt that is - not once the whole day)

SwimDude0614
10-20-2011, 04:34 AM
Mike: I've been using this adapter to program an 8051 for class, and it works great for that. Can I assume if it works for the 8051, it should work for the prop?

Do you think it's worth sending back to Digikey for a replacement? I'd hate to do such a thing, but no one around here has even heard of the chip, let alone has a proto board that I could test this on.

I'll tear apart the bread board and rebuild it - maybe there's just something wrong with the serial schematic that I keep missing. I'll do my best to place the wires in such a fashion that a picture would be useful. If anyone has other ideas, let me know.

Mike Green
10-20-2011, 05:01 AM
Just to be complete, this link (http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/SerialtoPropeller.pdf) is for the RS232 programming adapter for the Prop. The Prop itself needs all Vss pins connected to ground and all Vdd pins connected to +3.3V. There should be a 0.1uF ceramic capacitor connected across each Vdd / Vss pair of pins. For testing purposes, you don't need a crystal or EEPROM. The Prop runs off its internal RCFAST clock by default and the Propeller Tool first downloads code to RAM, then copies it to EEPROM if you request that.

Dr_Acula
10-20-2011, 06:29 AM
I'm trying to replicate your fault. I do all my programming with a real RS232 connection (yes my computer is a bit old) but I have a USB to serial adapter so it is easy to swap back and forth.

I can replicate your problem. My USB adaptor does not reset the propeller. I can also confirm that it works perfectly for data as I have done a loopback test into my real serial port using a terminal program.

I can even test things further because I have a program already on the propeller which displays data coming in the serial port, so when you do a F7 on the prop tool to find any propeller chips connected, my USB cable does *not* reset the propeller because the programming running on the propeller does not stop. The data flow works as it sends some bytes which I can see on the screen attached to my propeller chip.

And for comparison, going back to the real serial cable, it does reset the propeller as soon as you hit F7.

I know the Picaxe community have had a lot of similar problems and in the end the only solution is to buy one particular cable that is know to work from the company.

There is another solution, and that is to use the on-board USB to serial chip, because these are known to work.

So after doing these experiments I think it is looking like Mike Green describes in post #3 - the DTR line is not doing a reset properly. Maybe it is not implemented in the software driver, maybe it doesn't have enough of a kick to reset the prop, maybe the pulse is too short?

I suspect it is the software driver, because I have just done some testing with vb.net toggling the reset line and this does not work with the USB to Serial adaptor but it does work on a real serial port.


Sub ResetPropeller()
SerialPortName.PortName = "COM1"
SerialPortName.Open()
SerialPortName.DtrEnable = False
SerialPortName.DtrEnable = True ' toggle the dtr line
SerialPortName.DtrEnable = False
SerialPortName.Close()
End Sub


The "official" answer is probably to get one of these http://www.parallax.com/Store/Microcontrollers/PropellerTools/tabid/143/CategoryID/19/List/0/SortField/0/Level/a/ProductID/398/Default.aspx

Cluso99
10-20-2011, 08:47 AM
Can you post a pic of your prop setup just in case we can see something wrong?

I have tried some other USB to TTL boards from eBay (~$4 posted) and together with the reset circuit (transistor, resistor and capacitor) connected to the DTR pin of the chip (often they are not brought out to the header) they worked.

The PropTool works by setting DTR active, then inactive and it remains inactive while it runs. This is the opposite to the way DTR normally works. It is the TTL active (0V) to inactive (3V) which causes the transistor to fire a 0V pulse to the propeller chip to reset it.
Here is a link to this discussion http://forums.parallax.com/showthread.php?133362-Why-do-we-need-the-transistor-reset-circuit-for-the-USB-devices-(FT232RL-CP2102)&highlight=propplug+cheap+usb

IIRC the problem with some USB to RS232 cables is that not enough power is provided by the RS232 drivers to make the transistor level shifting circuits work.

On your scope trace, the DTR only goes active (+V) at time 0 and returns at +0.15 (scale looks like .15ms = 150us). I do not see a pulse on the reset at 0 time, only prior to it.

If you use this cable for your 8051, what circuitry do you have to interface the cable to the 8051? Perhaps you can tap the TX and RX and DTR TTL lines from this???

SwimDude0614
10-20-2011, 05:25 PM
Just to be complete, this link (http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/SerialtoPropeller.pdf) is for the RS232 programming adapter for the Prop. The Prop itself needs all Vss pins connected to ground and all Vdd pins connected to +3.3V. There should be a 0.1uF ceramic capacitor connected across each Vdd / Vss pair of pins. For testing purposes, you don't need a crystal or EEPROM. The Prop runs off its internal RCFAST clock by default and the Propeller Tool first downloads code to RAM, then copies it to EEPROM if you request that.

That link is not how I constructed it at all. Right away, I notice there are three transistors and 10k resistors. I used the diagram in the prop datasheet - a screenshot of which is attached.
86132

Mike Green
10-20-2011, 05:37 PM
The schematic from the datasheet will work with a true RS232 serial port. It may be as Dr_Acula and Cluso99 suggest, that your USB to RS232 adapter can't supply enough energy for a "proper" reset pulse. The extra transistor in the schematic I posted will add some amplification to the DTR signal and may avoid what you're seeing.

SwimDude0614
10-20-2011, 06:25 PM
thanks everyone. I'm going to:
1) rebuilt the circuit in the datasheet in such a way that a picture will come out clear and easy to follow
2) test it and, assuming it doesn't work again, take a picture to post
3) buy the parts necessary for and assemble the adapter linked by Mike Green
4) post results

Rayman
10-20-2011, 07:04 PM
I don't want to sound negative, but my advise would be to just buy either a PropPlug or a QuickStart board (if you can afford it).
That would save you a lot of grief. The QuickStart is just $25...

I've seen a lot of people have a lot of trouble with regular RS232 connections. USB is a LOT easier...

SwimDude0614
10-20-2011, 07:10 PM
The problem is, as a college student, I get paid $7.50/hr at my campus job. Do that math on that and you'll see I can tinker around with this for 3 hours before it becomes financially feasible to just buy the prop plug. More than that for the whole board.

Rayman
10-20-2011, 08:40 PM
I can understand that (been there.) I think you'll figure it out.
I guess you're working from a breadboard then.
A lot of people forget to connect all the GND and Vdd pins of the Prop. Also, sometimes they don't put any capacitors on Vdd, near the Prop.
These can cause problems. Make sure you don't have RX and TX reversed.

BTW: If a programmer was available for $10, would you get it then?

Also, that circuit always looked a little wierd to me... I don't see why RX is connected to DTR with that resistor...
The PropPlug brings DTR through a capacitor (pulled down with a 10k resistor) to a NPN transistor base with the emitter grounded
and the collector to RES. You might try it that way. I'm not sure if the polarity of DTR is the same in your setup though...

Cluso99
10-20-2011, 10:36 PM
Can you post a picture (not schematic) of your setup as we may see something wrong with that. I do think the missing transistor on DTR could possibly fix your problem.

I understand your budget. Lets get it going first.

SwimDude0614
10-20-2011, 10:44 PM
Can you post a picture (not schematic) of your setup as we may see something wrong with that. I do think the missing transistor on DTR could possibly fix your problem.

I understand your budget. Lets get it going first.

Yes, tonight I'm going to rebuild the circuit with the intent of taking a picture. The reason I haven't taken a picture yet is because it's a complete mess and it's nearly impossible for anyone to debug it in person, let alone through a picture.

Rayman: I would certainly consider buying it for $10 (including shipping). Of course, part of it is, I enjoy this =D, so that makes plug-n-play worth a lot less to me.

prof_braino
10-20-2011, 11:27 PM
The reason I haven't taken a picture yet is because it's a complete mess and it's nearly impossible for anyone to debug it in person, let alone through a picture.

You might get lucky and find that when you clean it up so its presentable that it starts working. :)

I also think its more fun to work through it, keep at it. When it works, we'll want to hear what your project is going to be.

SwimDude0614
10-22-2011, 01:53 AM
You might get lucky and find that when you clean it up so its presentable that it starts working. :)

I also think its more fun to work through it, keep at it. When it works, we'll want to hear what your project is going to be.

I was really hoping I'd be able to post "Derp!!! It works now!" Not the case though.

A high-res image of the breadboard is here (http://www.stlswedespeed.com/david.zemon/downloads/breadboard.jpg). The mess of wiring at the bottom of the picture is to connect both voltage regulators and the power-on LEDs. all of the wiring for the serial connection is above the chip.

Ariba
10-22-2011, 04:04 AM
You need to connect BOEn to Ground also.
Further I would connect the resistor between Serial RX and DTR not to DTR but to Ground. Otherwise you can only programm the Prop but not communicate to most Terminal applications. Most serial to USB converters have a threshold voltage greater than 0V, so this should work.
Do you have the right Transistor at the Serial RX line (a PNP)?

Hope it works then...

Andy

Phil Pilgrim (PhiPi)
10-22-2011, 04:08 AM
You need to connect BOEn to Ground also.
Cripes! I don't know how so many of us missed this important detail. It's the connection of BOEn to Vss that enables the internal pullup on RESn. Without that, the Propeller will not come out of reset fast enough (if at all) to be recognized by the PC -- unless, of course, you have an external pullup.

-Phil

SwimDude0614
10-22-2011, 07:34 PM
I'm afraid that didn't help any. I'll try to get more scope shots with the new setup tomorrow or Monday maybe. I'll also see about getting the 3-transistor schematic built.

Ariba
10-22-2011, 08:38 PM
On your picture it looks like you have the upper half supply (GND and 3.3V) on the wrong pins. They are 1 pin displaced.

What error message do you get from the PropellerTool?

Andy

SwimDude0614
10-22-2011, 08:48 PM
Good eye! I did have the supply pins on pin 31 & 28, not 32 & 29. That didn't seem to be the (only) problem either though.
86229
Windoze thinks COM26 is my adapter.

SwimDude0614
01-31-2012, 02:10 AM
I built the new 3-transistor setup - didn't help. Thought it might have been a DOA chip, had digikey send me a new one - didn't help. Finally had a friend of mine with a USB to UART arduino board try to connect and it worked flawlessly. This convinced me it's worth just buying the prop plug. It should be here in a couple days, and I have his Arduino in the meantime. No idea what the problem was, but at least I can finally start coding now.

Thanks all for the help!

Circuitsoft
01-31-2012, 03:27 AM
I hadn't noticed this thread until today, but was going to recommend one of the SparkFun FTDI Basic (http://www.sparkfun.com/products/9873) boards, which it sounds like you just borrowed from a friend.

Glad you got it working, can't wait to hear what you do with it.

cavelamb
01-31-2012, 06:10 AM
4 hours wasted chasing gremlins is $32.
Consider the possibility?

SwimDude0614
01-31-2012, 06:42 AM
4 hours wasted chasing gremlins is $32.
Consider the possibility?

This philosophy only matters if the 4 hours wasted were 4 hours that could have been spent on something that would have paid me. They weren't.

But, none-the-less, the prop plug is ordered and will be here soon anyway. I have a thread going for the long-term project here (http://forums.parallax.com/showthread.php?134900-Feeler-thread-Looking-to-create-our-own-engine-management-system&p=1070634)