Shop OBEX P1 Docs P2 Docs Learn Events
loading program without FTDI reset connected — Parallax Forums

loading program without FTDI reset connected

Erik FriesenErik Friesen Posts: 1,071
edited 2008-05-27 02:37 in Propeller 1
Is there a way to monitor the serial inputs and load the prop without the reset hooked up to the ftdi?· I have considered either a direct i2c·rewrite to the eeprom·or a cog that monitors the serial and resets it at the right time.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-26 19:33
    There are all kinds of ways you could generate an external reset signal based on the serial input (to pin 31). You could build a circuit to detect a "break" signal (a long logic zero) or you could use a little PIC processor to detect a particular sequence of characters. The main issue is that you'd have to use some kind of custom downloading program rather than the Propeller Tool or you'd need some kind of downloading processor with enough memory to buffer an entire 32K download like the Stache for the Stamps.

    There's really no practical way to do a download using the built-in downloader and the Propeller Tool without a PC controlled reset line
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-05-26 20:22
    Mike is right about the need for a self-defined protocol. A working example can be found in
    the JVM for Prop thread:
    http://forums.parallax.com/showthread.php?p=713162

    Note that the downloader code implements the Javelin IDE download protocol, but you
    can of course implement any other protocol, for example the basic stamp protocol.
    The javelin protocol however is already implemented in a stand-alone pc download
    program called JavelinDirect, that normally downloads a (up to) 32KByte image to
    the javelin. I see no reason why that image could not be a 32KByte propeller eeprom image.
    Of course, the download code should be part of any propeller program that you
    download into the propeller, so subsequent downloads are·possible.

    I am planning this approach for my new board when assembled with a spinstamp
    because that way the spinstamp can be reprogrammed using the pins SIN, SOUT and ATN.
    (propeller I/O pins 16, 17 and 18).

    regards peter
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-05-27 01:22
    I have had many different thoughts about this as several of my commercial units are strictly RX/TX as they have dual RS-485 ports configured so that by default (at reset) one channel is receive and one is transmit. By connecting RS-232 directly to the inverting inputs and outputs I can reprogram the Propeller if I switch on the power at the same time I hit "Load EEPROM" (after an F8). This method is sometimes hit and miss and it might take a few more retries before it synchs but it is simple and it works.

    Having a custom bootloader is fine but it has to be loaded in the first place and so the power-up method may be suitable. For a custom bootloader to work with the Propeller tool it is necessary that it detects the reseting signal without having a direct connection. An easy way to do this would be to combine the reset signal with the transmit line so that it generates a break signal that can be detected without dedicating a cog as this signal can be sampled over 100ms or so. Of course it would be nice if Parallax included the break as an option directly in the Prop tool itself.

    Looking at the PC RS-232 reset timing when we hit F7 generates this sequence.

    1. DTR +V for 2.5ms
    2. DTR -V for 2.5ms
    3. DTR +V for 25ms
    4. DTR -V
    5. 90ms gap
    6. Receive data from PC for 32ms

    If we take the DTR through a diode to the transmit line which itself is coupled through a 1K resistor it will appear to generate a 25ms break on the transmit line. Simple polling of the receive line can count and detect this break and REBOOT the Propeller so that it's ready to handle the bootload sequence.

    DTR ----|>|-----|
    TXD ----1K------|
                    |-----> to Propeller RXD
    
    



    This modification won't affect normal operation but does allow a user application to detect the bootload signal at least.

    *Peter*
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-05-27 02:11
    If you are not connecting the DTR signal to the capacitor and transistor circuit, you could connect this to an unused pin and set this pin to an output and set it high (=1) by the propeller when the detection of a reset is required (whatever that may be). This will force the transistor on for a short time and generate the required reset pulse.

    Note that a short time later the propeller will execute its restart sequence and whatever method is used to load the propeller needs to be ready. If you have preprogrammed the EEPROM it could boot from here unaided.

    This method could use a cog to implement a watchdog arrangement and reboot from EEPROM if a fault occurred.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-05-27 02:37
    Ray, doesn't REBOOT do the same thing without using I/O pins or external transistors?

    In the normal Propeller tool reset circuit a transistor is used yet in simpler circuits it is not. Really it doesn't matter as the Prop tool generates enough edges with suitable delays on the DTR/RTS to enable a simple cap coupled to the reset to work effectively. The simple cap hooked directly to DTR relies on the fact that the RS-232 line is current limited already due to the driver (300ohm spec) plus the amount of energy that is coupled through a 10nf cap is easily handled by the prop's pin protection.

    *Peter*
Sign In or Register to comment.