~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/spi/butterfly.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/spi/butterfly.rst (Version linux-6.12-rc7) and /Documentation/spi/butterfly.rst (Version linux-5.15.171)


  1 ==============================================      1 ===================================================
  2 spi_butterfly - parport-to-butterfly adapter d      2 spi_butterfly - parport-to-butterfly adapter driver
  3 ==============================================      3 ===================================================
  4                                                     4 
  5 This is a hardware and software project that i      5 This is a hardware and software project that includes building and using
  6 a parallel port adapter cable, together with a      6 a parallel port adapter cable, together with an "AVR Butterfly" to run
  7 firmware for user interfacing and/or sensors.       7 firmware for user interfacing and/or sensors.  A Butterfly is a $US20
  8 battery powered card with an AVR microcontroll      8 battery powered card with an AVR microcontroller and lots of goodies:
  9 sensors, LCD, flash, toggle stick, and more.        9 sensors, LCD, flash, toggle stick, and more.  You can use AVR-GCC to
 10 develop firmware for this, and flash it using      10 develop firmware for this, and flash it using this adapter cable.
 11                                                    11 
 12 You can make this adapter from an old printer      12 You can make this adapter from an old printer cable and solder things
 13 directly to the Butterfly.  Or (if you have th     13 directly to the Butterfly.  Or (if you have the parts and skills) you
 14 can come up with something fancier, providing      14 can come up with something fancier, providing circuit protection to the
 15 Butterfly and the printer port, or with a bett     15 Butterfly and the printer port, or with a better power supply than two
 16 signal pins from the printer port.  Or for tha     16 signal pins from the printer port.  Or for that matter, you can use
 17 similar cables to talk to many AVR boards, eve     17 similar cables to talk to many AVR boards, even a breadboard.
 18                                                    18 
 19 This is more powerful than "ISP programming" c     19 This is more powerful than "ISP programming" cables since it lets kernel
 20 SPI protocol drivers interact with the AVR, an     20 SPI protocol drivers interact with the AVR, and could even let the AVR
 21 issue interrupts to them.  Later, your protoco     21 issue interrupts to them.  Later, your protocol driver should work
 22 easily with a "real SPI controller", instead o     22 easily with a "real SPI controller", instead of this bitbanger.
 23                                                    23 
 24                                                    24 
 25 The first cable connections will hook Linux up     25 The first cable connections will hook Linux up to one SPI bus, with the
 26 AVR and a DataFlash chip; and to the AVR reset     26 AVR and a DataFlash chip; and to the AVR reset line.  This is all you
 27 need to reflash the firmware, and the pins are     27 need to reflash the firmware, and the pins are the standard Atmel "ISP"
 28 connector pins (used also on non-Butterfly AVR     28 connector pins (used also on non-Butterfly AVR boards).  On the parport
 29 side this is like "sp12" programming cables.       29 side this is like "sp12" programming cables.
 30                                                    30 
 31         ======    =============   ============     31         ======    =============   ===================
 32         Signal    Butterfly       Parport (DB-     32         Signal    Butterfly       Parport (DB-25)
 33         ======    =============   ============     33         ======    =============   ===================
 34         SCK       J403.PB1/SCK    pin 2/D0         34         SCK       J403.PB1/SCK    pin 2/D0
 35         RESET     J403.nRST       pin 3/D1         35         RESET     J403.nRST       pin 3/D1
 36         VCC       J403.VCC_EXT    pin 8/D6         36         VCC       J403.VCC_EXT    pin 8/D6
 37         MOSI      J403.PB2/MOSI   pin 9/D7         37         MOSI      J403.PB2/MOSI   pin 9/D7
 38         MISO      J403.PB3/MISO   pin 11/S7,nB     38         MISO      J403.PB3/MISO   pin 11/S7,nBUSY
 39         GND       J403.GND        pin 23/GND       39         GND       J403.GND        pin 23/GND
 40         ======    =============   ============     40         ======    =============   ===================
 41                                                    41 
 42 Then to let Linux master that bus to talk to t     42 Then to let Linux master that bus to talk to the DataFlash chip, you must
 43 (a) flash new firmware that disables SPI (set      43 (a) flash new firmware that disables SPI (set PRR.2, and disable pullups
 44 by clearing PORTB.[0-3]); (b) configure the mt     44 by clearing PORTB.[0-3]); (b) configure the mtd_dataflash driver; and
 45 (c) cable in the chipselect.                       45 (c) cable in the chipselect.
 46                                                    46 
 47         ======    ============    ============     47         ======    ============    ===================
 48         Signal    Butterfly       Parport (DB-     48         Signal    Butterfly       Parport (DB-25)
 49         ======    ============    ============     49         ======    ============    ===================
 50         VCC       J400.VCC_EXT    pin 7/D5         50         VCC       J400.VCC_EXT    pin 7/D5
 51         SELECT    J400.PB0/nSS    pin 17/C3,nS     51         SELECT    J400.PB0/nSS    pin 17/C3,nSELECT
 52         GND       J400.GND        pin 24/GND       52         GND       J400.GND        pin 24/GND
 53         ======    ============    ============     53         ======    ============    ===================
 54                                                    54 
 55 Or you could flash firmware making the AVR int     55 Or you could flash firmware making the AVR into an SPI slave (keeping the
 56 DataFlash in reset) and tweak the spi_butterfl     56 DataFlash in reset) and tweak the spi_butterfly driver to make it bind to
 57 the driver for your custom SPI-based protocol.     57 the driver for your custom SPI-based protocol.
 58                                                    58 
 59 The "USI" controller, using J405, can also be      59 The "USI" controller, using J405, can also be used for a second SPI bus.
 60 That would let you talk to the AVR using custo     60 That would let you talk to the AVR using custom SPI-with-USI firmware,
 61 while letting either Linux or the AVR use the      61 while letting either Linux or the AVR use the DataFlash.  There are plenty
 62 of spare parport pins to wire this one up, suc     62 of spare parport pins to wire this one up, such as:
 63                                                    63 
 64         ======    =============   ============     64         ======    =============   ===================
 65         Signal    Butterfly       Parport (DB-     65         Signal    Butterfly       Parport (DB-25)
 66         ======    =============   ============     66         ======    =============   ===================
 67         SCK       J403.PE4/USCK   pin 5/D3         67         SCK       J403.PE4/USCK   pin 5/D3
 68         MOSI      J403.PE5/DI     pin 6/D4         68         MOSI      J403.PE5/DI     pin 6/D4
 69         MISO      J403.PE6/DO     pin 12/S5,nP     69         MISO      J403.PE6/DO     pin 12/S5,nPAPEROUT
 70         GND       J403.GND        pin 22/GND       70         GND       J403.GND        pin 22/GND
 71                                                    71 
 72         IRQ       J402.PF4        pin 10/S6,AC     72         IRQ       J402.PF4        pin 10/S6,ACK
 73         GND       J402.GND(P2)    pin 25/GND       73         GND       J402.GND(P2)    pin 25/GND
 74         ======    =============   ============     74         ======    =============   ===================
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php