Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AVRISP-MKII.txt 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. /** \file
  2. *
  3. * This file contains special DoxyGen information for the generation of the main page and other special
  4. * documentation pages. It is not a project source file.
  5. */
  6. /** \mainpage AVRISP MKII Programmer Project
  7. *
  8. * \section Sec_Compat Project Compatibility
  9. *
  10. * The following list indicates what microcontrollers are compatible with this project.
  11. *
  12. * \li Series 7 USB AVRs (AT90USBxxx7)
  13. * \li Series 6 USB AVRs (AT90USBxxx6)
  14. * \li Series 4 USB AVRs (ATMEGAxxU4)
  15. * \li Series 2 USB AVRs (AT90USBxx2, ATMEGAxxU2) - <i>8KB versions with reduced features only</i>
  16. *
  17. * \section Sec_Info USB Information
  18. *
  19. * The following table gives a rundown of the USB utilization of this project.
  20. *
  21. * <table>
  22. * <tr>
  23. * <td><b>USB Mode:</b></td>
  24. * <td>Device</td>
  25. * </tr>
  26. * <tr>
  27. * <td><b>USB Class:</b></td>
  28. * <td>Vendor Specific Class</td>
  29. * </tr>
  30. * <tr>
  31. * <td><b>USB Subclass:</b></td>
  32. * <td>N/A</td>
  33. * </tr>
  34. * <tr>
  35. * <td><b>Relevant Standards:</b></td>
  36. * <td>Atmel AVRISP MKII Protocol Specification</td>
  37. * </tr>
  38. * <tr>
  39. * <td><b>Supported USB Speeds:</b></td>
  40. * <td>Full Speed Mode</td>
  41. * </tr>
  42. * </table>
  43. *
  44. * \section Sec_Description Project Description
  45. *
  46. * Firmware for an Atmel Studio/AVR Studio compatible AVRISP-MKII clone programmer. This project will enable the USB
  47. * AVR series of microcontrollers to act as a clone of the official Atmel AVRISP-MKII programmer, usable within
  48. * Atmel Studio/AVR Studio or with any software capable of driving a real Atmel AVRISP-MKII programmer. In its most
  49. * basic form, it allows for the programming of AVR TINY, MEGA and XMEGA devices aat the programmer's VCC voltage from
  50. * within Atmel Studio/AVR Studio with no special hardware other than the USB AVR and the parts needed for the USB
  51. * interface. If the user desires, more advanced circuits incorporating level conversion can be made to allow for the
  52. * programming of target AVRs running at a different voltage to the programmer.
  53. *
  54. * This device spoofs Atmel's official AVRISP-MKII device PID so that it remains compatible with Atmel's AVRISP-MKII
  55. * drivers. When prompted, direct your OS to install Atmel's AVRISP-MKII drivers provided with Atmel Studio/AVR Studio.
  56. *
  57. * Note that this design currently has the following limitations:
  58. * - No reversed/shorted target connector detection and notification
  59. * - A separate header is required for each of the ISP, PDI and TPI programming protocols that the user wishes to use
  60. *
  61. * On AVR models with an ADC converter, the USB AVR's AVCC pin should be tied to 5V (e.g. VBUS) and the
  62. * \c VTARGET_ADC_CHANNEL token should be set to an appropriate ADC channel number in the project makefile for VTARGET
  63. * detection to operate correctly. On models without an ADC converter, VTARGET will report a fixed 3.3V level at all times
  64. * which should allow the programmer to remain compatible at the protocol level with all AVR devices.
  65. *
  66. * While this application can be compiled for USB AVRs with as little as 8KB of FLASH, for full functionality 16KB or more
  67. * of FLASH is required. On 8KB devices, ISP or PDI/TPI protocol programming support can be disabled to reduce program size.
  68. *
  69. * \section Sec_KnownIssues Known Issues:
  70. *
  71. * \par Incompatible with newer AVRDUDE releases.
  72. * Due to <a href="http://savannah.nongnu.org/bugs/index.php?40831">a change in 6.0.1 and never AVRDUDE releases</a>,
  73. * these builds are incompatible with the AVRISP-MKII clone project. Use an older 5.x release until AVRDUDE is patched.
  74. *
  75. * \par XMEGA EEPROM programming fails in some cases.
  76. * Several users have reported that XMEGA EEPROM programming fails unless the chip is erased first. If a non-blank EEPROM
  77. * is present, writing further EEPROM data causes corruption.
  78. * <a href="https://github.com/abcminiuser/lufa/issues/25">LUFA issue tracker entry</a>.
  79. *
  80. * \section Sec_Installation Installation
  81. * The programmer supports multiple platforms, both Windows and Linux.
  82. *
  83. * \subsection SSec_LinuxInstallation Linux Installation
  84. * On Linux systems, the programmer should be usable out of the box with no special setup other than (on some systems)
  85. * editing of the system permissions to allow the programmer to be used from a non-elevated (root) context. The programmer
  86. * is compatible with the free open source AVRDude programming software project.
  87. *
  88. * \subsection SSec_WindowsInstallation Windows Installation
  89. * On Windows systems, due to an unfortunate limitation of the USB AVR devices and the driver used in the official AVR
  90. * Studio/Atmel Studio platform, the programmer cannot be made compatible with AVRDude and AVR Studio/Atmel Studio at the
  91. * same time. Instead, the programmer will be compatible with the official Atmel software by default, with a recompilation
  92. * with the \c LIBUSB_DRIVER_COMPAT token (see \ref Sec_Options) being required to use the alternative libUSB driver
  93. * compatibility mode that will allow the programmer to work under AVRDude on Windows.
  94. *
  95. * If compiled for Atmel Studio/AVR Studio compatibility, install the Jungo device drivers that ship with the Atmel software.
  96. * If compiled in the alternative libUSB compatibility mode for AVRDude use, install the libUSB drivers that are included
  97. * with your compiled copy of AVRDude, or create them using the libUSB-Win32 (http://sourceforge.net/projects/libusb-win32)
  98. * project.
  99. *
  100. * For convenience, the programmer will report two different serial numbers depending on the firmware compatibility mode, so
  101. * that the correct driver can be installed for the matching firmware. If the \c RESET_TOGGLES_LIBUSB_COMPAT compile option
  102. * is used (see \ref Sec_Options) this allows for an easy way to automatically switch device drivers along with the firmware
  103. * compatibility mode. The serials are:
  104. *
  105. * <table>
  106. * <tr>
  107. * <th><b>Serial Number:</b></th>
  108. * <th><b>Compatibility Mode:</b></th>
  109. * </tr>
  110. * <tr>
  111. * <td>000200012345</td>
  112. * <td>Jungo (Atmel Studio) Compatibility</td>
  113. * </tr>
  114. * <tr>
  115. * <td>000200112345</td>
  116. * <td>libUSB Compatibility</td>
  117. * </tr>
  118. * </table>
  119. *
  120. * \section Sec_ISP ISP Connections
  121. * Connections to the device for SPI programming (when enabled):
  122. *
  123. * <table>
  124. * <tr>
  125. * <th><b>Programmer Pin:</b></th>
  126. * <th><b>Target Device Pin:</b></th>
  127. * <th><b>ISP 6 Pin Layout:</b></th>
  128. * </tr>
  129. * <tr>
  130. * <td>MISO</td>
  131. * <td>PDO</td>
  132. * <td>1</td>
  133. * </tr>
  134. * <tr>
  135. * <td>ADCx <b><sup>1</sup></b></td>
  136. * <td>VTARGET</td>
  137. * <td>2</td>
  138. * </tr>
  139. * <tr>
  140. * <td>SCLK</td>
  141. * <td>SCLK</td>
  142. * <td>3</td>
  143. * </tr>
  144. * <tr>
  145. * <td>MOSI</td>
  146. * <td>PDI</td>
  147. * <td>4</td>
  148. * </tr>
  149. * <tr>
  150. * <td>PORTx.y <b><sup>2</sup></b></td>
  151. * <td>/RESET</td>
  152. * <td>5</td>
  153. * </tr>
  154. * <tr>
  155. * <td>GND</td>
  156. * <td>GND</td>
  157. * <td>6</td>
  158. * </tr>
  159. * </table>
  160. *
  161. * In addition, the AVR's OCR1A pin will generate a 4MHz clock, to act as an external rescue device clock if the
  162. * fuses have been mis-set. To use the recovery clock, connect the OCR1A pin of the USB AVR to the target AVR's
  163. * XTAL1 pin, and set the ISP programming speed to 125KHz (note: other ISP speeds will not work correctly).
  164. *
  165. * <b><sup>1</sup></b> <i>Optional, see \ref Sec_Options section - for USB AVRs with ADC modules only</i> \n
  166. * <b><sup>2</sup></b> <i>See AUX line related tokens in the \ref Sec_Options section</i>
  167. *
  168. * \section Sec_PDI PDI Connections
  169. * Connections to the device for PDI programming (when enabled):
  170. *
  171. * <table>
  172. * <tr>
  173. * <th><b>Programmer Pin:</b></th>
  174. * <th><b>Target Device Pin:</b></th>
  175. * <th><b>PDI 6 Pin Layout:</b></th>
  176. * </tr>
  177. * <tr>
  178. * <td>Tx/Rx <b><sup>2</sup></b></td>
  179. * <td>DATA</td>
  180. * <td>1</td>
  181. * </tr>
  182. * <tr>
  183. * <td>ADCx <b><sup>1</sup></b></td>
  184. * <td>VTARGET</td>
  185. * <td>2</td>
  186. * </tr>
  187. * <tr>
  188. * <td>N/A</td>
  189. * <td>N/A</td>
  190. * <td>3</td>
  191. * </tr>
  192. * <tr>
  193. * <td>N/A</td>
  194. * <td>N/A</td>
  195. * <td>4</td>
  196. * </tr>
  197. * <tr>
  198. * <td>XCK</td>
  199. * <td>CLOCK</td>
  200. * <td>5</td>
  201. * </tr>
  202. * <tr>
  203. * <td>GND</td>
  204. * <td>GND</td>
  205. * <td>6</td>
  206. * </tr>
  207. * </table>
  208. *
  209. * <b><sup>1</sup></b> <i>Optional, see \ref Sec_Options section - for USB AVRs with ADC modules only</i> \n
  210. * <b><sup>2</sup></b> <i>The AVR's Tx and Rx become the DATA line when connected together via a pair of 220 ohm resistors</i> \n
  211. *
  212. * \section Sec_TPI TPI Connections
  213. * Connections to the device for TPI programming (when enabled):
  214. *
  215. * <table>
  216. * <tr>
  217. * <th><b>Programmer Pin:</b></th>
  218. * <th><b>Target Device Pin:</b></th>
  219. * <th><b>TPI 6 Pin Layout:</b></th>
  220. * </tr>
  221. * <tr>
  222. * <td>Tx/Rx <b><sup>2</sup></b></td>
  223. * <td>DATA</td>
  224. * <td>1</td>
  225. * </tr>
  226. * <tr>
  227. * <td>ADCx <b><sup>1</sup></b></td>
  228. * <td>VTARGET</td>
  229. * <td>2</td>
  230. * </tr>
  231. * <tr>
  232. * <td>XCK <b><sup>2</sup></b></td>
  233. * <td>CLOCK</td>
  234. * <td>3</td>
  235. * </tr>
  236. * <tr>
  237. * <td>N/A</td>
  238. * <td>N/A</td>
  239. * <td>4</td>
  240. * </tr>
  241. * <tr>
  242. * <td>PORTx.y <b><sup>3</sup></b></td>
  243. * <td>/RESET</td>
  244. * <td>5</td>
  245. * </tr>
  246. * <tr>
  247. * <td>GND</td>
  248. * <td>GND</td>
  249. * <td>6</td>
  250. * </tr>
  251. * </table>
  252. *
  253. * <b><sup>1</sup></b> <i>Optional, see \ref Sec_Options section - for USB AVRs with ADC modules only</i> \n
  254. * <b><sup>2</sup></b> <i>The AVR's Tx and Rx become the DATA line when connected together via a pair of 220 ohm resistors</i> \n
  255. * <b><sup>3</sup></b> <i>See AUX line related tokens in the \ref Sec_Options section</i>
  256. *
  257. * \section Sec_Options Project Options
  258. *
  259. * The following defines can be found in this project, which can control the project behaviour when defined, or changed in value.
  260. *
  261. * <table>
  262. * <tr>
  263. * <th><b>Define Name:</b></th>
  264. * <th><b>Location:</b></th>
  265. * <th><b>Description:</b></th>
  266. * </tr>
  267. * <tr>
  268. * <td>AUX_LINE_PORT</td>
  269. * <td>AppConfig.h</td>
  270. * <td>PORT register for the programmer's AUX target line. The use of this line varies between the programming protocols,
  271. * but is generally used for the target's /RESET line.
  272. * \n \n <i>Ignored when compiled for the XPLAIN board.</i></td>
  273. * </tr>
  274. * <tr>
  275. * <td>AUX_LINE_PIN</td>
  276. * <td>AppConfig.h</td>
  277. * <td>PIN register for the programmer's AUX target line. The use of this line varies between the programming protocols,
  278. * but is generally used for the target's /RESET line.
  279. * \n \n <i>Ignored when compiled for the XPLAIN board.</i></td>
  280. * </tr>
  281. * <tr>
  282. * <td>AUX_LINE_DDR</td>
  283. * <td>AppConfig.h</td>
  284. * <td>DDR register for the programmer's AUX target line. The use of this line varies between the programming protocols,
  285. * but is generally used for the target's /RESET line.
  286. * \n \n <i>Ignored when compiled for the XPLAIN board.</i></td>
  287. * </tr>
  288. * <tr>
  289. * <td>AUX_LINE_MASK</td>
  290. * <td>AppConfig.h</td>
  291. * <td>Mask for the programmer's AUX target line. The use of this line varies between the programming protocols,
  292. * but is generally used for the target's /RESET line. <b>Must not be the AVR's /SS pin</b>.
  293. * \n \n <i>Ignored when compiled for the XPLAIN board.</i></td>
  294. * </tr>
  295. * <tr>
  296. * <td>VTARGET_ADC_CHANNEL</td>
  297. * <td>AppConfig.h</td>
  298. * <td>ADC channel number (on supported AVRs) to use for VTARGET level detection, if NO_VTARGET_DETECT is not defined.
  299. * \n \n <i>Ignored when compiled for targets lacking an ADC.</i></td>
  300. * </tr>
  301. * <tr>
  302. * <td>ENABLE_ISP_PROTOCOL</td>
  303. * <td>AppConfig.h</td>
  304. * <td>Define to enable SPI programming protocol support.
  305. * \n \n <i>Ignored when compiled for the XPLAIN board.</i></td>
  306. * </tr>
  307. * <tr>
  308. * <td>ENABLE_XPROG_PROTOCOL</td>
  309. * <td>AppConfig.h</td>
  310. * <td>Define to enable PDI and TPI programming protocol support.
  311. * \n \n <i>Ignored when compiled for the XPLAIN board.</i></td>
  312. * </tr>
  313. * <tr>
  314. * <td>NO_VTARGET_DETECT</td>
  315. * <td>AppConfig.h</td>
  316. * <td>Define to disable VTARGET sampling and reporting on AVR models with an ADC converter. This will cause the programmer
  317. * to report a fixed 3.3V target voltage to the host regardless of the real target voltage.
  318. * \n \n <i>Ignored when compiled for targets lacking an ADC.</i></td>
  319. * </tr>
  320. * <tr>
  321. * <td>VTARGET_REF_VOLTS</td>
  322. * <td>AppConfig.h</td>
  323. * <td>Indicates the programmer AVR's AVCC reference voltage when measuring the target's supply voltage. Note that the supply
  324. * voltage should never exceed the reference voltage on the programmer AVR without some form of protection to prevent damage
  325. * to the ADC.
  326. * \n \n <i>Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined.</i></td>
  327. * </tr>
  328. * <tr>
  329. * <td>VTARGET_USE_INTERNAL_REF</td>
  330. * <td>AppConfig.h</td>
  331. * <td>Selects the internal 2.56V ADC reference voltage, instead of using the AVR's VREF pin. When enabled, this option will
  332. * override the VTARGET_REF_VOLTS configuration option.
  333. * \n \n <i>Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined.</i></td>
  334. * </tr>
  335. * <tr>
  336. * <td>VTARGET_SCALE_FACTOR</td>
  337. * <td>AppConfig.h</td>
  338. * <td>Indicates the target's supply voltage scale factor when applied to the ADC. A simple resistive divider can be used on the
  339. * ADC pin for measuring the target's supply voltage, so that voltages above the programmer AVR's AVCC reference voltage can be
  340. * measured. This should be the reciprocal of the division performed - e.g. if the VTARGET voltage is halved, this should be set
  341. * to 2.
  342. * \n \n <i>Ignored when compiled for targets lacking an ADC, or when NO_VTARGET_DETECT is defined.</i></td>
  343. * </tr>
  344. * <tr>
  345. * <td>LIBUSB_DRIVER_COMPAT</td>
  346. * <td>AppConfig.h</td>
  347. * <td>Define to switch to a non-standard endpoint scheme, breaking compatibility with Atmel Studio/AVR Studio under Windows but
  348. * making the code compatible with software such as avrdude (all platforms) that use the libUSB driver.
  349. *
  350. * \note This option is incompatible with \c RESET_TOGGLES_LIBUSB_COMPAT.</td>
  351. * </tr>
  352. * <tr>
  353. * <td>RESET_TOGGLES_LIBUSB_COMPAT</td>
  354. * <td>AppConfig.h</td>
  355. * <td>Define to make the /RESET line of the AVR toggle between Jungo and libUSB driver compatibility modes. Each time the AVR is
  356. * reset externally via the reset pin, the compatibility mode will be toggled. The compatibility mode is preserved between
  357. * power cycles and is not toggled via other forms of reset such as Watchdog or Brown Out.
  358. *
  359. * When this option is enabled, all board LEDs will flash twice on startup for Jungo compatibility mode, and five times for
  360. * libUSB compatibility mode.
  361. *
  362. * \note This option is incompatible with \c LIBUSB_DRIVER_COMPAT.</td>
  363. * </tr>
  364. * <tr>
  365. * <td>XCK_RESCUE_CLOCK_ENABLE</td>
  366. * <td>AppConfig.h</td>
  367. * <td>Define to move the ISP rescue clock to the AVR's XCK pin instead of the OCR1A output pin. This is useful for existing programming
  368. * hardware that does not expose the OCR1A pin of the AVR, but <i>may</i> cause some issues with PDI programming mode.</td>
  369. * </tr>
  370. * <tr>
  371. * <td>INVERTED_ISP_MISO</td>
  372. * <td>AppConfig.h</td>
  373. * <td>Define to invert the received data on the ISP MISO line. This is sometimes needed depending on the level translation hardware used,
  374. * if the translator hardware inverts the received logic level.</td>
  375. * </tr>
  376. * <tr>
  377. * <td>FIRMWARE_VERSION_MINOR</td>
  378. * <td>AppConfig.h</td>
  379. * <td>Define to set the minor firmware revision nunber reported to the host on request. By default this will use a firmware version compatible
  380. * with the latest Atmel IDE version, however if desired the reported minor value can be adjusted here.</td>
  381. * </tr>
  382. * </table>
  383. */