Shop OBEX P1 Docs P2 Docs Learn Events
Controlling/Enabling the Propeller RESET line ( USING A PROP-PLUG) via a MOSFE — Parallax Forums

Controlling/Enabling the Propeller RESET line ( USING A PROP-PLUG) via a MOSFE

DavidMDavidM Posts: 630
edited 2009-02-23 22:45 in Propeller 1
Hi,

I have been using a PROPPLUG on my devices as a serial comms and as a way to upload firmware. I have noticed that sometimes the prop resets if you unplug or plug in a USB Cable, or if data is sent from the PROP to another USB/Serial Device if there is no device attached.

so , in order to illiminate this problem and without adding a PHYSICAL SWITCH,

Would this following idea work?

If I hook up the reset line ( of the PROP/PROP-PLUG ) to a P-Channel line level mosfet ( such as ZVP2106A ) so that its GATE is driven by another spare PROP PIN, then could I prevent the the PROP from resetting on USB Activity?

The mosfet by default would dissalow the reset line.

So, on startup the USB PROPPLUG would allow normal USB/ Serial communications.

The mosfet would allow/disallow the reset line, it would NOT activate a "reset" , the signal ( I think it's DTR??) from the SPIN application would still do this as normal.

when it comes to uploading firmware to the PROP via SPIN, you would first tell the prop to drive the gate , then allowing any reset signal to pass through.

Sorry i don't have a schematic yet . I want to see if my idea is feasable first.

Any comments welcome.

regards

Dave M

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-02-23 05:39
    Usually, a pMOSFET is used to source current when its gate is pulled low. It would be a bad idea to try to force the /RST line high via the MOSFET when some other device is trying to pull it low. Is that what you had in mind, or am I misunderstanding your intent? A schematic would help to communicate your idea better.

    -Phil
  • DavidMDavidM Posts: 630
    edited 2009-02-23 05:53
    HI Phil,

    yes you are miss-understanding me. smile.gif

    When the gate is pulled hi or low it turns on or off the mosfet, IT DOES NOT do anything to the reset line except allow a reset to take place or not , I want the mosfet to behave like a secondary switch.

    Dave M
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-23 05:57
    You really need to post a schematic or better description of what you want to do. Just where is the mosfet connected? There are 3 leads. Where do they go? Are there any pullups / pulldowns?
  • DavidMDavidM Posts: 630
    edited 2009-02-23 06:09
    Ok I will start drawing a schematic,b but in the mean time..

    The drain and source are conected to the reset line ( in line),
    The gate is pulled up or down via a resistor and then to a spare prop pin. which controls the gate.

    Dave M
  • DavidMDavidM Posts: 630
    edited 2009-02-23 06:14
    OK,

    Here is my first schematic of what I want to do.

    regards

    Dave M
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-02-23 06:46
    Ah, I see. The reset pin on the Prop is active low, not active high. That's why your use of a pMOSFET had me wondering what your intent was. Try recasting your design with an nMOSFET and post another schematic.

    -Phil
  • DavidMDavidM Posts: 630
    edited 2009-02-23 07:12
    HI Phil

    Thanks for looking at this for me

    This is rev 2 of the schematic.

    I believe the gate should be pulled to ground on startup so the MOSFET if OFF, would this be correct?

    By the way the 2 types of mosfets I used, I have in stock and both are LINE LEVEL at the gate.

    Dave M
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-02-23 08:00
    You've got the drain and source reversed. Don't forget: there's a parasitic diode that will always conduct in one direction. As you've configured it, you can't disable the reset.

    -Phil
  • DavidMDavidM Posts: 630
    edited 2009-02-23 08:19
    Ok Phil,

    I have swapped the drain & source around.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-02-23 09:39
    With the circuit you've now provided, /RESET will normailly be disabled unless P0 is an output and is brought high. Is that what you intend?

    -Phil
  • DavidMDavidM Posts: 630
    edited 2009-02-23 09:52
    yes Phil

    This is exactly how I want it to work,

    I just have to find out / test if the SPIN Application will work as normal .


    I hope that some others here may find this idea useful,


    Regards

    Dave M
  • BaggersBaggers Posts: 3,019
    edited 2009-02-23 13:33
    shouldn't you want to make it be the other way around, and Prop will reset if P0 = 0, (ie just started prop) and not resetable if P0 = 1 once you have your program running.
    unless you pull P0 low again?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • DavidMDavidM Posts: 630
    edited 2009-02-23 13:42
    Hi baggers,

    No, You can only program the prop IF you make the P0 HI, This is for FINISHED DESIGNS , where the user will rarely need to update the firmware, but allows normal USB/Serial communications without the prop resetting INCLUDING removing/plugging in a USB Cable.

    I guess for development purposes I could bypass the circuit until the design is completed.

    Also I am only using the prop-plug for now until I can incorporate the USB circuit in my final boards, But I would still use the circuit I mentioned.

    And also

    I have not tested this circuit YET!, I need to see if the SPIN APP will work!!!


    Thanks

    Dave M
  • softexsoftex Posts: 27
    edited 2009-02-23 17:36
    Dave,

    Good luck on your SPIN test. But, just to clarify ... IF one would settle for a physical jumper solution here, do you reckon that jumpering the reset line from the propplug between RESET and a 3.3v SOURCE would allow a user to use the propplug for programming on the one hand, and also for serial data transfer?

    For the daughterboard design I am considering (no on-board power), I would envision the normal propplug 4-pin header plus an additional 2-pin header (3.3v/GND). Then if the jumper was set for RESET, the propplug could be used for programming/firmware updates (with external power from the 2-pin power/GND temporarily connected), and the same 4-pin propplug header - when jumpered for 3.3v SOURCE could be used for normal serial data I/O (PWR/GND/TX/RX - no 2-pin power/GND connected).

    Other than being somewhat low-tech, would you forsee any problem with this?

    Thanks,

    -D
  • DavidMDavidM Posts: 630
    edited 2009-02-23 22:45
    Hi Softex,

    The JUMPER across the REST LINE will work, But my reason is NOT to allow the user to access the internal workings of the device. An also every one of my devices need USB Connectivity for general operation.

    As I said earlier, I still need to build this circuit and test it,I will post my results here when I get time to do this.

    regards

    Dave M
Sign In or Register to comment.