On Thu, Feb 19, 2004 at 09:15:25AM -0800, Charles Linquist wrote: > A bootloader normally requires a hardware UART, and I'm > unaware of any 8-pin device that has one. A bootloader certainly does not require a hardware UART. Wouter is the absolute master of devising bootloader interfaces that minimally impact the I/O resources required to support it. Totally without his permission I'll post the relavent discussion he wrote in the ZPL documentation: (ANY EMPHESIS MINE and [My comments in brackets]: BAJ) ----------------------- Begin Quote -------------------------------- Communication A bootloader must communicate with the host system (PC). This (traditionally) requires the use of one or more I/O pins. Using the target's hardware UART can reduce the code size of the bootloader, but requires the use of the UART's fixed I/O pins. USING A BIT-BANGED (SOFTWARE) UART GIVES FULL FREEDOM IN CHOOSING THE i/o PINS USED FOR COMMUNICATION (and with some cleverness one pin is sufficient), but at the cost of more code [ BTW this is what Wouter uses for his Wloader bootloader]. [Wouter then continues by pointing out that really any I/O resources may cost too much in terms of dedicated bootloader usage... ] The historical trend is that new microcontrollers are faster and have more memory and peripherals than their predecessors, at a price that is only a fraction higher (or sometimes even lower!). The 18Fxxx family illustrates this trend: compared to the 16Fxxx chips they offer twice the code space, twice the speed, much more RAM, a more powerful CPU, and more and better peripherals. The number of I/O pins however does [not] increase at the same rate, because it is limited by the available packages. So with each new generation of chips the chance increases that the availability of I/O pins will be the limiting factor for your application. The bootloader described here [ZPL] can of course not avoid the use of some code space, but it does avoid the use of I/O pins by using an often neglected pin for communication: the /MCLR (Master CLear and Reset) pin. This may sound like black magic, but the principle is very simple: the PC manipulates the reset pin so the processor gets to run varying amounts of time. The processor records the length of time it was allowed to run, and when it gets to run again it interprets a short previous run time as a 0 and a longer time as a 1. Voila, a communication channel. Modern PCs running Windows or Linux are not capable of very precise timing in the microseconds region, so you might fear that complicated hardware is involved. Luckily the ancient serial port with its UART is perfect for this purpose. For modern hardware that has no serial port available an USB->serial adapter can be used, which is in fact the way the bootloader was developed. ------------------------------ End Quote ---------------------------- So as Wouter has so cogently pointed out, a bootloader certainly doesn't require the use of the hardware UART (a very valuable hardware resource). In fact with clever manipulation you can get the hardware bootloader interface as small as zero pins. BAJ [Original message snipped] -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body