Skip to content
Snippets Groups Projects
Commit f1baf12f authored by Dean Camera's avatar Dean Camera
Browse files

Auto-configure AVRISP programmer configuration when built for the XPLAIN board...

Auto-configure AVRISP programmer configuration when built for the XPLAIN board to match the XPLAIN hardware connections.
parent a5adbae6
No related branches found
No related tags found
No related merge requests found
...@@ -61,7 +61,11 @@ ...@@ -61,7 +61,11 @@
* set to an appropriate ADC channel number in the project makefile for VTARGET detection to operate correctly. On models * set to an appropriate ADC channel number in the project makefile for VTARGET detection to operate correctly. On models
* without an ADC converter, VTARGET will report at a fixed 5V level. * without an ADC converter, VTARGET will report at a fixed 5V level.
* *
* Connections to the device are simple for SPI programming: * When compiled for the XPLAIN board target, this will automatically configure itself for the correct connections to the
* XPLAIN's XMEGA AVR, and will enable only PDI programming support.
*
*
* Connections to the device for SPI programming (when enabled):
* *
* <table> * <table>
* <tr> * <tr>
...@@ -105,7 +109,7 @@ ...@@ -105,7 +109,7 @@
* <b><sup>2</sup></b> <i>See \ref SSec_Options section</i> * <b><sup>2</sup></b> <i>See \ref SSec_Options section</i>
* *
* *
* Connections to the device are simple for SPI programming: * Connections to the device for PDI programming (when enabled):
* *
* <table> * <table>
* <tr> * <tr>
...@@ -158,19 +162,20 @@ ...@@ -158,19 +162,20 @@
* <tr> * <tr>
* <td>RESET_LINE_PORT</td> * <td>RESET_LINE_PORT</td>
* <td>Makefile CDEFS</td> * <td>Makefile CDEFS</td>
* <td>PORT register for the programmer's target RESET line.</td> * <td>PORT register for the programmer's target RESET line. <i>Ignored when compiled for the XPLAIN board.</i></td>
* </tr> * </tr>
* <tr> * <tr>
* <td>RESET_LINE_DDR</td> * <td>RESET_LINE_DDR</td>
* <td>Makefile CDEFS</td> * <td>Makefile CDEFS</td>
* <td>DDR register for the programmer's target RESET line.</td> * <td>DDR register for the programmer's target RESET line. <i>Ignored when compiled for the XPLAIN board.</i></td>
* </tr> * </tr>
* <tr> * <tr>
* <td>RESET_LINE_MASK</td> * <td>RESET_LINE_MASK</td>
* <td>Makefile CDEFS</td> * <td>Makefile CDEFS</td>
* <td>Mask for the programmer's target RESET line on the chosen port. <b>Must not be the AVR's /SS pin</b>, as the * <td>Mask for the programmer's target RESET line on the chosen port. <b>Must not be the AVR's /SS pin</b>, as the
* target pins are tri-stated when not in use, and low signals on the /SS pin will force SPI slave mode when the * target pins are tri-stated when not in use, and low signals on the /SS pin will force SPI slave mode when the
* pin is configured as an input. When in PDI programming mode, this is the target clock pin.</td> * pin is configured as an input. When in PDI programming mode, this is the target clock pin.
* <i>Ignored when compiled for the XPLAIN board.</i></td>
* </tr> * </tr>
* <tr> * <tr>
* <td>VTARGET_ADC_CHANNEL</td> * <td>VTARGET_ADC_CHANNEL</td>
...@@ -180,12 +185,12 @@ ...@@ -180,12 +185,12 @@
* <tr> * <tr>
* <td>ENABLE_SPI_PROTOCOL</td> * <td>ENABLE_SPI_PROTOCOL</td>
* <td>Makefile CDEFS</td> * <td>Makefile CDEFS</td>
* <td>Define to enable SPI programming protocol support.</td> * <td>Define to enable SPI programming protocol support. <i>Ignored when compiled for the XPLAIN board.</i></td>
* </tr> * </tr>
* <tr> * <tr>
* <td>ENABLE_XPROG_PROTOCOL</td> * <td>ENABLE_XPROG_PROTOCOL</td>
* <td>Makefile CDEFS</td> * <td>Makefile CDEFS</td>
* <td>Define to enable XMEGA PDI programming protocol support.</td> * <td>Define to enable XMEGA PDI programming protocol support. <i>Ignored when compiled for the XPLAIN board.</i></td>
* </tr> * </tr>
* </table> * </table>
*/ */
...@@ -41,6 +41,12 @@ ...@@ -41,6 +41,12 @@
#include "V2Protocol.h" #include "V2Protocol.h"
/* Preprocessor Checks: */
#if BOARD == BOARD_XPLAIN
#undef ENABLE_SPI_PROTOCOL
#define ENABLE_PDI_PROTOCOL
#endif
/* Macros: */ /* Macros: */
/** Mask for the reading or writing of the high byte in a FLASH word when issuing a low-level programming command */ /** Mask for the reading or writing of the high byte in a FLASH word when issuing a low-level programming command */
#define READ_WRITE_HIGH_BYTE_MASK (1 << 3) #define READ_WRITE_HIGH_BYTE_MASK (1 << 3)
......
...@@ -47,6 +47,12 @@ ...@@ -47,6 +47,12 @@
#include "V2ProtocolConstants.h" #include "V2ProtocolConstants.h"
#include "V2ProtocolParams.h" #include "V2ProtocolParams.h"
/* Preprocessor Checks: */
#if BOARD == BOARD_XPLAIN
#undef ENABLE_SPI_PROTOCOL
#define ENABLE_PDI_PROTOCOL
#endif
/* Macros: */ /* Macros: */
/** Total number of allowable ISP programming speeds supported by the device */ /** Total number of allowable ISP programming speeds supported by the device */
#define TOTAL_ISP_PROGRAMMING_SPEEDS 7 #define TOTAL_ISP_PROGRAMMING_SPEEDS 7
......
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
#include "V2Protocol.h" #include "V2Protocol.h"
#include "PDITarget.h" #include "PDITarget.h"
/* Preprocessor Checks: */
#if BOARD == BOARD_XPLAIN
#undef ENABLE_SPI_PROTOCOL
#define ENABLE_PDI_PROTOCOL
#endif
/* Macros: */ /* Macros: */
#define XPRG_CMD_ENTER_PROGMODE 0x01 #define XPRG_CMD_ENTER_PROGMODE 0x01
#define XPRG_CMD_LEAVE_PROGMODE 0x02 #define XPRG_CMD_LEAVE_PROGMODE 0x02
......
...@@ -42,7 +42,23 @@ ...@@ -42,7 +42,23 @@
#include <LUFA/Common/Common.h> #include <LUFA/Common/Common.h>
/* Preprocessor Checks: */
#if BOARD == BOARD_XPLAIN
#undef ENABLE_SPI_PROTOCOL
#define ENABLE_PDI_PROTOCOL
#endif
/* Defines: */ /* Defines: */
#if BOARD == BOARD_XPLAIN
#define PDIDATA_LINE_PORT PORTD
#define PDIDATA_LINE_DDR DDRD
#define PDIDATA_LINE_PIN PIND
#define PDIDATA_LINE_MASK (1 << 2)
#define PDICLOCK_LINE_PORT PORTD
#define PDICLOCK_LINE_DDR DDRD
#define PDICLOCK_LINE_MASK (1 << 5)
#else
#define PDIDATA_LINE_PORT PORTB #define PDIDATA_LINE_PORT PORTB
#define PDIDATA_LINE_DDR DDRB #define PDIDATA_LINE_DDR DDRB
#define PDIDATA_LINE_PIN PINB #define PDIDATA_LINE_PIN PINB
...@@ -51,6 +67,7 @@ ...@@ -51,6 +67,7 @@
#define PDICLOCK_LINE_PORT RESET_LINE_PORT #define PDICLOCK_LINE_PORT RESET_LINE_PORT
#define PDICLOCK_LINE_DDR RESET_LINE_DDR #define PDICLOCK_LINE_DDR RESET_LINE_DDR
#define PDICLOCK_LINE_MASK RESET_LINE_MASK #define PDICLOCK_LINE_MASK RESET_LINE_MASK
#endif
#define PDI_CMD_LDS 0x00 #define PDI_CMD_LDS 0x00
#define PDI_CMD_LD 0x20 #define PDI_CMD_LD 0x20
......
...@@ -46,6 +46,12 @@ ...@@ -46,6 +46,12 @@
#include "ISPProtocol.h" #include "ISPProtocol.h"
#include "PDIProtocol.h" #include "PDIProtocol.h"
/* Preprocessor Checks: */
#if BOARD == BOARD_XPLAIN
#undef ENABLE_SPI_PROTOCOL
#define ENABLE_PDI_PROTOCOL
#endif
/* Macros: */ /* Macros: */
/** Programmer ID string, returned to the host during the CMD_SIGN_ON command processing */ /** Programmer ID string, returned to the host during the CMD_SIGN_ON command processing */
#define PROGRAMMER_ID "AVRISP_MK2" #define PROGRAMMER_ID "AVRISP_MK2"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment