Mercurial > public > hwos_code
comparison src/external_flash.asm @ 416:4389fe9673b2
NEW: Support for new logbook memory chip (minor hardware change)
BUGFIX: Button sensitivity was not reset after update in some cases
author | heinrichsweikamp |
---|---|
date | Mon, 18 Apr 2016 14:34:57 +0200 |
parents | 35bdfd89323c |
children | 789230298511 |
comparison
equal
deleted
inserted
replaced
415:fd3865a82519 | 416:4389fe9673b2 |
---|---|
210 movlw b'00000000' ; New status | 210 movlw b'00000000' ; New status |
211 rcall write_spi | 211 rcall write_spi |
212 bsf flash_ncs ; CS=1 | 212 bsf flash_ncs ; CS=1 |
213 | 213 |
214 ; unlock new memory | 214 ; unlock new memory |
215 bsf flash_ncs ; CS=1 | 215 ; bsf flash_ncs ; CS=1 |
216 movlw 0x06 ; WREN command | 216 movlw 0x06 ; WREN command |
217 rcall write_spi | 217 rcall write_spi |
218 bsf flash_ncs ; CS=1 | 218 bsf flash_ncs ; CS=1 |
219 movlw 0x98 ; ULBPR command | 219 movlw 0x98 ; ULBPR command |
220 rcall write_spi | 220 rcall write_spi |
231 | 231 |
232 movlw 0x01 ; WRSR command | 232 movlw 0x01 ; WRSR command |
233 rcall write_spi | 233 rcall write_spi |
234 movlw b'00011100' ; New status (Write protect on) | 234 movlw b'00011100' ; New status (Write protect on) |
235 rcall write_spi | 235 rcall write_spi |
236 bsf flash_ncs ; CS=1 | 236 ; bsf flash_ncs ; CS=1 |
237 | 237 |
238 ; lock new memory | 238 ; lock new memory |
239 bsf flash_ncs ; CS=1 | 239 bsf flash_ncs ; CS=1 |
240 movlw 0x06 ; WREN command | 240 movlw 0x06 ; WREN command |
241 rcall write_spi | 241 rcall write_spi |
263 rcall write_spi | 263 rcall write_spi |
264 rcall ext_flash_write_address ; Write 24bit address ext_flash_address:3 via SPI | 264 rcall ext_flash_write_address ; Write 24bit address ext_flash_address:3 via SPI |
265 bsf flash_ncs ; CS=1 | 265 bsf flash_ncs ; CS=1 |
266 ; bra ext_flash_wait_write ; Wait for write... and return | 266 ; bra ext_flash_wait_write ; Wait for write... and return |
267 ext_flash_wait_write: | 267 ext_flash_wait_write: |
268 WAITMS d'1' ; TBE=25ms... | 268 WAITMS d'5' ; TBE/TSE=25ms... |
269 movlw 0x05 ; RDSR command | 269 movlw 0x05 ; RDSR command |
270 rcall write_spi ; Read status | 270 rcall write_spi ; Read status |
271 rcall write_spi ; Read status into WREG | 271 rcall write_spi ; Read status into WREG |
272 bsf flash_ncs ; CS=1 | 272 bsf flash_ncs ; CS=1 |
273 btfsc SSP2BUF,0 ; Write operation in process? | 273 btfsc SSP2BUF,0 ; Write operation in process? |