]> cloudbase.mooo.com Git - avrcpm.git/blobdiff - avr/config.inc
* I2C: Don't get stuck, if pullups are missing (timeout error)
[avrcpm.git] / avr / config.inc
index 9c3ed22d693980eb1f6dd1866370766997d5fcf5..5917a0644de48e1fd6f599b9346b62e0f7673dfb 100644 (file)
 
 
 #define VMAJOR 3               /* Version number */
-#define VMINOR 0
+#define VMINOR 1
 
 #ifndef DRAM_8BIT
-  #define DRAM_8BIT 1          /* 1 = 8bit wide DRAM */
-#endif
+  #define DRAM_8BIT 1          /* 1 = 8bit wide data bus to DRAM (ie two 4-bit Chips)*/
+#endif                         /* 0 = only one 4 bit wide DRAM chip */
 #ifndef F_CPU
   #define F_CPU  20000000      /* system clock in Hz; defaults to 20MHz */
 #endif
 #ifndef BAUD
   #define BAUD   38400         /* console baud rate */
 #endif
-#define K 1024
-#define M 1024*K
-
-;#define RAMSIZE 256*K*4       /* 1 chip 256Kx4 */
-#define  RAMSIZE   4*M*4 * 2   /* 2 chips 4Mx4  */
+#ifndef I2C
+    #define I2C  0             /* I2C requires 8 bit DRAM */
+#endif
+#if I2C && !DRAM_8BIT
+  #error "I2C requires 8 bit DRAM (DRAM_8BIT=1)!"
+#endif
 
-#define EM_Z80 1               /* Emulate Z80 if true */
+#define EM_Z80 1               /* Emulate Z80 if true, else 8080 */
 
 #ifndef FAT16_SUPPORT
   #define FAT16_SUPPORT 1      /* Include Support for FAT16 Partitions */
 #endif                         /*  which may contain CP/M image files. */ 
-#define RAMDISKCNT    0                /* Number of RAM disks */
+#define RAMDISKCNT    4                /* Number of RAM disks */
 #define RAMDISKNR     'I'-'A'  /* Drive "letter" for first RAM disk */
 
 #define PARTID 0x52            /* Partition table id */
 #define        RXBUFSIZE 128           /* USART recieve buffer size. Must be power of 2 */
 #define        TXBUFSIZE 128           /* USART transmit buffer size. Must be power of 2 */
 
+#define I2C_CLOCK  100000      /* 100kHz */
+#define I2C_BUFSIZE    17      /* largest message size including address byte (SLA) */
 
-#if EM_Z80
-  #define CPUSTR "Z80"
-#else
-  #define CPUSTR "8080"
-#endif
 
 .equ BOOTWAIT      = 1
 .equ MEMTEST       = 1
@@ -80,6 +77,7 @@
 .equ INS_DEBUG     = 0
 .equ STACK_DBG     = 0
 .equ PRINT_PC      = 0
+.equ TIMER_DEBUG   = 0
 
 #define MMC_SPI2X  1           /* 0 = SPI CLK/4, 1 = SPI CLK/2 */
 
 .equ P_MMC_CS  = PORTB
 .equ P_A8      = PORTB
 .equ P_RXD     = PORTB
+.equ P_TXD     = PORTB
 
 ;Port C
 .equ RAM_RAS   = 0
 #define TIMER_CTL   TIMERPORT
 #define TIMER_MSECS TIMERPORT+1
 #define TIMER_SECS  TIMER_MSECS+2
+#define        CLOCKPORT   TIMERPORT+7
 
 #define starttimercmd  1
 #define quitTimerCmd   2
 #define startTraceCmd 1
 #define stopTraceCmd  0
 
+; Virtual I2C Interface
+#define I2CSTAT        0x05
+#define I2CCTRL        0x05
+#define I2CBLEN        0x06
+#define I2CADR 0x07
+#define I2CADRL        0x07
+#define I2CADRH        0x08
+
+; Port-Expander PCF8574
+#define PORT   0x80
+#define PORT0  0x80
+#define PORT1  0x81
+#define PORT2  0x82
+#define PORT3  0x83
+#define PORT4  0x84
+#define PORT5  0x85
+#define PORT6  0x86
+#define PORT7  0x87
+
+
+#if EM_Z80
+  #define CPUSTR "Z80"
+#else
+  #define CPUSTR "8080"
+#endif
 
 #if defined __ATmega8__
 .equ   RXTXDR0 = UDR
 
 ; vim:set ts=8 noet nowrap
 
-