Changeset 7d5e268 in avrstuff for CPC stuff/cpc_serial_2313/code/main.asm
- Timestamp:
- Oct 29, 2010, 8:03:56 PM (14 years ago)
- Branches:
- main
- Children:
- 98713b5
- Parents:
- 741c0b9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CPC stuff/cpc_serial_2313/code/main.asm
r741c0b9 r7d5e268 14 14 15 15 .EQU CTRLIN = PIND 16 .EQU A0 = PIND4 16 .EQU CTRLOUT = PORTD 17 .EQU CTRLDIR = DDRD 18 19 .EQU A0 = PIND5 20 .EQU _READ = PIND3 21 .EQU _WRITE = PIND2 22 .EQU DEL = PIND6 23 .EQU INT = PIND4 17 24 18 25 .EQU curregbak = SRAM_START … … 74 81 75 82 ; release the bus 76 LDI R16,ALL_IN83 SER R16 77 84 OUT DATADIR, R16 78 LDI R16,ALL_OUT85 CLR R16 79 86 80 87 ; Restore R27 to selected reg. (we erased it to do the OUT) … … 112 119 ; * Set up the INT0 and INT1 so the CPC can do the rest of the setup itself 113 120 init: 114 ; setup ctrl port : RW and A0 as inputs, INT as output 121 CLI 122 ; setup ctrl port : RW and A0 as inputs, INT and DEL as output 123 LDI R16,0x28 124 OUT CTRLDIR,R16 125 126 ; setup dataport as input 127 CLR R0 128 OUT DATADIR,R0 129 115 130 ; led on (will be turned off by software at init) 131 SBI CTRLOUT,DEL 132 116 133 ; init serial port speed and io 134 LDI R16,10 135 OUT UBRR,R16 136 117 137 ; check for bootloader jumper and jump to bootload code if needed 138 ; TODO 118 139 140 ; setup interrupts (enable INT0 and INT1 on falling edge) 141 LDI R16,0x0A 142 OUT MCUCR,R16 143 144 LDI R16,0xC0 145 OUT GIMSK,R16 146 147 ; we can now enable interrupts 119 148 SEI 149 120 150 mainloop: 121 151 ; maybe we will have to handle a buffer for the serial port
Note:
See TracChangeset
for help on using the changeset viewer.