Mercurial > public > mk2
changeset 715:de413161f00c
256ms switch debounce timer
author | heinrichsweikamp |
---|---|
date | Tue, 21 May 2013 12:17:49 +0200 |
parents | b7f7184d800d |
children | d333c8462844 |
files | code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/isr.asm |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm Thu May 16 14:16:09 2013 +0200 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Tue May 21 12:17:49 2013 +0200 @@ -57,7 +57,8 @@ ; #DEFINE SSPADD_VALUE d'16' ; 400kHz I2C clock @ 32MHz Fcy #DEFINE SSPADD_VALUE d'32' ; 200kHz I2C clock @ 32MHz Fcy #DEFINE SSPSTAT_VALUE b'00000000' ; with slew rate control - #DEFINE T0CON_VALUE b'00010000' ; Timer0 +; #DEFINE T0CON_VALUE b'00010000' ; Timer0 1:2 -> 32ms + #DEFINE T0CON_VALUE b'00010011' ; Timer0 1:16 -> 256ms #DEFINE SPEED_32MHz #DEFINE FT_SMALL .0
--- a/code_part1/OSTC_code_asm_part1/isr.asm Thu May 16 14:16:09 2013 +0200 +++ b/code_part1/OSTC_code_asm_part1/isr.asm Tue May 21 12:17:49 2013 +0200 @@ -162,7 +162,8 @@ timer0_restart: bcf INTCON,TMR0IF ; Clear flag - clrf T0CON ; Timer0 + movlw T0CON_VALUE + movwf T0CON ; Timer0 clrf TMR0H clrf TMR0L bsf T0CON,TMR0ON ; Start Timer 0