On Wed, Sep 21, 2005 at 08:01:33PM +0200, Wouter van Ooijen wrote: > > No real disagreement there. But the programmer issue is > > always something > > that I see as a "chicken and egg" type problem. To get a > > "proper" programmer > > you need a programmer, though it may be a temporary one. > > For an intelligent programmer one will have to buy a PIC. If he buys it > from me he might as well pay the extra to have it programmed. I haven't been able to convince those who want to program on the cheap of that fact. I still have a steady support stream for the TLVP parallel port programmer. > > So that's why I'm working on my Trivial Serial BootStrap > > Programmer. The > > preliminary design page is here: > > http://www.finitesite.com/d3jsys/tbs555 > > SBP OK, but not so T! It gets complicated when you try to do feedback through the RX pin. For programming it's just two 555s configured in monostable mode. So it's a 555, a resistor, and a couple of caps each. The two pots are for tuning and can be merged into the fixed resistors above them. The transistor connected to the two 555 inputs makes the inputs edge triggered instead of level sensitive as normal because the output of the right 555 going high forces the inputs high again. So each 555 triggers for a fixed amount of time from the start bit coming in from TX. The left 555 is tuned to reset about halfway through the character cell while the right one is tuned to timeout somewhere around the stop bit. So the PIC will latch the data on the falling edge of the left 555 and the right one guarantees only a single transistion per cell. It's a similar idea to your ZPL bootloader where the length of each character cell determines the bit transmitted. But as I said the complication occurs with trying to get feedback through the RX pin. The diode to the far right keeps the RX line idle when nothing is transmitted via TX. It doesn't conduct for the full duration of the right 555 being active and so can be wiggled by the other transistors. The transistor next to it is supposed to force a proper start bit. But I think I have an error in my thinking. Note that RX and TX are running at nominal PC RS-232 levels (0V -> 1 bit and 5V -> 0 bit). When that far diode pulls the RX line to 0V, it transmits an idle line. When the 555 output that connects to that diode goes high, the diode stops conducting and the line is suppose to be pulled high transmitting a series of 0 bits. But the transistor connected to the left 555 output acts as an inverter. The start bit causes the 555 output to go high, causing that transistor to pull RX to 0V (or thereabouts). So instead of RX going from 0V to 5V causing a start bit, it remains low staying idle. So I believe I need to replace that transistor and its resistor with a diode so that the diode conducts normally by releases just like the other diode when TX sends a start bit. Let's presume that's the case for the rest of the discussion. So until the left 555 times out, both diodes will be off and the RX line pulls to 5V. That leaves the final transistor connected to RX. Its input is controlled by two sources: The incoming TX line and the Pic Data line. I think there may be problems here too. The TX line is guaranteed to generate a start bit. The transistor to the far left (connected to TX) will turn on for the duration of that start bit guaranteeing that the base of the transistor tied to the RX line will be off. However presuming that a 0xff byte is transmitted for a read of the bit, after the start bit that transistor to the left turns off and the transistor connected to RX's base is coupled to +5 via a pullup turning that transistor on. Without the PIC Data line being driven, RX should follow TX. The problem is the PIC Data line. According the Figure 7.4 of the 16F8X programmin specification, the PIC Data line is active for the entire time it's transmitting bits. So that means that it's active during the time that I'm trying to form a proper start bit and I cannot know what the value is going to be. That means that the left transistor connected to TX in the lower left must have override capability over the PIC data line. I also see now that the output of the left 555 has no function in terms of RX and should be removed along with its associated diode from above. So I see myself as being stuck now unless I can figure out some steering diodes in this game. TX needs to be able to drive the Pic Data line when necessary and to allow for the PIC data line to drive RX when it's an output. However, I also need to be able to override that Pic Data line output for a TX start bit. So would two diodes going in and out of Pic Data separate the incoming TX data from the outgoing Pic Data? So Wouter you were definitely right, it's a bit compilicated to get RX to work right. BAJ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist