Why do we need the transistor reset circuit for the USB devices??? (FT232RL, CP2102)
Cluso99
Posts: 18,069
In my effort in looking for a cheaper USB download solution, I purchased a USB-TTL adapter mounted in a box.
http://forums.parallax.com/showthread.php?133335-Cheap-PropPlug-replacement-USB-TTL-converter-US-4.60-and-a-modification
In my haste to check it worked, I omitted to add the transistor reset circuit, instead just connecting the -DTR pin (from pin 28 of the CP2102) to the prop reset pin. It worked. Then I realised what I had done.
On my TriBlade design I was more interested in the SRAM interfaces. I had enough room on the pcb to squeeze in a propplug equivalent circuit, so I just blindly copied it without thinking.
Now I wonder why the transistor reset circuit is required at all. This had me thinking....
Back to basics...
DTR at the TTL interface is active low (0V=DTR ON, 3V=DTR OFF).
Whenever DTR transitions from 0V to 3V a pulse is generated by the RC circuit on the base of the transistor, causing the transistor to turn on for a short time. This pulls the propeller reset pin low and causes the propeller to reset. No pulse is generated for 3V to 0V transitions.
Therefore, the propeller is reset when DTR goes active to inactive.
PropTool & PST behaviour...
The results are not what I expected!!!
Both PropTool and PST drive the DTR pin in reverse. That is, DTR is normally inactive (3V), and to reset the prop, DTR is set active and then inactive again. The active to inactive (0V to 3V) edge triggers the reset.
Why is it so...
Well, when a program terminates, the OS in the pc software ensures DTR is inactive (forced to 3V). So to permit the transfer from one program to another in the pc, PropTool and PST both drive the DTR pin in reverse. I presume bst does the same. This is why my tests without the transistor circuit worked.
Conclusion...
What might be the effects of not using the transistor reset circuit?
1. When a program automatically activates DTR the prop will be reset. Therefore, some terminal programs may not run correctly.
2. It will not be possible to unplug the USB port without resetting the prop. However, the TTL end should be able to be unplugged without causing reset. (Unless you are powering your prop from USB of course).
Does this make sense??? Anyone have any other opinions or ideas???
http://forums.parallax.com/showthread.php?133335-Cheap-PropPlug-replacement-USB-TTL-converter-US-4.60-and-a-modification
In my haste to check it worked, I omitted to add the transistor reset circuit, instead just connecting the -DTR pin (from pin 28 of the CP2102) to the prop reset pin. It worked. Then I realised what I had done.
On my TriBlade design I was more interested in the SRAM interfaces. I had enough room on the pcb to squeeze in a propplug equivalent circuit, so I just blindly copied it without thinking.
Now I wonder why the transistor reset circuit is required at all. This had me thinking....
Back to basics...
DTR at the TTL interface is active low (0V=DTR ON, 3V=DTR OFF).
Whenever DTR transitions from 0V to 3V a pulse is generated by the RC circuit on the base of the transistor, causing the transistor to turn on for a short time. This pulls the propeller reset pin low and causes the propeller to reset. No pulse is generated for 3V to 0V transitions.
Therefore, the propeller is reset when DTR goes active to inactive.
PropTool & PST behaviour...
The results are not what I expected!!!
Both PropTool and PST drive the DTR pin in reverse. That is, DTR is normally inactive (3V), and to reset the prop, DTR is set active and then inactive again. The active to inactive (0V to 3V) edge triggers the reset.
Why is it so...
Well, when a program terminates, the OS in the pc software ensures DTR is inactive (forced to 3V). So to permit the transfer from one program to another in the pc, PropTool and PST both drive the DTR pin in reverse. I presume bst does the same. This is why my tests without the transistor circuit worked.
Conclusion...
What might be the effects of not using the transistor reset circuit?
1. When a program automatically activates DTR the prop will be reset. Therefore, some terminal programs may not run correctly.
2. It will not be possible to unplug the USB port without resetting the prop. However, the TTL end should be able to be unplugged without causing reset. (Unless you are powering your prop from USB of course).
Does this make sense??? Anyone have any other opinions or ideas???
Comments
Then I was looking at the FT232 specs and trying to work out whether DTR was 'inverted' or 'true' logic. I still don't quite have the definitive answer to that as I'm waiting for an actual chip, but I am guessing that because Tx and Rx translate RS232 'resting' from -12V to +5V, DTR will do something similar.
Then I realised that with the high pass RC network on the reset circuit, it doesn't really matter. The reset occurs on transitions, and regardless of what the DTR line is sitting at (5V, 0V, -12V, +12V), if you change it then change it again, you will get at least one transition that causes a reset.
I suppose the question is - if you want to reset on absolute levels, rather than transitions, do we need to actually go and test all the compilers and see what the 'resting' state of DTR is?
Mark_T: Yes, the reset button would place a short on the output of the FT or CP chips DTR pin for a short time. Probably not catastrophic these days, but not really good practice. The diode would protect this, as would a resistor (~1K would be an excellent choice).
All:
My real reason is for everyone to be able to use a cheap USB-TTL board for ~$4-$5 on eBay. Cuts the entry cost for beginners, and they are usable on other micros too (may use RTS instead, but this is also available on some of these boards)
Personally, I'd not be keen on shorting a chip's output, even though, like you say, it can probably handle it.
So then the next question, can you do this with one component? Choices - a 1k resistor, or a 1N4148? It may not matter - both would work.
Maybe you can do the same with your chip?
I have a feeling they'd be very upset, which is why I haven't done it (well, that and not having any time to actually do that).
I don't know about that, I imagine if it was good that Parallax would probably sell it. If it works I will buy it, regardless of who it comes from, I will likely be needing a bunch soon. My thought is the current design was determined to be the best possible solution, at the time, for techinical reasons. If the environment has changed, it may be time to reconsider desisions based on the old environment. Go for it! Of course, Cluso99 has already started and might beat you to it.
With these $3 (in lots of 50) to $4 USB<>TTL converters on ebay, which include 5v and 3v3, is there any point? Doesn't Bill already have something similar?
There are three minor reasons I can see
1) The onboard 3v3 regulator @ 100mA might not supply enough current for all applications, or might get hot
2) The pinout is different (correct it using the jumper wires provided)
3) The prop plug is a very elegant little device design wise. I haven't come across anything more elegant except maybe the ftdi moulded leads
It might make more sense to design a compact prop board to suit the 6 pin header of those converters. Parallax have stated they are in the business of selling more Prop chips, and that would better help that goal.
I don't propose we change our pcbs to suit as these could disappear from eBay.
The FTDI chip driver can invert the DTR (and others) line. I haven't found anything to do the same in the CP device, but the driver could be modified to do this instead - bigger job though.
Anything that simplifies the circuit to a single two wire component such as (nothing at all preferred), resistor, diode or capacitor (in that order) is preferable. Better to use something pre-existing. None of us can build these for the ~$4 price point. The chip alone costs that much!
I wonder if the reset transistor is a throw back to that sort of interface where it acts as an isolation between the +/- 12 Volt differentiated spikes off of the DTR?
ADDIT:-It also gives that useful open (ish) collector to allow for other reset sources.
Cluso99,
Would it be an heinous act of piracy to discuss this or do you just want to stay with the USB aspect/s?
If, as I think you refer to cheaper entry to the prop for newbies, this would be a great new thread. I have some ideas here. While I think the entry price of the Parallax ProtoBoard (USB) and the QuickStart are great, I do believe there are other possibilities.
Most of my commercial designs have some kind of support chip in them such as a PIC or a C8051 etc and I program these to monitor the DTR line and generate a clean reset. An added benefit of a cheap support chip is that I also monitor the Prop's RXD as well so I can take control of the Prop's EEPROM and load in code directly into it even over wireless and RS485 networks. BTW, the support chip is connected to the Prop's I2C lines as a means of communication as the support chip may normally drive LEDs and provide A/D inputs etc (way cheaper than MCP3208s etc).
Here's a shot of my bare Prop Plug pcb with a micro USB connection and a prop plug compatible 4 or 8 pin header (extra 4 for power and I2C).
My personal download circuit has been a USB to serial cable (ebay, $2), a max232 ($1), D9 (50c) and about 50c of support components. Ballpark similar cost to the solutions proposed above and a lot cheaper than a prop plug.
But in a more recent design I've experimented with the FT232 so these discussions about leaving the reset transistor out are intriguing. I also have a design (untested as yet) which disconnects the eeprom and the download pins once a program is downloaded, with a view to freeing up these pins so there truly are 32 I/O pins available on the propeller. I'm using some discrete circuitry but I could see a definite advantage to combining that into Peter's support chip idea.
Wireless downloads sound interesting. I'm also running into a problem with downloads taking too long with large 300k C programs, and so thinking about sending data directly to an SD card and bypassing the propeller. Again, a support chip could do that as well.
Once you think about the idea of adding a support chip there are quite a few things it could do.
Well it seems quite natural for me to use another small micro rather than a hodge-podge of hardware. Take this schematic of a support chip I recently used, some of it's features are:
1) Monitors 18 channels of 24V signals and and converts these to 12-bit ADC over I2C
2) Monitors the XBEE receive data and captures special command sequences for programming etc
3) It's in-circuit programmable from the Prop itself so no ICP headers and adaptors etc
4) Temperature sensor on-chip
5) Only needs one spare "programming" pin from the Prop besides the default I2C lines.
(screen capture has an overlay bug at present)
For $3 I get a self-scanning 18 channel 12-bit ADC with internal reference etc plus all the other features I mentioned. Also 8051 code and tools are easy and I have a little ICP driver I temporarily load into the Prop's RAM just for the chip programming.
Could it be better or easier? But forgive me, I digress from the thread (a little)
Essentially its a similar idea - use a $3 micro to replace the (prop plug + adc + rtc) prop plug functionality plus some other benefits.
There's still a difference between the $4 ebay usb<>ttl converters, which are 'finished modules', and just a raw micro. But still the other advantages might make it worthwhile
cheers
tubular
I'd like to use a common USB micro as well in place of the not-as-cheap-as-it-could-be FT232 (also scarce at present). I looked at the PIC18F27J53 approach and the chip looks good with some extra Flash too. It doesn't look like you can use the internal oscillator for full speed USB though (low speed only) whereas the Silabs parts are all-in-one devices such as a similar product, the C8051F387. But whatever device is used we need to have reliable USB VCP code and drivers. I'm willing to explore this approach for substitute USB serial chips. Should we start a thread somewhere for this?
Its your idea originally, so feel free to revive or start a fresh thread as you see fit, and I'll contribute what I can. I have some Silabs resources and some microchip, but not much experience with the usb side of things.
Technically there are several similar solutions to this - PIC, Silabs, maybe TI or Atmel or maybe FTDI VNC2 (no analogs). There may be other solutions. It really comes down to what works reliably, as opposed to pricing and features, so I don't see any other way than to delve in and try and road test unfortunately. Starlino did some USB PIC boards available on GG and maybe it would be worth checking in with them about possible unresolved issues, experiences and capabilities.
For mine I'll try the PIC18F47J53 PIM again with updated .hex file if its available. The PIC presents as a "100kB mass storage device", and the idea was to send a 32kB prop image to it, and it would then boot the prop with that image, and afterwards go into a peripheral mode using I2C or uart comms. I struck an issue when transferring 8kB or larger files, and I didn't see any point continuing development until that was resolved. Hopefully they have fixed that but it might be a limitation of internal sram buffers or something.
cheers
tubular
This is a natural progression, and the Ardunio have moved to Mega8U (but already hit a code ceiling..., so learn from that )
It really does need to be a small-micro, that can (optionally) run without a crystal.
Besides component replacement, once you have a small micro, you can add a Serial/Terminal channel, and some instrumentation features like
Frequency counters, and Pin Stimulus, as well as ADCs.
The SiLabs 38x is a good choice & it can run on 5V.
Another choice may be the new AtXmega (A3U/A4U), as I think the latest spin of that adds USB/RC-Osc, and that does have good timers - but being new, it has less eco-system out there. It is also so new, it is not quite real yet...
The A4U is larger than the SiLabs, and comes in tqfp44(0.8mm) and qfn44(0.5mm), and the latter would (just) allow a DIP form factor
Another XMega minus, is the AVR Studio is an absolute monster, with baggage.
http://cgi.ebay.com/AVR-USBASP-Programmer-ATMEGA8-ATMEGA128-ATMEGA168-etc-/320682999661?pt=LH_DefaultDomain_0&hash=item4aaa323f6d
http://cgi.ebay.com/USBASP-USBISP-AVR-Programmer-USB-ATMEGA8-ATMEGA128-/150603895427?pt=LH_DefaultDomain_0&hash=item2310b11283&clk_rvr_id=252123340368&toolid=10001&customid=Multi+Rotor+Helis&mpre=http%3A%2F%2Fcgi.ebay.com%2FUSBASP-USBISP-AVR-Programmer-USB-ATMEGA8-ATMEGA128-%2F150603895427%3Fpt%3DLH_DefaultDomain_0%26hash%3Ditem2310b11283
I see that the firmware is available at:
http://www.fischl.de/usbasp/
Likely you already knew this but...
Do you know if they ever got the USB<>Serial for debugging working ? It's listed as a "planned feature" on that fischl website.
What kind of device does it enumerate as? Or is it a kind of proprietary device that needs the programming software to know about its protocol?
This time things are working better, but they have shunk the USB drive emulation to 7.5kB ! I always found issues with transferring files > 8kB, so perhaps this is their temporary solution. The thing I like about the PIC is that it's also available in 28 pin DIP, so there are fewer barriers to using it.
The 7.5kB aint much, but its still useful for an opening html file with links, or a program run/launch menu, or a PinDef kind of file,
Here are some impressive demos that are 4kB and make use of DirectX 8 (windows)
Nut I was really thinking of using something already built and tested, with minimal modification. That is why those CP2102 USB/TTL boards look so attractive.