1
0
Fork 0

Update README.

This commit is contained in:
flabbergast 2014-12-07 09:37:32 +00:00
parent 3ff0db2ee6
commit 0be233f89e
2 changed files with 18 additions and 12 deletions

View File

@ -5,9 +5,10 @@
Copy the `avr/SHA204` library to your Arduino IDE's `libraries` folder,
and copy the sketch `sha204_playground.ino` to your sketchbook.
Make the modifications to the library file
`SHA204/SHA204SWI_hardware_config.h` to match your hardware setup (i.e.
to which pin is your ATSHA204 connected to).
Choose Single-wire (SWI) or I2C (TWI) interface at the beginning of the
sketch. The SWI will probably need some extra modifications to the
library file `SHA204/SHA204SWI_hardware_config.h` to match your hardware
setup (i.e. to which pin is your ATSHA204 connected to).
Compile and upload the sketch to your Arduino using IDE. Open the IDE's
Serial Monitor to talk to the Arduino/ATSHA204.
@ -18,10 +19,10 @@ Note that I've tested on Arduino IDE version 1.0.5.
Arduino sets the size of the Serial buffer to 64. This seems to cause
problems when the data sent to firmware is longer than that (which it is
for instance with the `talk_to_sha204 check_mac` command). If things
work, but you get a weird error with this command, increase the size of
the Serial buffer. Unfortunately, this requires editing a file in the
Arduino directory:
for instance with the `talk_to_sha204 check_mac` or `talk_to_sha204 sha`
commands). If things work, but you get a weird error with this command,
increase the size of the Serial buffer. Unfortunately, this requires
editing a file in the Arduino directory:
`<ARDUINO_APP_DIR>/<MAYBE_SOME_MORE_DIRS/hardware/arduino/cores/arduino/HardwareSerial.cpp`,
change `#define SERIAL_BUFFER_SIZE 64` to `#define SERIAL_BUFFER_SIZE
100`.

View File

@ -8,9 +8,13 @@ with avr-gcc against the [LUFA] library.
Get the [LUFA] library and copy the `LUFA` folder to the subdirectory
`avr/LUFA`.
Make modifications to match your hardware setup (`makefile` and
`SHA204/SHA204SWI_hardware_config.h` are probably the most important
ones).
The SHA204 library supports both Single Wire interface and I2C interface
(on mega's hardware I2C=TWI pins). Just select the interface at the
beginning of `sha204_playground.cpp` file.
Modifications to match your hardware setup are done mostly in `makefile`
and `SHA204/SHA204SWI_hardware_config.h` or
`SHA204/SHA204TWI_hardware_config.h`.
Compile (`make`) and upload to your board with ATSHA204 (how to do this
depends on your bootloader).
@ -42,8 +46,9 @@ demonstration on how this is done, have a look at the python script
- The subdirectory `SHA204` contains a re-usable library, working on
both AVR8 and XMEGA architectures. Note that only 16MHz and 32MHz CPU
speeds are tested.
- At the moment, only Single-Wire Interface for ATSHA204 is implemented,
by bit-banging in C (so a speedy CPU is probably required).
- At the moment, the Single-Wire Interface for ATSHA204 is implemented
by bit-banging in C (so a speedy CPU is probably required). I2C
interface uses hardware TWI module in (x)megas.
- The firmware also enumerates as a Keyboard. This functionality is not
used at the moment; see `LufaLayer.h` for the functions that can
generate "keypresses".