Re: 2313 output pin problem

Anderas Strodl <[email protected]> Tue, 23 Dec 2003 16:26:54 +0100
Newsgroups gmane.comp.hardware.avr.general
Message-ID <[email protected]>
Robert Baruch wrote:

> I took a closer look at the pin diagrams for PB7 and PB5. It seems that
> these pins are output-disabled as long as the SPIEN (Serial Programming
> Interface Enable) fuse bit is set to 0, which is the default, enabled
> position (so it should really be named -SPIEN).
> 
> However, it seems that the 2313 does not allow programming of SPIEN via
> the serial port.

I have a board here using all the SPI pins as outputs. I am using the
SPI interface for programming and I didn't have
to change any fuse-bits.

I don't know the exact wiring of your "alf"-type programmer, but I am
assuming
it is a simple parallel port adapter which consists mostly of wire.
AFAIK the parallel port has protection resistors not to allow over
current
on the IO pins. You might also have connected some yourself in the IO
lines.

I imagine your connections to look something like the following:

          o +5V
         _|_
         \ /  I assume you are using a red LED which normally have
         _V_  a forward voltage of 1.65 Volts
          |
         _|_
        |   |
        |   |
        |___|
AVR PB7   |    __  PB7 LPT port__
o---------+---|__|---o--------|__|----
             external       internal
             protection     protection
             resistor       resistor


Now you start programming. Due to the LED and the resistors the voltage
at the SCK pin while programming is in high state +5V and in low state
something about 1.65 lower. So you have a high level of +5V and a low
level of about +3.35V. The maximum-input-low-voltage is specified to
0.3*VCC which is +1.5V and then minimum-input-high-voltage is specified
to 0.6*VCC which is +3.0V. As a consequence the AVR does recognize the
signal on SCK as a stable high level during all the time the programmer
tries to write the memory. So the AVR doesn't get programmed at all.

The fact that only SCK and MOSI are the only pins not working is
pointing
in the same direction as mentioned above, the input signal is not
recognized
properly.

Try first program your AVR and then connect the LED or use a transistor
to
drive the LED.

Don't try to remove any protection resistors you might have connected in
the IO line. I already have burned 2 AT90S2313s while using a adaptor
without these in a circuit where I used the SPI lines as output lines.

Hope you'll suceed now.

A.Strodl