dcwbrown / dwire-debug

Simple stand-alone debugger for AVR DebugWIRE chips connected directly to an FT232R/CH340/DigiSpark/LittleWire on Linux or Windows.
GNU General Public License v2.0
189 stars 32 forks source link

mixed use of avrdude and dwire-debug #32

Open deiKruve opened 6 years ago

deiKruve commented 6 years ago

I made up a cable to use avrdude or dwire-debug as required. here is the proof:

quitting dwire-debug:

0000: c01d rjmp 003c (+30) > qi

starting avrdude (the device must stay powered up):

$ ./avrdude -C ./avrdude.conf -pt441 -P/dev/ttyUSB0 -cjanser -t

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.67s

avrdude: Device signature = 0x1e9215 avrdude>

Here are the avrdude details for the programmer:

programmer id = "janser"; desc = "jan's ftdi serial bitbanger, reset=!txd sck=!rts mosi=!dtr miso=!cts"; type = "serbb"; connection_type = serial; reset = ~ 3; sck = ~ 7; mosi = ~ 4; miso = ~ 8; ;

NOTE: I run this straight out of an fd2232 chip without any rs232 buffers. if you use inverting buffers in the signal path you will have to change the polarity of the signals above also.

There is no great secret about the pdf I enclose. And the circuit might not even be 100% perfect yet. It is merely to show the programming header connections. The program header is standard ATMEL with the added pin 7 and the diode to the reset of the chip. So the TxD wire on pin 7 works as the reset in avrdude mode and as the command data wire in dwire-debug mode. Pin 5 (Reset) is effectively not used in avrdude mode, but has the RxD connected to it for dwire-debug mode.

PC - DB9 - Pins for RS232: programming header

long side short side programming header
GND 5 -- O 6
x O <- 9 RI
DTR 4 <- O 4
x O <- 8 CTS 1
TXD 3 <- O 7
x O -> 7 RTS 3
RXD 2 -> O 5
x O <- 6 DSR
DCD 1 -> O

pin2 of the header has 3v3 (not always used)

fuzz-thermostat.pdf

Enjoy, j.