요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
===================================================
spi_butterfly - parport-to-butterfly adapter driver
===================================================
This is a hardware and software project that includes building and using
a parallel port adapter cable, together with an "AVR Butterfly" to run
firmware for user interfacing and/or sensors. A Butterfly is a $US20
battery powered card with an AVR microcontroller and lots of goodies:
sensors, LCD, flash, toggle stick, and more. You can use AVR-GCC to
develop firmware for this, and flash it using this adapter cable.
You can make this adapter from an old printer cable and solder things
directly to the Butterfly. Or (if you have the parts and skills) you
can come up with something fancier, providing circuit protection to the
Butterfly and the printer port, or with a better power supply than two
signal pins from the printer port. Or for that matter, you can use
similar cables to talk to many AVR boards, even a breadboard.
This is more powerful than "ISP programming" cables since it lets kernel
SPI protocol drivers interact with the AVR, and could even let the AVR
issue interrupts to them. Later, your protocol driver should work
easily with a "real SPI controller", instead of this bitbanger.
The first cable connections will hook Linux up to one SPI bus, with the
AVR and a DataFlash chip; and to the AVR reset line. This is all you
need to reflash the firmware, and the pins are the standard Atmel "ISP"
connector pins (used also on non-Butterfly AVR boards). On the parport
side this is like "sp12" programming cables.
====== ============= ===================
Signal Butterfly Parport (DB-25)
====== ============= ===================
SCK J403.PB1/SCK pin 2/D0
RESET J403.nRST pin 3/D1
VCC J403.VCC_EXT pin 8/D6
MOSI J403.PB2/MOSI pin 9/D7
MISO J403.PB3/MISO pin 11/S7,nBUSY
GND J403.GND pin 23/GND
====== ============= ===================
Then to let Linux master that bus to talk to the DataFlash chip, you must
(a) flash new firmware that disables SPI (set PRR.2, and disable pullups
by clearing PORTB.[0-3]); (b) configure the mtd_dataflash driver; and
(c) cable in the chipselect.
====== ============ ===================
Signal Butterfly Parport (DB-25)
====== ============ ===================
VCC J400.VCC_EXT pin 7/D5
SELECT J400.PB0/nSS pin 17/C3,nSELECT
GND J400.GND pin 24/GND
====== ============ ===================
Or you could flash firmware making the AVR into an SPI slave (keeping the
DataFlash in reset) and tweak the spi_butterfly driver to make it bind to
the driver for your custom SPI-based protocol.
The "USI" controller, using J405, can also be used for a second SPI bus.
That would let you talk to the AVR using custom SPI-with-USI firmware,
while letting either Linux or the AVR use the DataFlash. There are plenty
of spare parport pins to wire this one up, such as:
====== ============= ===================
Signal Butterfly Parport (DB-25)
====== ============= ===================
SCK J403.PE4/USCK pin 5/D3
MOSI J403.PE5/DI pin 6/D4
MISO J403.PE6/DO pin 12/S5,nPAPEROUT
GND J403.GND pin 22/GND
IRQ J402.PF4 pin 10/S6,ACK
GND J402.GND(P2) pin 25/GND
====== ============= ===================
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
프로젝트와 활용 범위
1-20`spi_butterfly`는 병렬 포트 어댑터 케이블을 제작해 AVR Butterfly와 함께 사용하는 하드웨어·소프트웨어 프로젝트다. Butterfly는 AVR microcontroller, 센서, LCD, flash, toggle stick 등을 갖춘 약 20달러짜리 배터리 구동 카드다. AVR-GCC로 firmware를 개발하고 이 어댑터 케이블로 flash할 수 있다.
오래된 printer cable을 Butterfly에 직접 납땜해 어댑터를 만들 수 있다. 부품과 기술이 있다면 Butterfly와 printer port 보호 회로를 넣거나, printer port signal pin 두 개보다 나은 전원 공급 장치를 갖춘 형태로 만들 수도 있다. 비슷한 케이블은 breadboard를 포함한 여러 AVR board와 통신하는 데도 사용할 수 있다.
이 방식은 단순한 ISP programming cable보다 강력하다. 커널 SPI protocol driver가 AVR과 상호작용할 수 있고 AVR이 interrupt를 발생시키게 할 수도 있다. 이후 protocol driver는 이 bitbanger 대신 실제 SPI controller에서도 쉽게 동작해야 한다.
프로젝트를 이루는 하드웨어와 소프트웨어 요소다.
같은 protocol driver를 bitbang 환경에서 검증한 뒤 실제 SPI controller로 옮길 수 있다.
===================================================
spi_butterfly - parport-to-butterfly adapter driver
===================================================
This is a hardware and software project that includes building and using
a parallel port adapter cable, together with an "AVR Butterfly" to run
firmware for user interfacing and/or sensors. A Butterfly is a $US20
battery powered card with an AVR microcontroller and lots of goodies:
sensors, LCD, flash, toggle stick, and more. You can use AVR-GCC to
develop firmware for this, and flash it using this adapter cable.
You can make this adapter from an old printer cable and solder things
directly to the Butterfly. Or (if you have the parts and skills) you
can come up with something fancier, providing circuit protection to the
Butterfly and the printer port, or with a better power supply than two
signal pins from the printer port. Or for that matter, you can use
similar cables to talk to many AVR boards, even a breadboard.
This is more powerful than "ISP programming" cables since it lets kernel
SPI protocol drivers interact with the AVR, and could even let the AVR
첫 번째 SPI 버스와 DataFlash chip select
21-50첫 케이블 연결은 Linux를 AVR과 DataFlash chip이 있는 SPI bus 및 AVR reset line에 연결한다. firmware를 다시 flash하는 데 필요한 전부이며, 핀은 Butterfly가 아닌 AVR board에서도 쓰이는 표준 Atmel ISP connector pin이다. 병렬 포트 쪽 구성은 `sp12` programming cable과 비슷하다.
Butterfly J403과 DB-25 병렬 포트 사이의 원문 핀 대응이다.
Linux가 이 bus의 master가 되어 DataFlash chip과 통신하려면 세 단계가 필요하다. 첫째, SPI를 비활성화하도록 PRR.2를 설정하고 `PORTB.[0-3]`을 지워 pullup을 끈 새 firmware를 flash한다. 둘째, `mtd_dataflash` driver를 설정한다. 셋째, chip select를 케이블로 연결한다.
J400과 DB-25 사이에 추가하는 세 신호다.
firmware와 kernel driver, chip select 배선을 모두 준비한다.
issue interrupts to them. Later, your protocol driver should work
easily with a "real SPI controller", instead of this bitbanger.
The first cable connections will hook Linux up to one SPI bus, with the
AVR and a DataFlash chip; and to the AVR reset line. This is all you
need to reflash the firmware, and the pins are the standard Atmel "ISP"
connector pins (used also on non-Butterfly AVR boards). On the parport
side this is like "sp12" programming cables.
====== ============= ===================
Signal Butterfly Parport (DB-25)
====== ============= ===================
SCK J403.PB1/SCK pin 2/D0
RESET J403.nRST pin 3/D1
VCC J403.VCC_EXT pin 8/D6
MOSI J403.PB2/MOSI pin 9/D7
MISO J403.PB3/MISO pin 11/S7,nBUSY
GND J403.GND pin 23/GND
====== ============= ===================
Then to let Linux master that bus to talk to the DataFlash chip, you must
(a) flash new firmware that disables SPI (set PRR.2, and disable pullups
by clearing PORTB.[0-3]); (b) configure the mtd_dataflash driver; and
(c) cable in the chipselect.
====== ============ ===================
Signal Butterfly Parport (DB-25)
====== ============ ===================
VCC J400.VCC_EXT pin 7/D5
AVR slave 또는 USI 두 번째 버스
51-74다른 방법으로 AVR을 SPI slave로 만드는 firmware를 flash하고 DataFlash는 reset 상태로 유지한 뒤, 사용자 정의 SPI protocol driver에 bind하도록 `spi_butterfly` driver를 조정할 수 있다.
J405를 사용하는 USI controller는 두 번째 SPI bus로도 사용할 수 있다. 그러면 사용자 정의 SPI-with-USI firmware로 AVR과 통신하면서 Linux 또는 AVR이 DataFlash를 사용할 수 있다. 남는 parport pin이 충분하므로 SCK, MOSI, MISO, GND와 IRQ를 별도로 배선할 수 있다.
원문이 제안하는 추가 DB-25 핀 연결이다.
기본 DataFlash bus와 USI 기반 사용자 정의 AVR 통신을 분리한다.
SELECT J400.PB0/nSS pin 17/C3,nSELECT
GND J400.GND pin 24/GND
====== ============ ===================
Or you could flash firmware making the AVR into an SPI slave (keeping the
DataFlash in reset) and tweak the spi_butterfly driver to make it bind to
the driver for your custom SPI-based protocol.
The "USI" controller, using J405, can also be used for a second SPI bus.
That would let you talk to the AVR using custom SPI-with-USI firmware,
while letting either Linux or the AVR use the DataFlash. There are plenty
of spare parport pins to wire this one up, such as:
====== ============= ===================
Signal Butterfly Parport (DB-25)
====== ============= ===================
SCK J403.PE4/USCK pin 5/D3
MOSI J403.PE5/DI pin 6/D4
MISO J403.PE6/DO pin 12/S5,nPAPEROUT
GND J403.GND pin 22/GND
IRQ J402.PF4 pin 10/S6,ACK
GND J402.GND(P2) pin 25/GND
====== ============= ===================
요약·해설
butterfly.rst:1-74AVR Butterfly를 병렬 포트 bitbang SPI controller로 연결하는 케이블, ISP·DataFlash·USI 두 번째 버스의 핀 배선과 firmware 설정을 설명합니다.