summaryrefslogtreecommitdiff
path: root/digital/dev/doc/usage.txt
blob: 5a197600da1bbda81512189ba488d5ff10990ddf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
===============================
How to use the development card
===============================
:Author: djerem, ni


*This board is deprecated, see README file.*

Introduction
============

The development card is use to power, program and communicate with others
card. It has two working modes:

  program
    it is used to program the AVR on the card link to it;

  serial
    it is used to communicate with the AVR on the card link to it.


How to use it?
==============
Pre-requires
------------

You need to install:
 * avrdude (at least version 5.5);

 * usbprog.

Download a usbprog firmware, it will not be used, but is needed to switch
the development board mode: ``sudo usbprog download blinkdemo``.

Usage procedure
---------------

Voodoo power should not be used any more:

 #. power up the development card using the external power;

 #. power up your card using the power provided by the development card;

 #. plug the dev cable to the card you want to program.

 #. plug the USB cable to your computer. You should see ``atmel`` in the
    output of ``sudo lsusb``.

 #. use ``avrdude`` to program your card, with something like:
    ``avrdude -p m128 -c avrispv2 -P usb -U flash:w:your_program.hex``.

 #. launch ``usbprog`` to put the development card in serial mode:
    ``sudo usbprog device 0 upload blinkdemo devices``. It should failed with
    something like *Unable to find update device (2).* but that's normal. You
    should see in the kernel message something like:
    *cdc_acm 2-2:1.0: ttyACM0: USB ACM device*.

 #. launch ``minicom`` in */dev/ttyACM0 8N1* mode.

 #. to return to program mode, first free the usb port with:
    ``modprobe -r cdc_acm``, then put the development card in program mode:
    ``sudo usbprog device 0 upload blinkdemo devices``, the card is ready to
    be used for programming.

AVR with low frequency clock
----------------------------

Most AVR come with a low system clock, you might need to lower the programming
clock using the options ``-B``: ``avrdude -p m128 -c avrispv2 -P usb -t``.

Firmware update mode
====================

Firmware update mode can be selected:

 - on the first board revision (dev) by shorting PA1 to 0 when booting.  You
   can use the JTAG_PRG1 to do this.  Warning, name position in PCB is
   misleading.

 - on the second board revision (dev-2) by shorting PA7 to 0 when booting.
   You can do this using the USER connector.

CPLD programming
================

Use Firmware update mode to upload the ``usbprog_apbteam_xsvf.bin`` firmware.
It has been tuned to work with our JTAG pin out.

You can afterward load a XSVF file using ``xsvfplayer`` from the USBProg
repository.  Warning: you will probably need super user privileges.