aboutsummaryrefslogtreecommitdiffstats
path: root/usbdrv
diff options
context:
space:
mode:
authorChristian Starkjohann <cs+github@obdev.at>2009-03-23 11:10:07 +0000
committerChristian Starkjohann <cs+github@obdev.at>2009-03-23 11:10:07 +0000
commit544b28e2428903a354312f22657f91652db12c1c (patch)
tree17f0fa48db9d44cd787098d0c1ada2818495a445 /usbdrv
parent34b074d227e92f665095e49e7aab93345b0ee3ee (diff)
downloadv-usb-544b28e2428903a354312f22657f91652db12c1c.tar.gz
v-usb-544b28e2428903a354312f22657f91652db12c1c.tar.bz2
v-usb-544b28e2428903a354312f22657f91652db12c1c.zip
- documentation updates
Diffstat (limited to 'usbdrv')
-rw-r--r--usbdrv/Readme.txt15
-rw-r--r--usbdrv/usbconfig-prototype.h4
-rw-r--r--usbdrv/usbdrvasm18-crc.inc6
3 files changed, 18 insertions, 7 deletions
diff --git a/usbdrv/Readme.txt b/usbdrv/Readme.txt
index 7828f64..a7aad3e 100644
--- a/usbdrv/Readme.txt
+++ b/usbdrv/Readme.txt
@@ -48,8 +48,9 @@ The driver consists of the following files:
CPU CORE CLOCK FREQUENCY
========================
We supply assembler modules for clock frequencies of 12 MHz, 12.8 MHz, 15 MHz,
-16 MHz, 16.5 MHz and 20 MHz. Other clock rates are not supported. The actual
-clock rate must be configured in usbdrv.h unless you use the default 12 MHz.
+16 MHz, 16.5 MHz 18 MHz and 20 MHz. Other clock rates are not supported. The
+actual clock rate must be configured in usbdrv.h unless you use the default
+12 MHz.
12 MHz Clock
This is the traditional clock rate of AVR-USB because it's the lowest clock
@@ -80,6 +81,16 @@ all AVRs can reach 12.8 MHz, although this is outside the specified range.
See the EasyLogger example at http://www.obdev.at/avrusb/easylogger.html for
code which calibrates the RC oscillator based on the USB frame clock.
+18 MHz Clock
+This module is closer to the USB specification because it performs an on the
+fly CRC check for incoming packets. Packets with invalid checksum are
+discarded as required by the spec. If you also implement checks for data
+PID toggling on application level (see option USB_CFG_CHECK_DATA_TOGGLING
+in usbconfig.h for more info), this ensures data integrity. Due to the CRC
+tables and alignment requirements, this code is bigger than modules for other
+clock rates. To activate this module, you must define USB_CFG_CHECK_CRC to 1
+and USB_CFG_CLOCK_KHZ to 18000 in usbconfig.h.
+
20 MHz Clock
This module is for people who won't do it with less than the maximum. Since
20 MHz is not divisible by the USB low speed bit clock of 1.5 MHz, the code
diff --git a/usbdrv/usbconfig-prototype.h b/usbdrv/usbconfig-prototype.h
index 21b7ada..a759e81 100644
--- a/usbdrv/usbconfig-prototype.h
+++ b/usbdrv/usbconfig-prototype.h
@@ -51,8 +51,8 @@ section at the end of this file).
* Default if not specified: 12 MHz
*/
#define USB_CFG_CHECK_CRC 0
-/* Define this to 1 if you want that the driver checks data integrity of data
- * packets (CRC checks). CRC checks cost quite a bit of code size and are
+/* Define this to 1 if you want that the driver checks integrity of incoming
+ * data packets (CRC checks). CRC checks cost quite a bit of code size and are
* currently only available for 18 MHz crystal clock. You must choose
* USB_CFG_CLOCK_KHZ = 18000 if you enable this option.
*/
diff --git a/usbdrv/usbdrvasm18-crc.inc b/usbdrv/usbdrvasm18-crc.inc
index 18d9ea2..9c9bffd 100644
--- a/usbdrv/usbdrvasm18-crc.inc
+++ b/usbdrv/usbdrvasm18-crc.inc
@@ -49,8 +49,8 @@ of CPU cycles, but even an exact number of cycles!
; x4 is used as temp register to store different results
; the initialization of the crc register is not 0xFFFF but 0xFE54. This is because during the receipt of the
; first data byte an virtual zero data byte is added to the crc register, this results in the correct initial
-; value of 0xFFFF at beginning of the second data byte before the first data byte is added to the crc
-; the magic number 0xFE54 results form the crc table: At tabH[0x54] = 0xFF = crcH (required) and
+; value of 0xFFFF at beginning of the second data byte before the first data byte is added to the crc.
+; The magic number 0xFE54 results form the crc table: At tabH[0x54] = 0xFF = crcH (required) and
; tabL[0x54] = 0x01 -> crcL = 0x01 xor 0xFE = 0xFF
; bitcnt is renamed to x5 and is used for unstuffing purposes, the unstuffing works like in the 12MHz version
;--------------------------------------------------------------------------------------------------------------
@@ -199,7 +199,7 @@ haveTwoBitsK:
; receives the pid byte
; there is no real unstuffing algorithm implemented here as a stuffing bit is impossible in the pid byte.
; That's because the last four bits of the byte are the inverted of the first four bits. If we detect a
-; unstuffing condition something went wrong and we abort
+; unstuffing condition something went wrong and abort
; shift has to be initialized to 0x80
;--------------------------------------------------------------------------------------------------------------