loading program without FTDI reset connected
Erik Friesen
Posts: 1,071
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
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
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
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.
This modification won't affect normal operation but does allow a user application to detect the bootload signal at least.
*Peter*
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.
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*