yarf 0.1
Yet Another RepRap Firmware
src/boards.h
00001 /*
00002  * boards.h 
00003  *
00004  * Copyright 2011 Pieter Agten
00005  *
00006  * This file is part of Yarf.
00007  *
00008  * Yarf is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 3 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * Yarf is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with Yarf.  If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00022 /*
00023  * Author : Pieter Agten (pieter.agten@gmail.com)
00024  * Date : 3 sep 2011
00025  */
00026 
00027 #ifndef BOARDS_H
00028 #define BOARDS_H
00029 
00030 #include <avr/io.h>
00031 
00032 /****************************************************************************************
00033 * Yarb V1.0 motherboard 
00034 *
00035 *                ATMega644P or ATMega1284P
00036 *
00037 *                        +---\/---+
00038 *            (D 0) PB0  1|        |40  PA0 (AI 0 / D31)
00039 *            (D 1) PB1  2|        |39  PA1 (AI 1 / D30)
00040 *       INT2 (D 2) PB2  3|        |38  PA2 (AI 2 / D29)
00041 *        PWM (D 3) PB3  4|        |37  PA3 (AI 3 / D28)
00042 *        PWM (D 4) PB4  5|        |36  PA4 (AI 4 / D27)
00043 *       MOSI (D 5) PB5  6|        |35  PA5 (AI 5 / D26)
00044 *       MISO (D 6) PB6  7|        |34  PA6 (AI 6 / D25)
00045 *        SCK (D 7) PB7  8|        |33  PA7 (AI 7 / D24)
00046 *                  RST  9|        |32  AREF
00047 *                  VCC 10|        |31  GND 
00048 *                  GND 11|        |30  AVCC
00049 *                XTAL2 12|        |29  PC7 (D 23)
00050 *                XTAL1 13|        |28  PC6 (D 22)
00051 *       RX0 (D 8)  PD0 14|        |27  PC5 (D 21) TDI
00052 *       TX0 (D 9)  PD1 15|        |26  PC4 (D 20) TDO
00053 *  INT0 RX1 (D 10) PD2 16|        |25  PC3 (D 19) TMS
00054 *  INT1 TX1 (D 11) PD3 17|        |24  PC2 (D 18) TCK
00055 *       PWM (D 12) PD4 18|        |23  PC1 (D 17) SDA
00056 *       PWM (D 13) PD5 19|        |22  PC0 (D 16) SCL
00057 *       PWM (D 14) PD6 20|        |21  PD7 (D 15) PWM
00058 *                        +--------+
00059 *
00060 ****************************************************************************************/
00061 #if BOARD == 1
00062 #define KNOWN_BOARD 1
00063 
00064 #if !defined(__AVR_ATmega644P__) && !defined(__AVR_ATmega1284P__) 
00065 #error Oops!  Make sure you are compiling for the correct chip (ATmega644P or ATmega1284p)
00066 #endif
00067 
00068 #define LFUSE (FUSE_CKSEL3)
00069 #define HFUSE (FUSE_BOOTSZ0 & FUSE_SPIEN)
00070 #define EFUSE (0xFF)
00071 
00072 #define F_CPU 20000000UL     // 20 MHz
00073 
00074 #define X_ENABLE_PIN       24
00075 #define X_STEP_PIN         26
00076 #define X_DIR_PIN          25
00077 
00078 #define Y_ENABLE_PIN       24
00079 #define Y_STEP_PIN         23
00080 #define Y_DIR_PIN          22
00081 
00082 #define Z_ENABLE_PIN       21
00083 #define Z_STEP_PIN         20
00084 #define Z_DIR_PIN          19
00085 
00086 #define E_ENABLE_PIN       18
00087 #define E_STEP_PIN         17
00088 #define E_DIR_PIN          16
00089 
00090 
00091 #define X_MIN_PIN           0
00092 #define Y_MIN_PIN           1
00093 #define Z_MIN_PIN           2
00094 
00095 #define X_MAX_PIN          -1 //31
00096 #define Y_MAX_PIN          -1 //30
00097 #define Z_MAX_PIN          -1 //29
00098 
00099 
00100 //These pins must be connected to OCR0A and OCR0B!
00101 #define HEAT1_PIN           3
00102 #define HEAT2_PIN           4
00103 
00104 #define TEMP1_PIN           3 //Analog numbering
00105 #define TEMP2_PIN           4 //Analog numbering
00106 
00107 #define NOZZLE_HEATER_INVERTED   0
00108 #define PRINTBED_HEATER_INVERTED 0
00109 
00110 #define X_ENABLE_INVERTED   1
00111 #define Y_ENABLE_INVERTED   1
00112 #define Z_ENABLE_INVERTED   1
00113 #define E_ENABLE_INVERTED   1
00114 
00115 #define X_STEP_INVERTED     0
00116 #define Y_STEP_INVERTED     0
00117 #define Z_STEP_INVERTED     0
00118 #define E_STEP_INVERTED     0
00119 
00120 #define X_MIN_ENDSTOP_INVERTED  0
00121 #define Y_MIN_ENDSTOP_INVERTED  0
00122 #define Z_MIN_ENDSTOP_INVERTED  0
00123 
00124 #endif // BOARD == 1
00125 
00126 
00127 
00128 
00129 #ifndef KNOWN_BOARD
00130 #error Unknown BOARD value in config.h
00131 #endif
00132 
00133 #endif // BOARDS_H
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines