From bb2e0fc1fbe21b2ef4128fa666922df63768acd4 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 1 Jul 2010 21:52:10 +0200 Subject: digital/dev2/doc: document dev2 usage, closes #132 --- digital/dev2/doc/dev2.txt | 31 +++++++++++++++++++++++++++++++ digital/dev2/doc/gpio.txt | 39 +++++++++++++++++++++++++++++++++++++++ digital/dev2/doc/isp.txt | 28 ++++++++++++++++++++++++++++ digital/dev2/doc/serial.txt | 13 +++++++++++++ 4 files changed, 111 insertions(+) create mode 100644 digital/dev2/doc/gpio.txt create mode 100644 digital/dev2/doc/isp.txt create mode 100644 digital/dev2/doc/serial.txt diff --git a/digital/dev2/doc/dev2.txt b/digital/dev2/doc/dev2.txt index 3ae9a0e2..0c3b7f28 100644 --- a/digital/dev2/doc/dev2.txt +++ b/digital/dev2/doc/dev2.txt @@ -13,6 +13,9 @@ serial ports, you should load the generic serial driver: Then look at kernel messages to locate the new serial devices (/dev/ttyUSBx). +If two functions are presents in the same firmware, two serial devices should +be detected. + Controlling the output ====================== @@ -24,9 +27,37 @@ You can also use it to deselect an output so that no current flows into it. It can also be used to control GPIO when available in the loaded firmware. +To select an output: + + dev2ctl.py -s *1 to 4* + +To make all output unconnected: + + dev2ctl.py -u + +Before powering off connected boards, you should deselect outputs so that it +is not powered by dev2 I/O pins. + About the vendor and product ID =============================== They come from LUFA, the USB library we use for dev2. This is not supposed to be done in a commercial USB product, but this is OK for hobbyists. That's why dev2ctl parses the product name to make sure it talks to the right device. + +Changing firmware +================= + +The dev2 firmware can be updated using the USB bootloader. First of all, +switch the board in DFU mode: + + dev2ctl.py --dfu + +Then you can use a DFU programmer to update the firmware. For example: + + dfu-programmer at90usb162 erase + dfu-programmer at90usb162 flash dev2_gpio.hex + +Then the uploaded firmware can be started and used directly: + + dfu-programmer at90usb162 start diff --git a/digital/dev2/doc/gpio.txt b/digital/dev2/doc/gpio.txt new file mode 100644 index 00000000..1a8b478f --- /dev/null +++ b/digital/dev2/doc/gpio.txt @@ -0,0 +1,39 @@ +========================================== + dev2 gpio - General Purpose Input Output +========================================== + +The gpio module provides eight I/O to be controlled by the host. + +Do not forget to select an output using the control script! + +Controlling ouput +================= + +Use the control script to set outputs and directions. + + dev2ctl.py --gpio *DDR* *PORT* + +DDR and PORT have the same meaning as the corresponding AVR registers. Each +parameter is an eight bit value, with each bit corresponding to one I/O port. + + - if DDR bit is 0, corresponding port is an input, use PORT to activate a + pull-up, + - if DDR bit is 1, corresponding port is an output, use PORT to select the + output value. + +For example: + + dev2ctl.py --gpio 0xc 0xa + + - ports 0, 4, 5, 6, 7 will be input with no pull-up, + - port 1 will be input with pull-up, + - port 2 will be output with value 0, + - port 3 will be output with value 1. + +Reading input +============= + +To read inputs, use a serial monitor (minicom, picocom, gtkterm, screen, +socat...). For each character sent to the console, input port current state +will be echoed back. + diff --git a/digital/dev2/doc/isp.txt b/digital/dev2/doc/isp.txt new file mode 100644 index 00000000..87ec3391 --- /dev/null +++ b/digital/dev2/doc/isp.txt @@ -0,0 +1,28 @@ +==================== + dev2 isp - AVR ISP +==================== + +This isp module provides an STK500v2 compatible AVR programmer. It can be +combined with the serial module in the same firmware. + +Do not forget to select an output using the control script! + +Usage with avrdude +================== + +This programmer is recognised as a regular STK500v2 programmer on a serial +port. + +Example to access the terminal mode: + + avrdude -c stk500v2 -P /dev/ttyUSB1 -p atmega128 -t + +If the AVR frequency is too loo, you may have to lower the programmer +frequency to have reliable communications: + + avrdude -c stk500v2 -P /dev/ttyUSB1 -p atmega128 -B 100 -t + +To program a hex file: + + avrdude -c stk500v2 -P /dev/ttyUSB1 -p atmega128 -U flash:w:foobar.hex + diff --git a/digital/dev2/doc/serial.txt b/digital/dev2/doc/serial.txt new file mode 100644 index 00000000..5a4c8525 --- /dev/null +++ b/digital/dev2/doc/serial.txt @@ -0,0 +1,13 @@ +=========================== + dev2 serial - Serial port +=========================== + +This serial module provides a regular UART. + +Do not forget to select an output using the control script! + +Serial port parameters are fixed at compilation time, so there is no need to +setup your serial port monitor. + +There is nothing special apart from this. + -- cgit v1.2.3