Shop OBEX P1 Docs P2 Docs Learn Events
Reset transistor redundant — Parallax Forums

Reset transistor redundant

Peter JakackiPeter Jakacki Posts: 10,193
edited 2013-10-18 07:09 in Propeller 1
All the schematics from Parallax have always shown a typical capacitor coupled NPN driven from the DTR signal for the reset circuit. Recently I did up a new pcb but forgot to put any reset circuitry on there for the FT232 chip. Although I was still able to reprgrogram it via my standard PropPlug style connector I wanted to be able to do so via the USB. So I looked at my pcb and saw I could do a quick easy mod if I simply ran a cap from the DTR to the reset line so I hooked up a 10nf. Suffice to say it works perfectly as does a 1nf cap too. With the 1nf cap I effectively get a 4us low pulse (below 1.5V) with no negative or positive overshoots. Of course without the NPN the Prop resets off the negative edge rather than the positive edge but since the DTR is sent as a short pulse and the Prop must wait at least 50ms before it does anything then it doesn't matter which edge is used.

Thinking about it the NPN was probably really necessary with RS232 circuits as the DTR signal could easily swing between +/-12V and an NPN was an easy way to interface this but with USB chips the output is a simple 3.3V logic level, so why bother with the NPN then? I know someone will come up with the old argument that they are cheap so put them in anyway but really there is no need at all.

