]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avr/config.inc
SVN --> GIT
[avrcpm.git] / avr / config.inc
index 4f928a5a21ae467e8a9ee6b4bbc5fc6a292266d7..38dc7932380f506cbde06ca1aa075d682635feeb 100644 (file)
 ;    You should have received a copy of the GNU General Public License
 ;    along with avrcpm.  If not, see <http://www.gnu.org/licenses/>.
 ;
-;    $Id$
+;    $Id: config.inc 242 2015-12-11 16:05:52Z rapid $
 
 
-#define VMAJOR 3               /* Version number */
-#define VMINOR 2
+#define VMAJOR   3             /* Version number */
+#define VMINOR   5
+#define VERS_STR "3.5"
+
 
 ;-----------------------------------------------------------------------
 ;
 ; or use the I2C pins for other purposes.
 ;#define I2C_SUPPORT
 
+; Support for the SC16IS740 I2C UART chip is included automatically, when
+; I2C support is enabled. Uncomment and set to 0 if you don't want support for
+; the SC16IS740 I2C UART chip.
+;#define I2C_UART_SUPPORT 1
+
 ; Emulate Z80 cpu if 1, 8080 otherwise.
 ;
 ;#define EM_Z80        1
 ;-----------------------------------------------------------------------
 ;Debugging aids
 
-.equ BOOTWAIT      = 1
-.equ MEMTEST       = 1
-.equ MEMFILL       = 1         /* Fill DRAM */
-.equ SRAM_FILL     = 1         /* Fill unused SRAM */
-.equ MMC_DEBUG     = 0         /* Increase for more debugging */
-.equ MMC_DEBUG_RDW = 0
-.equ DSKSEL_DEBUG  = 0
-.equ DISK_DEBUG    = 0         /* 1 = BOOT/HOME debug, 2 = +R/W debug */
-.equ HOSTRW_DEBUG  = 0
-.equ FAT16_DEBUG   = 0
-.equ FAT16_DBG_FAT = 0
-.equ HEAP_DEBUG           = 0
-.equ PORT_DEBUG    = 0
-.equ INS_DEBUG     = 0
-.equ STACK_DBG     = 0
-.equ PRINT_PC      = 0
-.equ TIMER_DEBUG   = 0
+.equ BOOTWAIT        = 1
+.equ MEMTEST         = 1
+.equ MEMFILL         = 1       /* Fill DRAM */
+.equ SRAM_FILL       = 1       /* Fill unused SRAM */
+.equ MMC_DEBUG       = 0       /* Increase for more debugging */
+.equ MMC_DEBUG_RDW   = 0
+.equ DSKSEL_DEBUG    = 0
+.equ DISK_DEBUG      = 0       /* 1 = BOOT/HOME debug, 2 = +R/W debug */
+.equ HOSTRW_DEBUG    = 0
+.equ FAT16_DEBUG     = 0
+.equ FAT16_DBG_FAT   = 0
+.equ HEAP_DEBUG      = 0
+.equ PORT_DEBUG      = 0
+.equ INS_DEBUG       = 0
+.equ STACK_DBG       = 0
+.equ PRINT_PC        = 0
+.equ TIMER_DEBUG     = 0
+.equ I2C_STATE_DEBUG = 0
+.equ MEMDUMP_DEBUG   = 1
 
 ;-----------------------------------------------------------------------
 ; Z80/8080 Virtual Ports
 #define printTimerCmd  15
 #define uptimeCmd      16
 
-#define DEBUGPORT   0x4F
+#define MEMDUMPPORT    0x09
+#define DEBUGPORT      0x4F
 
-#define startTraceCmd 0x01                     /* 'OUT (DEBUGPORT),startTraceCmd' starts tracing */
-#define stopTraceCmd  0x00
-#define PrintStackCmd 0x02
+#define startTraceCmd  0x01            /* 'OUT (DEBUGPORT),startTraceCmd' starts tracing */
+#define stopTraceCmd   0x00
+#define PrintStackCmd  0x02
 
 ; Virtual I2C Interface
 #define I2CSTAT        0x05
 #define ADCBGL 0x20                    /* Read 1.1V Bandgap, 10 bit */
 #define ADCBGH 0x21                    /* Read 1.1V Bandgap, 10 bit */
 
+; ISC16IS740 UART
+#define I2C_UART 0x50                  /* ISC16IS740 base port */
 
 ; Port-Expander PCF8574
 #define PORT   0x80
 #define REFR_RATE   64000       /* dram refresh rate in cycles/s. */
                                /* Most drams need 1/15.6µs. */
 #define        RXBUFSIZE 128           /* USART recieve buffer size. Must be power of 2 */
-#define        TXBUFSIZE 32            /* USART transmit buffer size. Must be power of 2 */
+.if SRAM_SIZE > 1024
+ .equ TXBUFSIZE = 128          /* USART transmit buffer size. Must be power of 2 */
+.else
+ .equ TXBUFSIZE = 32           /* USART transmit buffer size. Must be power of 2 */
+.endif
+
+.if SRAM_SIZE > 1024
+  .equ FAT16_FATBUF = 1
+.else
+  .equ FAT16_FATBUF = 0
+.endif
+
 
 #define I2C_CLOCK  100000      /* 100kHz */
-#define I2C_BUFSIZE    17      /* largest message size including address byte (SLA) */
+#define I2C_BUFSIZE    66      /* largest message size + slave address (SLA) + subaddress */
 
 
 #define MMC_SPI2X  1           /* 0 = SPI CLK/4, 1 = SPI CLK/2 */
 #ifndef ADC_SUPPORT
   #define ADC_SUPPORT 1
 #endif
+#ifndef I2C_UART_SUPPORT
+  #define I2C_UART_SUPPORT I2C_SUPPORT
+#endif
+#if I2C_UART_SUPPORT
+  #define SC16IS740_ADDR  0x90    /* SC16IS740 I2C address. (8bit, A0=VDD, A1=VDD) */
+  #define SC16IS740_CLOCK 9216000  /*  */
+#endif
 
 #ifndef EM_Z80
   #define EM_Z80 1             /* Emulate Z80 if true, else 8080 */
   #define TESTVERSION 0
 #endif
 
+#define TC_1MS (F_CPU/1000)
+#define TC_1US (F_CPU/1000000)
+
 ;-----------------------------------------------------------------------
 ; Port declarations
 
 .equ RAM_CAS   = 1
 .equ RAM_OE    = 2
 .equ RAM_W     = 3
+.equ SDA       = 4
+.equ SCL       = 5
 
 .equ P_RAS     = PORTC
 .equ P_CAS     = PORTC
 .equ P_OE      = PORTC
 .equ P_W       = PORTC
+.equ P_I2C     = PORTC
 
 
 #else  /* 4 bit RAM, hardware uart */
   #define CPUSTR "8080"
 #endif
 #if TESTVERSION
-  #define TESTSTR "Test"
+  #define TESTSTR " Test"
 #else
   #define TESTSTR ""
 #endif