avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] Problem with TPI and "serbb" mode


From: Wayne Holder
Subject: Re: [avrdude-dev] Problem with TPI and "serbb" mode
Date: Wed, 17 Apr 2019 19:00:33 -0700

I was finally able to make this work, so I wanted to follow up with a quick
post about what I learned to to again thank those that, ever so graciously,
tried to help me.  Basically, the FTDI driver was not loading even though
it appeared to be installed.  And, when the FTDI driver is not loaded, the
CTS, DCD and DSR signals on the FT232R chip behave very oddly.  In effect,
when the FTDI driver is not loaded a change on CTS, DCD or DSR will be
reported, but further changes will not be reported until one of the other 2
pins change.  I'm not sure where this behavior comes from (perhaps a
default driver in macOS), or perhaps from another driver, but when an
FT232R chip is in this mode, the CTS, DCD and DSR inputs are basically
useless.

As for why the FTDI driver was not loading, well, the answer seems to be
the way I was removing and reinstalling the FTDI driver during my tests.
While I was testing, I would try to uninstall the driver by removing it
from /System/Library/Extensions/  (and reboot) to run tests without the
driver installed, and then copy it back into the
 /System/Library/Extensions/ (and reboot) to reinstall it.  Reinstalling in
this fashion does not seem to work.  You must reinstall from scratch using
the FTDI installer.  So, as a result, nearly all of my tests were run with
the FTDI driver is not loaded.  Note: I think this may have something to do
with recent changes in how drivers are loaded in macOS High Sierra and
Mojave.

The best way I found to check on whether the FTDI driver is actually loaded
is to do the following:

1. Have an active FT232R chip connected and ready (needed to make sure the
driver loads)
2. Using terminal, run this command "kextstat | grep FTDI"
3. If the driver is loaded, this command should echo back something like:

    164    0 0xffffff7f850dd000 0x7000     0x7000
com.FTDI.driver.FTDIUSBSerialDriver (2.4.2)
E16D9540-AF63-36AD-94C4-B1164FBD6078 <76 55 6 5 3 1>

Perhaps this will help someone else down the line but, regardless, thanks
again to everyone that put up with my, perhaps, tedious posts and tried to
help me solve this riddle.

Wayne

On Tue, Mar 19, 2019 at 2:41 PM Wayne Holder <address@hidden> wrote:

> I'm trying to use AVRDUDE on macOS 0.14.2 to communicate with an ATTiny10
> that's connected an FTDI breakout board like this:
>
> TXD  --[1K]---+
>               |   +----------------------+
> CTS  ---------+---| TPI DATA (1)   RESET | ------+
> GND  -------------| GND              VCC | ---+  |
> DTR  -------------| TPI CLK           NC |    |  |
>                   +----------------------+    |  |
>                                               |  |
> VCC  -----------------------------------------+  |
>                                                  |
> RTS  --------------------------------------------+
>
> Note: adapted from http://irq5.io/2010/07/15/programming-the-attiny10/
>
> and using this as the definition for the programmer:
>
> programmer
>   id    = "ftdiprog";
>   desc  = "FTDI serial port banging, reset=rts sck=dtr mosi=txd miso=cts";
>   type  = "serbb";
>   miso  = ~8;
>   reset = ~7;
>   sck   = ~4;
>   mosi  = ~3;
> ;
>
> Note: passed using the - C + switch in file ftdiprog.conf
>
> But, when I use the following invocation (paths removed for brevity)  to
> try and read out the device signature value:
>
> avrdude -v -P /dev/cu.usbserial-A50285BI -C +ftdiprog.conf -c ftdiprog -p
> t10 -U signature:r:sig.hex:h
>
> It prints the following error (full, verbose response at end of this
> message):
>
> MOSI->MISO 0 failed
>
> and this has me stumped.  Is this a bug, or am I doing something wrong?
> Also, is there any more information about how to properly use AVRDUDE and
> the TPI protocol?  This information I've found online is either rather
> dated, or contradicts or other information I've read.
>
> Thanks in advance for any help offered,
>
> Wayne
>
> --full response--
>
> avrdude: Version 6.3, compiled on Sep 21 2018 at 19:15:33
>
>          Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
>
>          Copyright (c) 2007-2014 Joerg Wunsch
>
>
>          System wide configuration file is
> "/usr/local/Cellar/avrdude/6.3_1/etc/avrdude.conf"
>
>          User configuration file is "/Users/wholder/.avrduderc"
>
>          User configuration file does not exist or is not a regular file,
> skipping
>
>          Additional configuration file is
> "/var/folders/mt/7rrh06nw8xj05b0052g526300000gn/T/avr-toolchain/etc/ftdiprog.conf"
>
>
>          Using Port                    : /dev/cu.usbserial-A50285BI
>
>          Using Programmer              : ftdiprog
>
>          AVR Part                      : ATtiny10
>
>          Chip Erase delay              : 0 us
>
>          PAGEL                         : P00
>
>          BS2                           : P00
>
>          RESET disposition             : dedicated
>
>          RETRY pulse                   : SCK
>
>          serial program mode           : yes
>
>          parallel program mode         : yes
>
>          Timeout                       : 0
>
>          StabDelay                     : 0
>
>          CmdexeDelay                   : 0
>
>          SyncLoops                     : 0
>
>          ByteDelay                     : 0
>
>          PollIndex                     : 0
>
>          PollValue                     : 0x00
>
>          Memory Detail                 :
>
>
>                                   Block Poll               Page
>             Polled
>
>            Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages
> MinW  MaxW   ReadBack
>
>            ----------- ---- ----- ----- ---- ------ ------ ---- ------
> ----- ----- ---------
>
>            signature      0     0     0    0 no          3   16      0
> 0     0 0x00 0x00
>
>            fuse           0     0     4    0 no          1   16      0
> 0     0 0x00 0x00
>
>            calibration    0     0     0    0 no          1   16      0
> 0     0 0x00 0x00
>
>            lockbits       0     0     0    0 no          1   16      0
> 0     0 0x00 0x00
>
>            flash          0     0   128    0 no       1024   16      0
> 0     0 0x00 0x00
>
>
>          Programmer Type : SERBB
>
>          Description     : design ftdi adatper, reset=dtr sck=tx mosi=rts
> miso=cts
>
>
> MOSI->MISO 0 failed
>
> avrdude: initialization failed, rc=-1
>
>          Double check connections and try again, or use -F to override
>
>          this check.
>
>
>
> avrdude done.  Thank you.
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]