Comments

  • jmgjmg Posts: 15,173
    edited 2013-10-16 22:58
    Given the proven sensitivity of the Prop reset pin to noise, I'd say some form of low pass filter is a good idea.
    The modern solution would be a Digital Transistor, as that cuts part counts and gives a good threshold+ ability to ignore narrow impulse noise, and it allows very short connections to the reset node.
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-10-17 00:47
    peter, thhe problem is actually in windoze when switching between programs. windoze turns dtr off but providing the programs have dtr off also there is no problem.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2013-10-17 01:39
    It was probably just an easily changeable buffer between the big, nasty, world and a pin and its protection diodes that are not all that stout, plus or minus 12 volts is a reasonable excess to 3.3 (along with the 10KV from shuffling over the nylon carpet) I know that Dr_A had experimented with PNP to worry over the edge directions.
  • tonyp12tonyp12 Posts: 1,951
    edited 2013-10-17 09:36
    I have been using RTS and invert it in FT_Prog and then a 1000pF (1nF) in series with reset line, nothing else and it works just fine.
  • average joeaverage joe Posts: 795
    edited 2013-10-17 10:24
    I could be wrong but... From what I understand the transistor is there to protect the brownout circuit. It's used to open-collector reset signal. In the documentation, they specify not to drive the reset pin high. I would imagine this is because it will interfere with the operation of the internal brownout circuit. It may possibly even damage the brownout circuit. Like I said I could be wrong.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2013-10-17 11:08
    Cluso99 nailed it as far as it being a problem with Windows in that some programs set the DTR line but don't return it to it's original state. The Problem was discovered in 1997 with the Basic Stamp II. There was a work around that I went back and forth with Jeff Martin on, but he ultimately came up with the solution to use a capacitor on the DTR signal line, later a transistor was added to buffer and protect the Reset pin of the Basic stamp II from any unknown RS232 voltage levels.

    Much of the same circuitry was borrowed for the Propeller because by then, the transistor and capacitor addition was a proven design that could withstand several unpredictable circumstances.


    BTW) if someone has an archive of the back-n-forth email discussions between Jeff and I, I would greatly appreciate the re-read 16 years later :-)



    1997 post from the Basic Stamps email List ...
    ...perhaps the first DEBUG terminal with QBASIC code at the bottom
    ...The problem is with the ATN line on the StampII or DTR line
    from the PC. There are THREE ways that I know of to work
    around this problem either through software or hardware.
    
    Manual Hardware Switch Method:
    --------------------------------------------------------------
    
    Stamp Side                                      PC-Side (9-Pin connector)
    
    Sout >-----------------------------------------> RX(2)
    Sin >-----------------------------------------> TX(3)
    ATN >---o----[SWITCH]-------------------------> DTR(4)
            |
            o--/\/\--o
                4.7K |
    GND >------------o----------------------------> GND(5)
    
    
    SWITCH - RUN(open) / PROGRAM(closed)
    
    
    
    Automatic Hardware Switch Method: (Thanks Jeff Martin)
    --------------------------------------------------------------
    
    Stamp Side                                      PC-Side (9-Pin connector)
    
    Sout >-----------------------------------------> RX(2)
    Sin >-----------------------------------------> TX(3)
    ATN >---o--||---------------------------------> DTR(4)
            | C1
            o--||--o
                C2 |
    GND >----------o------------------------------> GND(5)
    
    
    C1 & C2 = .1uF
    
    
    
    Software Switch Method:
    --------------------------------------------------------------
    
    Stamp Side                                      PC-Side (9-Pin connector)
    
    Sout >-----------------------------------------> RX(2)
    Sin >-----------------------------------------> TX(3)
    ATN >-----------------------------------------> DTR(4)
    GND >-----------------------------------------> GND(5)
    
    Software Example for the StampII to "Send Info"
    MainLoop:
    DEBUG "The StampII is ALIVE!!!",cr
    goto MainLoop
    
    
    Software Example in QuickBasic to "switch" the DTR line:
    CLS
    OPEN "com1:9600,n,8,1,CD,CS" FOR RANDOM AS #1
    COMaddress = &H3F8 'COM1 address location
    
    DTR = 0 '0=OFF ; 1=ON
    Value = (INP(COMaddress + 4) AND 254) + DTR
    OUT COMaddress + 4, Value
    
    WHILE 1
    Data$ = INPUT$(LOC(1), #1)
    PRINT Data$;
    WEND 
    
  • AribaAriba Posts: 2,690
    edited 2020-03-08 17:14
    I use the single capacitor for Prop reset since years, and have said this many times in this forum. One post with an explanation is here.
    For sure you need to connect the BOEn pin to Ground which disables the BrownOut detector and enables a 5k pullup at the reset pin inside the Prop.
    For propper function with a Terminal you need to invert the DTR output of the FT232 (with the FTProg tool), otherwise the reset happens if you open the Terminal (COM port) and not when you close it. This is not necessary if you only want to download code, and don't need Terminal communication.

    Andy
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-17 13:21
    Ariba wrote:
    For sure you need to connect the BOEn pin to Ground which disables the BrownOut detector and enables a 5k pullup at the reset pin inside the Prop.
    Tying BOEn low enables the brownout reset.

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-10-17 15:00
    Cluso99 nailed it as far as it being a problem with Windows in that some programs set the DTR line but don't return it to it's original state. The Problem was discovered in 1997 with the Basic Stamp II. There was a work around that I went back and forth with Jeff Martin on, but he ultimately came up with the solution to use a capacitor on the DTR signal line, later a transistor was added to buffer and protect the Reset pin of the Basic stamp II from any unknown RS232 voltage levels.

    Love to help you with the old emails but I've checked my pockets and there's only jelly babies in there. Jelly baby?

    You said "from any unknown RS232 voltage levels" which is my point as we are using this transistor on 3.3V USB circuits and it indicates it is redundant. As for the state of the DTR line I have not had any problems in Windows or Linux with this and shouldn't the DTR line be set to inactive before it is pulsed anyway? That is good programming practice.

    So what I am saying is use the transistor in a RS232 circuit but don't bother in a USB circuit, it can't help or hurt.
  • jmgjmg Posts: 15,173
    edited 2013-10-17 16:01
    So what I am saying is use the transistor in a RS232 circuit but don't bother in a USB circuit, it can't help or hurt.

    It depends on how close the USB is to the Prop,

    I'd still prefer a RET (digital transistor) and short reset leads, and a cap in the base to longer traces/USB/any RST source.

    http://www.nxp.com/products/bipolar_transistors/resistor_equipped_transistors_rets/

    Choosing the largest Rb RET will give the best impulse noise rejection, and a equal value RET gives appx TTL thresholds.
  • tonyp12tonyp12 Posts: 1,951
    edited 2013-10-17 17:16
    >Choosing the largest Rb RET will give the best impulse noise rejection, and a equal value RET gives appx TTL thresholds
    Is this one a good choice then?, npn 47k/47k
    http://www.nxp.com/products/bipolar_transistors/resistor_equipped_transistors_rets/ret_100_ma_50_v/ret_100_ma_50_v_single_npn/PDTC144EMB.html
  • jmgjmg Posts: 15,173
    edited 2013-10-17 18:23
    tonyp12 wrote: »
    >Choosing the largest Rb RET will give the best impulse noise rejection, and a equal value RET gives appx TTL thresholds
    Is this one a good choice then?, npn 47k/47k
    http://www.nxp.com/products/bipolar_transistors/resistor_equipped_transistors_rets/ret_100_ma_50_v/ret_100_ma_50_v_single_npn/PDTC144EMB.html

    Yes, - it can sink ~ 4mA @ -40'C, and ~10mA @ 25'C, which is plenty for RST work.

    The package of that exact part code is a bit of a challenge, and I've somewhat standardised on Dual RET as the price is not much more.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-10-17 20:49
    tonyp12 wrote: »
    >Choosing the largest Rb RET will give the best impulse noise rejection, and a equal value RET gives appx TTL thresholds
    Is this one a good choice then?, npn 47k/47k
    http://www.nxp.com/products/bipolar_transistors/resistor_equipped_transistors_rets/ret_100_ma_50_v/ret_100_ma_50_v_single_npn/PDTC144EMB.html

    That part sure is small, too small, but nice. I normally use SOT-23 style packs and in fact I already use a DDTD digital transistor for my reset circuit in other boards. The point here though is that especially in designs with built-in USB that the transistor is really redundant and a simple 1nf cap is all that is necessary. I agree with jmg that using the right resistor ratio would improve the noise threshold for those designs that have external USB.
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-10-18 00:16
    The transistor is used to invert the DTR signal - and cause the reset on the falling edge of DTR. While it may also protect from high voltages, that is not the purpose to solve the Windoze problem. It is only relevant when switching between windows programs. For this reason, PST actually keeps DTR off, as does PropTool. This permits these programs to swap without causing the prop to reset.
    If you are happy to ignore the reset caused by swapping windows programs, then the transistor is not required if you are not using high voltages (which will probably be ok using a cap anyway due to the internal protection diodes in the prop.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-10-18 01:33
    Cluso99 wrote: »
    The transistor is used to invert the DTR signal - and cause the reset on the falling edge of DTR. While it may also protect from high voltages, that is not the purpose to solve the Windoze problem. It is only relevant when switching between windows programs. For this reason, PST actually keeps DTR off, as does PropTool. This permits these programs to swap without causing the prop to reset.
    If you are happy to ignore the reset caused by swapping windows programs, then the transistor is not required if you are not using high voltages (which will probably be ok using a cap anyway due to the internal protection diodes in the prop.

    Look Ray, you know me and I don't really care if I add a transistor or not and a PC is only ever normally connected during development reprogramming anyway so it's no skin off my nose if Windows being Windows does weird things, I think everyone expects that with MS :)
    The thing is to be aware of the fact that you can have a simpler circuit that just works. There always seems to be a bit of hocus pocus carry-on about electronics especially when it is not properly understood, understood?
  • shimniokshimniok Posts: 177
    edited 2013-10-18 07:09
    Cluso99 wrote: »
    The transistor is used to invert the DTR signal - and cause the reset on the falling edge of DTR.

    Yup. The cap inline (like on Arduino clones) creates a positive and negative spikes on rising and falling edges, respectively. The (NPN) transistor with resistor from base to ground is turned on by only positive going edges.

    I should add that commonly, AVR circuits connected to FTDI use an inline cap, only. Are there issues with the Prop RESET seeing negative spikes? Sounds like no.

    I've built my Prop boards with and without the transistor. I recall only ever having major DTR weirdness on Linux.
Sign In or Register to comment.