summaryrefslogtreecommitdiff
path: root/avr
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2016-01-24 23:53:41 +0100
committerFlorian Jung <flo@windfisch.org>2016-01-24 23:53:41 +0100
commit9da14c98908a0518419f7978e2488311259702db (patch)
treed2abe5c4e1014a0fb48eed40ea9e6840c1e8ec81 /avr
parented35d40a612633c3545a6cd7e59e3e432c623dfc (diff)
comment
Diffstat (limited to 'avr')
-rw-r--r--avr/main.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/avr/main.c b/avr/main.c
index f79853e..11c0e03 100644
--- a/avr/main.c
+++ b/avr/main.c
@@ -22,6 +22,54 @@
(Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH)
*/
+
+/* this project is designed for the USB AVR LAB board by ullihome
+ * (http://www.ullihome.de/wiki/USBAVRLab/index)
+ * That's a small Atmega8-powered board with software-USB and a small pinout
+ * that looks like this:
+ * ____ ____ ____ ____
+ * | . . . . . | | o . . . . |
+ * | . . . . . | or | x . . . . |
+ * |___________| |___________|
+ *
+ * hold the DS1992 token against the pins, so that the outer ring touches the
+ * "x" pin, while the inner circle touches the "o" pin.
+ *
+ * How to use:
+ * the dumping device has three modes of operation, which are shown by the blinking
+ * speed of the blue LED.
+ * 1. reading mode: normal blinking
+ * 2. reading mode: slooow blinking (previous operation failed)
+ * 3. writing mode: fast blinking
+ *
+ * in either mode, the red LED flashes periodically. This means that the device
+ * probed for a DS1992, but couldn't find anything on the bus. If you hold you
+ * DS1992 against the pins, the flashing will turn green instead. This means that
+ * the token has been read into the device's RAM.
+ * You can now use `pc/a.out read` to read the contents.
+ * (If both green and red leds flash, this means you've a short circuit.)
+ *
+ * If you execute `pc/a.out write <page> <data>`, then the device will enter
+ * writing mode. The flashing red LED has the same meaning as before. If you now
+ * connect the token, the page <page> (1-indexed) will be written to with <data>,
+ * whenever the LED flashes green the next time.
+ * After that, the device enters reading mode again. If the LED blinks really slow,
+ * then there was a write error. re-execute a.out write, reconnect the token and retry.
+ * Additionally, after writing you can use `a.out read` again (without connecting the
+ * token for reading previously). This will output you a lot of garbage, but the first
+ * byte read tells you a more detailed error code:
+ * 0x01: "reset/presence pulse" failed after scratchpad write
+ * 0x02: scratchpad did not verify correctly
+ * 0x03: "reset/presence pulse" failed after scratchpad readback + verify
+ * 0xFF: probably successful
+ *
+ * Note that you should read back the data after writing, just to be sure.
+ * Also note that while you can read the whole memory at once, you must execute the write
+ * command, and also connect the token, four times for a full write (once for each page).
+ */
+
+
+
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>