n32: run at 8MHz now (1MHz is too slow for counting FAN tacho pulses).

This commit is contained in:
Martin Preuss
2026-07-05 23:16:13 +02:00
parent bafb9c289a
commit e811cf1a8d
2 changed files with 37 additions and 3 deletions

View File

@@ -45,7 +45,7 @@
; green LED
.equ LED1_DEFAULT_ONTIME = 1 ; shorter
.equ LED1_DEFAULT_OFFTIME = 99 ; longer
.equ LED1_DEFAULT_OFFTIME = 49 ; longer
.equ LED1_DEFAULT_REPEATS = 0 ; continous
.equ LED1_DDR = DDRA
.equ LED1_PORT = PORTA

View File

@@ -21,8 +21,8 @@
; ***************************************************************************
.equ clock=1000000 ; Define the clock frequency
;.equ clock=8000000 ; Define the clock frequency
;.equ clock=1000000 ; Define the clock frequency
.equ clock=8000000 ; Define the clock frequency
@@ -120,6 +120,8 @@
rjmp BOOTLOADER_ADDR ; 1: Reset vector Reset Vector
reti ; 2: INT0 External Interrupt 0
rjmp multiFanPinChangeIsr ; 3: PCI Pin Change Interrupt
; reti
reti ; 4: OC1A Timer/Counter1 Compare Match 1A
reti ; 5: OC1B Timer/Counter1 Compare Match 1B
reti ; 6: OVF1 Timer/Counter1 Overflow
@@ -211,6 +213,12 @@ comIrqSetup:
inr r16, MCUCR
cbr r16, (1<<ISC01) | (1<<ISC00)
ori r16, (1<<ISC01) | (0<<ISC00) ; falling edge triggers irq
outr MCUCR, r16
inr r16, GIFR
sbr r16, (1<<INTF1)
outr GIFR, r16
ret
; @end
@@ -254,6 +262,32 @@ comIrqDisable:
; ---------------------------------------------------------------------------
; @routine multiFanIrqSetup
;
; setup IRQ for MULTIFAN module
multiFanIrqSetup:
inr r16, PCMSK1
sbr r16, (1<<PCINT10) | (1<<PCINT12) | (PCINT14); tacho1-3
outr PCMSK1, r16
inr r16, GIMSK
sbr r16, (1<<PCIE1) | (1<<PCIE0)
outr GIMSK, r16
inr r16, GIFR
sbr r16, (1<<PCIF)
outr GIFR, r16
ret
; @end
.equ MULTIFAN_SETUPIRQ_FN = multiFanIrqSetup
; ***************************************************************************