Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Apr 2022 01:39:51 +0200
From:      Tomek CEDRO <tomek@cedro.info>
To:        Axel Rau <Axel.Rau@chaos1.de>
Cc:        Hans Petter Selasky <hps@selasky.org>, hardware@freebsd.org
Subject:   Re: timeouts on USB ISP programmer
Message-ID:  <CAFYkXjkCZopGV2vOEtzNg_Ut76WuyHQ5NxxVOjoY-Sy-QNuGHw@mail.gmail.com>
In-Reply-To: <1A94816D-E3C1-4488-A5A9-784BAC68AE74@Chaos1.DE>
References:  <3A781DFA-1E2C-41A5-8053-C90A806244DC@Chaos1.DE> <34a747ea-2ee5-660f-71c6-dc00d5de337f@selasky.org> <9334c4f0-3ecf-c046-420f-516e39379981@selasky.org> <976BDBEB-8B57-4541-A0B7-3F2C89498DC6@Chaos1.DE> <7190bdde-22bc-79ee-06d0-d0114a3ffbad@selasky.org> <CAFYkXj=HMdxZG%2B8x0gpLCDy8cbu_qOpFqcN37RO9EG=WOBHkqw@mail.gmail.com> <CAFYkXjmjnFX1a3%2BCQxAxdwX=-oASSEWLdzrmx=%2B4QbX3_Og2Gw@mail.gmail.com> <CAFYkXjmgLi0F4gLVWQxtVwS6tCXCni%2BxU2-7KQM4ve%2B%2B-aEiBw@mail.gmail.com> <CAFYkXjnG5uOzF5_BbNZUgzBzTN8hpU9RmTTh1h_KDZ0EonZgEQ@mail.gmail.com> <CAFYkXjnbneNUszR8ZwS50xY8924uvCQyYQ9d3ohT_t1HZrjmDw@mail.gmail.com> <CAFYkXjmf8DpZw5hQ6Cc_FBurHufKNHhKGYiXpK%2BArB0SGCbqsg@mail.gmail.com> <7CDFB049-241F-4C31-A7B1-A7D6BDE6A002@Chaos1.DE> <CAFYkXjnwvba60u3_tRMReEiyb5dohNZDLoenZWieNB2q_c_-0w@mail.gmail.com> <24AA646A-698B-4D41-9668-3F9F99732D02@Chaos1.DE> <CAFYkXjk2TgdC65j1YZqYw2AHn2zMVR2uZ52NTF8jTGVPRV60sg@mail.gmail.com> <1A94816D-E3C1-4488-A5A9-784BAC68AE74@Chaos1.DE>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 8, 2022 at 11:02 PM Axel Rau <Axel.Rau@chaos1.de> wrote:
> Am 08.04.2022 um 20:39 schrieb Tomek CEDRO <tomek@cedro.info>:
>
> Is it possible to disassemble your interface and take photos of the
> electronics inside? We need to make sure what exact chip is inside :-)
> https://www.chaos1.de/downloads/diamex_photos.tar.gz

This is not an FT2232H based device this is why libftdi could not reset it =
:-)

What I can see is from the photo:
1. 74HC125 Quad Buffer Line Driver [1].
2. STM32F042F6P6 ARM-Cortex-M0 MCU [2].

As stated on product website [3] this Diamex-Avr-USB supports STK500v2
and AVRISPV2 protocols. Details on internal dip switch configuration
and available functions is provided in product documentation [4].
Documentation does not mention Debug, only Flashing.

>From the default avrdude.conf we can read that AVRISPV2 programmer
also uses STK500V2 protocol. There is no VID:PID provided in STK500V2
programmer definition so there may be some autodetection mechanism
implemented.

Just try `avrdude -c stk500v2 -p 85 -vvv -t` :-)


It also matters on how you connect to the Target AVR - is it already
powered on some working board or you are connecting to a "bare" AVR?
Also what is the Target i85 or t861?

>From the configuration of your dip switches it looks like you are
providing 5V from the programmer to the Target, so you are connecting
to a "bare" AVR..? Both ATtiny85 [5] and ATtiny861 [6] are up to 5.5V
tolerant so it should not burn them "alone". But if you are connecting
to some board with other components it is critical to first verify
what is the acceptable maximum voltage that components can work with.
Old electronics used 5V. New electronics use 1,8..3.3V. If you provide
5V from the programmer to the board working with 3.3V or 1.8V you can
burn the board components. If you use some bigger board with its own
power supply both dip-switches should be in position OFF. VCC
connection from Programmer to AVR does not seem required. Here is an
extract from Diamex-Avr-USB documentation [4]:

Switch position for normal programming in user=E2=80=99s switching=3D both =
switch OFF
If voltage supply of the target is needed.
For a single AVR controller only without own switching 5V are required
(for example Diamex program
adapter/pivot lever) 1=3Don 2=3Don
General: 3.3V max. 120mA, 5V 150-500mA. Depending on which computer is used=
.
Switch 1 off=3D target voltage off/on, switch 2 off=3D 3.3V / on=3D5.0V. Th=
e
programmer doesn=E2=80=99t need a
power supply from the target for the programming operation.

Long story short:
* Put both dip-switches to OFF if you use external board (no VCC
connection required). They may stay ON if you program "bare" AVR (you
need to connect VCC, SW1=3DON, SW2 OFF=3D3.3V ON=3D5V).
* Try `avrdude -c stk500v2 -p 85 -vvv -t` and see of that connects to
Programmer.
* If programmer is connected but AVR communication problems you may
slow down the STK500v2 bit clock with `-B` parameter or ISP clock with
`-i` according to [4] (i.e. `-B 250` will result in 4kHz bit clock).

Good luck and let us know if that works :-)
Tomek

[1] https://assets.nexperia.com/documents/data-sheet/74HC_HCT125.pdf
[2] https://www.st.com/en/microcontrollers-microprocessors/stm32f042f6.html
[3] https://www.diamex.de/dxshop/DIAMEX-USB-ISP-Programmer-Stick-fuer-AVR
[4] https://www.diamex.de/dxshop/mediafiles/Sonstiges/ENG%20ISP%20Programme=
r.pdf
[5] https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-2586-AVR-8-bit-M=
icrocontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet-Summary.pdf
[6] https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-2588-8-bit-AVR-M=
icrocontrollers-tinyAVR-ATtiny261-ATtiny461-ATtiny861_Datasheet-Summary.pdf

--=20
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXjkCZopGV2vOEtzNg_Ut76WuyHQ5NxxVOjoY-Sy-QNuGHw>