e05: use 23LC512 (RAM) and 25LC256 (EEPROM) via spi_sw.
This commit is contained in:
@@ -72,3 +72,45 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; software SPI module
|
||||||
|
|
||||||
|
|
||||||
|
.equ SPISW_MOSI_DDR = DDRA
|
||||||
|
.equ SPISW_MOSI_INPUT = PINA
|
||||||
|
.equ SPISW_MOSI_OUTPUT = PORTA
|
||||||
|
.equ SPISW_MOSI_PIN = PORTA6
|
||||||
|
|
||||||
|
.equ SPISW_MISO_DDR = DDRA
|
||||||
|
.equ SPISW_MISO_INPUT = PINA
|
||||||
|
.equ SPISW_MISO_OUTPUT = PORTA
|
||||||
|
.equ SPISW_MISO_PIN = PORTA5
|
||||||
|
|
||||||
|
.equ SPISW_SCK_DDR = DDRA
|
||||||
|
.equ SPISW_SCK_INPUT = PINA
|
||||||
|
.equ SPISW_SCK_OUTPUT = PORTA
|
||||||
|
.equ SPISW_SCK_PIN = PORTA4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; SPI RAM
|
||||||
|
|
||||||
|
.equ RAMCS_DDR = DDRB
|
||||||
|
.equ RAMCS_INPUT = PINB
|
||||||
|
.equ RAMCS_OUTPUT = PORTB
|
||||||
|
.equ RAMCS_PIN = PORTB0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; SPI EEPROM
|
||||||
|
|
||||||
|
|
||||||
|
.equ EEPROMCS_DDR = DDRB
|
||||||
|
.equ EEPROMCS_INPUT = PINB
|
||||||
|
.equ EEPROMCS_OUTPUT = PORTB
|
||||||
|
.equ EEPROMCS_PIN = PORTB1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,9 @@
|
|||||||
#define MODULES_LED1
|
#define MODULES_LED1
|
||||||
#define MODULES_NETWORK
|
#define MODULES_NETWORK
|
||||||
#define MODULES_COM2W
|
#define MODULES_COM2W
|
||||||
|
#define MODULES_SPI_SW
|
||||||
|
#define MODULES_RAM_23LC512
|
||||||
|
#define MODULES_EE_25LC256
|
||||||
;#define MODULES_TWI_MASTER
|
;#define MODULES_TWI_MASTER
|
||||||
;#define MODULES_LCD
|
;#define MODULES_LCD
|
||||||
;#define LCD_MINIMAL_FONT
|
;#define LCD_MINIMAL_FONT
|
||||||
@@ -132,6 +135,14 @@ firmwareStart:
|
|||||||
; @routine onSystemStart
|
; @routine onSystemStart
|
||||||
|
|
||||||
onSystemStart:
|
onSystemStart:
|
||||||
|
; external SRAM check
|
||||||
|
bigcall RAM_23LC512_WritePattern
|
||||||
|
nop
|
||||||
|
bigcall RAM_23LC512_ReadPattern
|
||||||
|
brcs onSystemStart_done
|
||||||
|
bigcall DEBUG1
|
||||||
|
|
||||||
|
onSystemStart_done:
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|
||||||
@@ -183,7 +194,7 @@ onEveryLoop:
|
|||||||
.include "devices/all/hw_tn84.asm"
|
.include "devices/all/hw_tn84.asm"
|
||||||
.include "devices/all/includes.asm"
|
.include "devices/all/includes.asm"
|
||||||
|
|
||||||
;.include "common/debug.asm"
|
.include "common/debug.asm"
|
||||||
;.include "modules/network/msg/debug-w.asm"
|
;.include "modules/network/msg/debug-w.asm"
|
||||||
|
|
||||||
|
|
||||||
@@ -201,3 +212,4 @@ deviceCodeEnd:
|
|||||||
.warning "Code reaches into boot loader!"
|
.warning "Code reaches into boot loader!"
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user