A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
I'm heavily modifying Microchip's bootloader for my own purposes. I thought I would start with that one because it doesn't depend on a custom application on the PC "side", it uses Hyperterm to send hex code to the PIC. I'm much better at PIC assembly than Windows apps. The Microchip bootloader uses XON/XOFF protocol to "throttle" the program data coming from the PC. I want the PIC to initiate the data transfer when it is ready, so I planned to have it come out of RESET and send an XON to the PC to begin loading the software. The trouble is - I find that Hyperterm (and probably most other communications programs) start sending data immediately upon invoking them, and don't stop until they get an XOFF. What I need is a program that sits and waits for an XON before it sends anything. Does anyone know of such a program or a terminal emulation mode that gives me what I want? I can't use CTS/RTS handshaking because I don't have the pins available. Charles Linquist |
|
|
|
one crude but fairly effective and simple solution is to insert a line delay (say 50 mS but experimentation will show correct value) after each CR. you'll need to buffer up to a line's worth of data. with tuning you can get the performance reasonably close to that of xon/xoff. The other approach is to modify for rts/cts. --- In , "Charles Linquist" <Charles@L...> wrote: > > I'm heavily modifying Microchip's bootloader for my own purposes. I thought > I would start with that one because it doesn't depend on a custom > application on the PC "side", it uses Hyperterm to send hex code to the PIC. > I'm much better at PIC assembly than Windows apps. > > The Microchip bootloader uses XON/XOFF protocol to "throttle" the program > data coming from the PC. > I want the PIC to initiate the data transfer when it is ready, so I planned > to have it come out of RESET and send an XON to the PC to begin loading the > software. The trouble is - I find that Hyperterm (and probably most other > communications programs) start sending data immediately upon invoking them, > and don't stop until they get an XOFF. > > What I need is a program that sits and waits for an XON before it sends > anything. Does anyone know of such a program or a terminal emulation mode > that gives me what I want? I can't use CTS/RTS handshaking because I don't > have the pins available. > > Charles Linquist |
|
Hi Charles
This is never going to be be easy with
some form of programming on the workstation side. Start maybe with a terminal app
that can do scripting ie. Procomm or simmilar. As disirable (to me anyway) would be
VB or I would think these days that one should be able to get a terminal app with VBA on
it that should be a breeze.
You mentioned that you started with
Microchip's app. Have you seen Rick Farmer's bootloader. It was probably the
first one out. It uses Hyperterminal and works fantastic. I have extensive
modded this code when the f877 arrived some years ago and added features such as reading
the external I2C memory.
You may want to reconsider the strategy
of placing the pic in control as to be on the safe side you want the ultimate control from
somewhere else. One of the things a pc does particularly well is just that - taking
control of things. We have been using this for some years to update flash in the
field for telemetry work. If you require some more details then let me know as I can
tell you many stories how to burn your fingers as many of our apps are on the other side
of the world.
regards
Martin
|